Open AlvinLBS opened 1 year ago
I noticed if I run the Program.cs (by assigning it into Empty object, so i can trigger it), when i hit the Impl.PollService, my Unity also crashed. PollService also using QuittableWait( ) function.
Hi Alvin :), do I understand correctly:
Hi, im a student doing a FYP about BLE communication. Sorry that I only had very little knowledge about Unity and Visual studio coding. Im using the BleWinrtDll Unity/Assets/Scenes/Demo and modify the subscribe function to call ReadPackage. I also changed BleApi.cs to BLE.cs.
I tried to debug line by line, notice the Unity crashed when it reached PollData. So i try to search the error in the library and notice is the QuittableWait(dataQueueSignal, lock) make my Unity crashed. I understand PollData is a function to retrieve data from BLE device, and QuittableWait() used to wait unitl there is data. My BLE device characteristic did not have data thats why it keep waiting (might causing loop).
I create a backup and try to ignore QuittableWait() function and replace it with saveError. So when block=true, and data is empty, it will saveError "no data". Everything work fine and Unity also did display the error (i modified Demo.cs and BLE.cs too so I can start ReadPackage when click subcribe).
May i know what is the problem?