capacitor-community / bluetooth-le

Capacitor plugin for Bluetooth Low Energy
MIT License
280 stars 85 forks source link

Add Bluetooth Disconnect Reasons #686

Closed dennisheerwb closed 1 month ago

dennisheerwb commented 2 months ago

Is your feature request related to a problem? Please describe. For better error investigation on client devices that we do not have access to, it would be helpful to determine the reason why Bluetooth has been disconnected.

Describe the solution you'd like I hereby propose an enhancement to the onDisconnect-callback of the connect method to provide the disconnect reason, ideally in alignment with the HCI_DISCONNECT specification.

peitschie commented 1 month ago

Unfortunately, we generally don't get any of this information passed back from OS itself.

Android simply returns the state as disconnected (source).

iOS gives an error which is converted into a string and reported back to the caller (source).

While I agree the information would be useful, I don't know what can be done here to improve the situation.