Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The advertised service doesn't show up in any scans #113

Open
MrCsabaToth opened this issue Dec 31, 2022 · 1 comment
Open

The advertised service doesn't show up in any scans #113

MrCsabaToth opened this issue Dec 31, 2022 · 1 comment

Comments

@MrCsabaToth
Copy link

MrCsabaToth commented Dec 31, 2022

I experimented with the example app. Unfortunately I couldn't get it to work: the advertised service doesn't show up in any scans. I'm using a OnePlus Nord Android phone with Android 12 which supposedly supports peripheral mechanisms. The example code doesn't give me any error messages, Bluetooth is enabled and the app has permissions. I tried both the Advertise method and the AdvertiseSet. I'm trying to scan the BLE peripheral with other Android phones using nRF Connect, an iPad with nRF Connect and my laptop (Linux with BlueZ).

  final AdvertiseData advertiseData = AdvertiseData(
    // FTMS
    serviceUuid: '00001826-0000-1000-8000-00805f9b34fb',
    // Indoor Bike
    serviceDataUuid: '00002ad2-0000-1000-8000-00805f9b34fb', // kinda mute without being able to send data
    // according to zwifit/src/ble/enable.js buildAdvertisingData
    serviceData: Uint8List.fromList([2, 0x01, 0x05, 3, 0x03, 0x18, 0x26]),
    // Precor
    manufacturerId: 1819,
    // By the FTMS specification chapter 3
    manufacturerData: Uint8List.fromList([0, 0x18, 0x26, 1, 32, 0]),
  );

  final AdvertiseSettings advertiseSettings = AdvertiseSettings(
    connectable: true,  // I was just trying this if it may help
    advertiseMode: AdvertiseMode.advertiseModeBalanced,
    txPowerLevel: AdvertiseTxPower.advertiseTxPowerMedium,
    timeout: 3600,
  );

  final AdvertiseSetParameters advertiseSetParameters = AdvertiseSetParameters(
    // connectable: true,  // I was just trying this if it may help
    scannable: true,  // I was just trying this if it may help
    txPowerLevel: txPowerMedium,
    duration: 3600,
  );

It's another issue that if I'd see that service I don't seem to find a way to actually communicate data, which kinda makes the whole experiment mute: it has no value if I cannot communicate (#85). But even the mute service does not seem to show.

@microgeniusz80
Copy link

I/BluetoothLeAdvertiser(15672): startAdvertisingSet, calling package name = dev.steenbakker.flutter_ble_peripheral_example
I/BluetoothAdapter(15672): isLeEnabled(): ON
I/FlutterBlePeripheral(15672): onStartSuccess() mode: 2, txPOWER 1
I/BLE Peripheral state (15672): advertising
I/BluetoothLeAdvertiser(15672): stopAdvertising is called
I/BluetoothLeAdvertiser(15672): stopAdvertisingSet, calling package name = dev.steenbakker.flutter_ble_peripheral_example

it seems that as soon as I/BLE Peripheral state (15672): advertising happened, within a second: I/BluetoothLeAdvertiser(15672): stopAdvertising is called

causing, it not to show any advertisement

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants