flutter_reactive_ble icon indicating copy to clipboard operation
flutter_reactive_ble copied to clipboard

iOS has no name on discovered device on initial scan

Open robin-glimp opened this issue 3 years ago • 1 comments

Describe the bug I tried to scan for my specific device on iOS but on initial scan the name is an empty string. On a second scan the name appeared correctly.

To Reproduce Steps to reproduce the behavior:

  1. Start my custom device that was never discovered by the iPhone used for testing.
  2. Start a scan using
_scanStream = _flutterReactiveBle.scanForDevices(
      withServices: [xxx],
      scanMode: ScanMode.lowLatency,
      requireLocationServicesEnabled: false,
    ).listen((device) {
      // only add if not in list already
      if (_foundDevices.every((element) => element.id != device.id)) {
        _foundDevices.add(device);
       // sort list alphabetically
        _foundDevices.sort((a, b) => a.name.compareTo(b.name));
      }
    });
  1. In the _foundDevices list the devices show up, but with an empty string as the name
  2. If I cancel the stream and then re-start it, the name shows up.
  3. Also any subsequent scan shows the name

Expected behavior I was hoping the name would pop up instantly when it was discovered. Otherwise this will be a very nasty hack in the code to start a rescan.

Smartphone / tablet

  • Device: all iOS devices
  • OS: iOS
  • Package version: 5.0.2

Peripheral device

  • Vendor, model: CUSTOM
  • Does it run a custom firmware / software: yes

robin-glimp avatar Jun 03 '22 11:06 robin-glimp

This looks like device specific issue(custom firmware ), we can not do much about since we don't have your(custom firmware), did you test it in nRF Connect app? if not please do!

Taym95 avatar Jun 13 '22 22:06 Taym95