capacitor-community/bluetooth-le

BLE disconnect doesn’t throw error when device ID doesn’t pertain to a connected peripheral

karunt opened this issue · 2 comments

karunt commented

Describe the bug
When using the disconnect function with a device ID to which the android device isn’t connected, disconnect still resolves and no error is thrown.

To Reproduce
Call BLEClient.disconnect with a device ID to which android device isn’t connected. Disconnect will resolve as opposed to throwing an error.

Expected behavior
Disconnect should throw an error instead.

Screenshots
If applicable, add screenshots to help explain your problem.

Plugin version:

  • @capacitor-community/bluetooth-le: latest version

Desktop (please complete the following information):

  • OS:
  • Browser: Firefox, IE
  • Version

Smartphone (please complete the following information):

  • Device: Android
  • OS:
  • Browser: Firefox, IE
  • Version [e.g. 22]

Additional context
Add any other context about the problem here.

pwespi commented

That's by design and it's the same behavior on all platforms. You can say that when you call disconnect, the desired state is to be disconnected, and if you're already disconnected, then it's all good. It's the same with the connect call. If you're already connected, and you call connect again, it doesn't throw an error. Is there a problem with that?

It looks like this issue didn't get the information it needed, so I'll close it for now. If I made a mistake, sorry! I am just a bot.

Have a great day!
Capacitor Community Bot 💙