Skip to main content
Use this API to listen for changes in a BLE device’s connection state, including unexpected disconnections.

Parameters

Callback Parameters

Code Example

Call my.offBLEConnectionStateChanged to remove any existing listener before calling my.onBLEConnectionStateChanged, to avoid registering duplicate listeners that each fire on the same event. IDE simulation is not supported for this API — test on a real device.

my.offBLEConnectionStateChanged

Stop listening

my.connectBLEDevice

Connect to a BLE device