fuziki / UnityCoreBluetooth

Unity Bluetooth Plugin for iOS & macOS Editor
MIT License
49 stars 13 forks source link

Handle lost connections gracefully... writeWithoutResponse crashes #32

Open gingerjinjo opened 1 year ago

gingerjinjo commented 1 year ago

Firstly, thanks for the work on this library. I can connect a device and stream messages back and forth really nicely, but if the connection to a peripheral device is lost (out of range) then the write (WithoutResponse) crashes both the plugin and Native Example. It looks like CoreBluetooth knows the write will fail, but the plugin doesn't check/handle it.

Have you tested yourself with peripheral devices either being powered-off or going out-of-range?

lehtiniemi commented 1 month ago

I'm also looking for a way to get info on peripheral disconnection. Is there any way to get this info somewhere?