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

Multiple BLE connections alternating so buffer doesnt get overflood #45

Open
DaanP-2056102 opened this issue Mar 21, 2023 · 3 comments
Open

Comments

@DaanP-2056102
Copy link

Hello I managed to connect 3 BLE devices and everything works super fine, thanks for the DLL.

But for my application (thesis). I have to read data simultaneously meaning that I am reading 0.5 seconds the data from Sensor1, then 1 second reading my sensor 2, and then sensor 3. The buffer data always gets messed up and my code is reading the wrong sensor for each data field. Is it possible to switch between connected BLE devices and then make a scheduler to indicate when every sensor is allowed to read or is this simply not possible with your DLL? Thanks in advance

@adabru
Copy link
Owner

adabru commented Mar 21, 2023

Do you check the deviceId in each data package?

The dll buffer should be unlimited (i.e. RAM size) and both the writing and the reading are synchronized.

queue<BLEData> dataQueue{};

Do you mean the OS/hardware buffer? How large are your bluetooth packages?

I'd guess switching on/off is only supported with unsubscribe/subscribe. But you can try to find the functionality in the Microsoft's UWP BLE documentation (C#). If you find it you can port it to this dll.

@DaanP-2056102
Copy link
Author

Hey there thanks for the insights. I thought that when I called "polldata" I was asking the BLE sensor to send data. But it just always sends data and it is up to me to detect the deviceId and then call the correct method. Thanks a lot for the fast reply!

@adabru
Copy link
Owner

adabru commented Mar 22, 2023

Yeah that's probably confusing because "ReadCharacteristic" is not implemented in the dll although it is a ble functionality. If you need it you can checkout #6 (comment) .

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants