Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Connecting and Subscribing to heart sensor #47

Open
99bits opened this issue Apr 4, 2023 · 3 comments
Open

Connecting and Subscribing to heart sensor #47

99bits opened this issue Apr 4, 2023 · 3 comments
Labels
bug Something isn't working

Comments

@99bits
Copy link

99bits commented Apr 4, 2023

Thank you for this really amazing project.
I have a heart sensor and it connects fine and the Scan services and Scan characteristic seems to populate fine.
When I try to subscribe to the sensor, the editor completely hangs. I also built the app and tested it. It also hanged when trying to subscribe to the data.
Correct Heart Service

The heart rate service is 0x180D
0x2A37 is the UUID for the Heart Rate Measurement characteristic

Other information:
Unity 2022.2.13f1
Built for windows 10 standalone, not UWP

Do you know what I am missing.

Thank you in advance.

@adabru
Copy link
Owner

adabru commented Apr 9, 2023

I have no clue. You can try this out: https://docs.microsoft.com/en-us/samples/microsoft/windows-universal-samples/bluetoothle/ and report whether that works for the heart rate measurement subscription.

@lazerbots
Copy link

Hey, I am new to BLE programming and was just checking out the issues. I did notice that in this screenshot the devices appear dozens of times again and again. When I was checking out your BleWinRRDll example project I had the same "problem". I was wondering if this is normal or how I can avoid this. Thanks!

@adabru
Copy link
Owner

adabru commented Jul 14, 2024

Thanks @lazerbots for the remark! You're right, the lines

if (devices[res.id]["name"] != "" && devices[res.id]["isConnectable"] == "True")
{
// add new device to list
GameObject g = Instantiate(deviceScanResultProto, scanResultRoot);
g.name = res.id;
g.transform.GetChild(0).GetComponent<Text>().text = devices[res.id]["name"];
g.transform.GetChild(1).GetComponent<Text>().text = res.id;
}
don't check whether the device was there before. That's a bug. If the device sends multiple updates and has IsConnectable to true on some of them, it will be listed multiple times.

I don't know if that could have something to do with the hanging.

@adabru adabru added the bug Something isn't working label Jul 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants