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

直接连接 Direct connection #60

Open Styxxxxxxxx opened 7 months ago

Styxxxxxxxx commented 7 months ago

Hi, By using the demo scene you provided,I can subscribe my sensor's character and read the poll back data successfully.So i'm wondering if i get the service id and character id in advance,can i use SubscribeCharacteristic directly to get the data?Cause I don't know how the underlying layer of this DLL works

adabru commented 7 months ago

Not sure. If I remember correctly I had problems doing that. But just try it out. If it doesn't work, you can do it like here:

https://github.com/adabru/BleWinrtDll/blob/f2635b7b02432ea3006983657107f092c862171d/DebugBle/Program.cs#L42-L50

and here:

https://github.com/adabru/BleWinrtDll/blob/f2635b7b02432ea3006983657107f092c862171d/DebugBle/BLE.cs#L192-L206

https://github.com/adabru/BleWinrtDll/blob/f2635b7b02432ea3006983657107f092c862171d/DebugBle/BLE.cs#L167-L179