Loss and regain of BLE connection, but characteristic write still says Peripheral Disconnected

Former Member
Former Member

Hi,

My app is connected and merrily writing a characterisic to my device every second.

I loose conenction (walk out of range) see callbacks to indicate loss of connection;

I walk back into range I see connection is made to my device again (LED indicator on device and onConnectedStateChange in simulator); yet attempted characteristic writes throw exception "Peripheral Disconnected".

My code checks device is connected via Device.isConnected() before even trying to write the characteristic; yet the write throws exception "Peripheral Disconnected"?

Is it OK to just resume writing that characteristic on seeing the connection again; or is it like a new connection and I need to go through the initialisation again?

Regards,

Owain