PhilipsHue / flutter_reactive_ble

Flutter library that handles BLE operations for multiple devices.
https://developers.meethue.com/
Other
661 stars 321 forks source link

An issue with connecting more than two devices on certain Apple devices #878

Open SungchangChoi opened 1 month ago

SungchangChoi commented 1 month ago

Describe the bug cannot connect to multiple devices on certain Apple devices

To Reproduce on iPhone MS MAX or iPad air 3,

  1. Connect to one device using connectToDevice( )
  2. After confirming that the first device is connected, connect to another device using connectToDevice( )
  3. Observe that can't connect to second device without any error message

Expected behavior connecting the second device

Smartphone / tablet

Peripheral device

Additional context We are a small company that manufactures equipment for measuring biological signals. Our equipment can be connected to mobile devices (tablets or phones) using an app that utilizes flutter_reactive_ble. This app can connect multiple biological signal measuring devices to a single mobile device. Our tests on several Android devices have shown that it works well, and we have received positive feedback from users.

However, we recently received a report from a new customer using an iPad Air 3. He reported that while he could connect the first device, he was unable to connect the second device. We confirmed the same issue on one of our mobile devices, an iPhone MS Max. Both devices are running the latest OS (iOS 17.5.1). This problem does not occur on other Apple devices we have (iPhone 6+, iPhone 12, iPad Pro 11 (4th Gen.)).

We traced the code and checked the arguments passed to the connectToDevice( ) method in reactive_ble_mobile_platform.dart of the flutter_reactive_ble package but found no differences. To elaborate, the "id" used for the first successful connection and the second failed connection attempt on the iPhone MS Max was the same. The "servicesWithCharacteristicsToDiscover" and "timeout" parameters were always null.

Flutter Doctor [✓] Flutter (Channel stable, 3.22.1, on macOS 14.4.1 23E224 darwin-arm64, locale ko-KR) • Flutter version 3.22.1 on channel stable at /Users/fitsig/Development/flutter • Upstream repository https://github.com/flutter/flutter.git • Framework revision a14f74ff3a (7 weeks ago), 2024-05-22 11:08:21 -0500 • Engine revision 55eae6864b • Dart version 3.4.1 • DevTools version 2.34.3

[✓] Android toolchain - develop for Android devices (Android SDK version 33.0.1) • Android SDK at /Users/fitsig/Library/Android/sdk • Platform android-33, build-tools 33.0.1 • Java binary at: /Applications/Android Studio.app/Contents/jre/Contents/Home/bin/java • Java version OpenJDK Runtime Environment (build 11.0.12+0-b1504.28-7817840) • All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS (Xcode 15.0.1) • Xcode at /Applications/Xcode.app/Contents/Developer • Build 15A507 • CocoaPods version 1.14.2

[✓] Android Studio (version 2021.2) • Android Studio at /Applications/Android Studio.app/Contents • Flutter plugin can be installed from: 🔨 https://plugins.jetbrains.com/plugin/9212-flutter • Dart plugin can be installed from: 🔨 https://plugins.jetbrains.com/plugin/6351-dart • Java version OpenJDK Runtime Environment (build 11.0.12+0-b1504.28-7817840)

[✓] Connected device (4 available) • App.Fitsig의 iPad (mobile) • 00008112-001C19862180201E • ios • iOS 17.5.1 21F90 • iPhone XS Max (mobile) • 00008020-001439C901E2002E • ios • iOS 17.5.1 21F90 • macOS (desktop) • macos • darwin-arm64 • macOS 14.4.1 23E224 darwin-arm64 • Mac Designed for iPad (desktop) • mac-designed-for-ipad • darwin • macOS 14.4.1 23E224 darwin-arm64

[✓] Network resources • All expected network resources are available.

• No issues found!