This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

(nRF Master Control Panel) how to check if Advertiser Mode is supported?

Hi,

With the latest nRF Master Control Panel App it's possible to simultaneously scan + advertise on some devices. I thought this mode is only supported by devices with at least Android 5.0 and a BT 4.1 chipset, but for some reason some devices meeting this requirements are not able to advertise at all (at least the app tells me they aren't) and other devices with BT 4.0 chipset can simultaneously enter scan and advertising mode.

Can you tell me, how you determine on Android if this mode is supported (in code)?

Thanks and regards Manuel

Parents
  • Manuel,

    The ability of an Android device to act as a peripheral is based upon 2 things:

    1. The ability to instantiate a GATT Server and

    2. The ability to send simultaneous BLE advertisements (thereby allowing other devices to see and connect to your GATT Server)

    The ability to perform both these functions in tandem ensures that the Android device can operate in peripheral mode. Note: a chipsets support of either BT 4.1 or the BT 4.0 spec does not factor into things (as you have seen based upon the premise of your original query).

    Although the APIs for these features were included in Android 5.0 (Lollipop) there was a caveat which meant that the actual device manufacturer had to implement the 2nd feature (ability to send simultaneous BLE advertisements) at the hardware level. e.g. even when running Android 5.0+, the Nexus 4 & 5 do not have the ability to act as a peripheral, however the Nexus 6 & 9 do.

    The following URL highlights the number of known Android based devices (as of Oct 2015) that support Peripheral Mode - https://altbeacon.github.io/android-beacon-library/beacon-transmitter-devices.html

    Determining this feature from code can be done via:

    1. public BluetoothGattServer openGattServer (Context context, BluetoothGattServerCallback callback); - ensures that a GATT Server can be instantiated

    2. bluetoothAdapter.isMultipleAdvertisementSupported(); - ensures that BLE advertisements are supported

    Interestingly, the other new device features listed under the MCP->Device Information can be determined via the: bluetoothAdapter.isOffloadedFilteringSupported(); and bluetoothAdapter.isOffloadedScanBatchingSupported(); calls respectively.

    Let me know whether the above fully clarifies things for you.

    Regards

  • Hi Manuel,

    I'm not entirely surprised by the anomaly you mentioned regarding the Huawei G7. Given that the implementation of peripheral mode in the Android ecosystem was at both the software (OS) level and hardware, this meant that many manufacturers were left to establish support for the feature leading to many disparate results. The following URL may provide some additional insight into the issue - [http://stackoverflow.com/questions/32092902/why-ismultipleadvertisementsupported-returns-false-when-getbluetoothleadverti]

    For each given device, the best practice would be to instantiate both a BluetoothLeAdvertiser as well as a check against the isMultipleAdvertisementSupported(); call in order to fully determine peripheral mode support for that device.

    However, the takeaway should be that only when a call to bluetoothAdapter.isMultipleAdvertisementSupported(); returns true should you be entirely comfortable that you have full Android BLE peripheral support as other implementations could mean that you run out of advertisement resources or some other unknown.

    Regards

Reply
  • Hi Manuel,

    I'm not entirely surprised by the anomaly you mentioned regarding the Huawei G7. Given that the implementation of peripheral mode in the Android ecosystem was at both the software (OS) level and hardware, this meant that many manufacturers were left to establish support for the feature leading to many disparate results. The following URL may provide some additional insight into the issue - [http://stackoverflow.com/questions/32092902/why-ismultipleadvertisementsupported-returns-false-when-getbluetoothleadverti]

    For each given device, the best practice would be to instantiate both a BluetoothLeAdvertiser as well as a check against the isMultipleAdvertisementSupported(); call in order to fully determine peripheral mode support for that device.

    However, the takeaway should be that only when a call to bluetoothAdapter.isMultipleAdvertisementSupported(); returns true should you be entirely comfortable that you have full Android BLE peripheral support as other implementations could mean that you run out of advertisement resources or some other unknown.

    Regards

Children
No Data
Related