BleWinrtDll icon indicating copy to clipboard operation
BleWinrtDll copied to clipboard

Connect 2 DLLs to one BLE IndoorBike

Open ShuohengZhang opened this issue 1 year ago • 3 comments

#26 Hi @adabru, I have fixed the DllNotFoundException by downloading the dlls that are missing. As only the write functions in BleWinrtDll do not work in my project, I want to use my DLL as a substitute. As I tested them separately, they worked well. However, when I use BleWinrtDll to subscribe to the 2ad2 (and ignore the 2ad9), I still cannot subscribe to the write function through my DLL.

Captur1e Capt2ure Capt3ure As the screenshot shows, it goes from line 218 to 220 and does not go in.

At this position, I would like to know if there are any locks in your functions that prevent another app or program from subscribing to the same service? Thank you.

Best regards, Shuoheng

ShuohengZhang avatar Jan 23 '24 12:01 ShuohengZhang

Are you using both dll's simultaneously? Do you get an exception? If not, maybe the service has zero characteristics?

I had problems on getting a BLEDevice or Service multiple times from Windows and had to cache them in BleWinrtDll.cpp. Maybe caching the device/services will help?

adabru avatar Jan 24 '24 17:01 adabru

Yes I'm using them simultaneously, and I got no exception. I think ur right, the second dll subscribed to the service but has no characteristics to find and subscribe ( like blocked by the other one).

Maybe I can try to cache them, but as I have seldom experience with build and test dlls, could you please explain with more detail so that I can have a try.

Thank you !

ShuohengZhang avatar Jan 24 '24 19:01 ShuohengZhang

In line 211, instead of calling device.GetGattServicesAsync()), can you store the service from step 3.1 in a variable and reuse that variable here?

adabru avatar Feb 02 '24 16:02 adabru