Skip to content

iOS: connect() is not throwing error if trying to connect to a peripheral which is not reachable #1042

@lyxiangmelissali

Description

@lyxiangmelissali

I am calling your library (version 1.7.8) function
ble.withPromises.connect(scannedDeviceId, mySuccessCallbackFunction, myErrorCallbackFunction);
also tried
ble.connect(scannedDeviceId, mySuccessCallbackFunction, myErrorCallbackFunction);
Both with the same behaviour (see case 4).
I am connecting to a ble device from our capacitor (version 6.0.0) app on an iPhone or android phone (iPhone 13 mini or Samsung Galaxy S10e).

Cases:

  1. iOS and Android phone: returning PeripheralDataExtended data in mySuccessCallbackFunction successfully if ble is enabled.
  2. iOS and Android phone: entering myErrorCallbackFunction if ble is disabled with errorMessage "Ble is disabled" from BLEError interface. This shows that myErrorCallbackFunction is working.
  3. Android: entering myErrorCallbackFunction if ble is enabled and peripheral is not reachable (e.g. distance from phone to ble device) - errorMessage "Peripheral disconnected" from BLEError interface
  4. iOS: not entering myErrorCallbackFunction if ble is enabled and peripheral is not reachable. There is no response from neither callback function. Also there is no "Peripheral disconnected" errorMesage like in Android. Is this intended behaviour, or some bug in the connect() function?

Thanks for your help.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions