adabru / BleWinrtDll

BLE for Unity 3d in Windows without UWP.
Do What The F*ck You Want To Public License
168 stars 52 forks source link

Connect 2 DLLs to one BLE IndoorBike #63

Open ShuohengZhang opened 7 months ago

ShuohengZhang commented 7 months ago

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

adabru commented 7 months ago

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?

ShuohengZhang commented 7 months ago

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 !

adabru commented 7 months ago

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?