Skip to content
This repository was archived by the owner on Aug 1, 2023. It is now read-only.
This repository was archived by the owner on Aug 1, 2023. It is now read-only.

Misuse of mBluetoothAdapter.isMultipleAdvertisementSupported() #67

@farmazon3000

Description

@farmazon3000

In https://github.com/WebBluetoothCG/ble-test-peripheral-android/blob/master/app/src/main/java/io/github/webbluetoothcg/bletestperipheral/Peripheral.java there is:

if (!mBluetoothAdapter.isMultipleAdvertisementSupported()) {
  Toast.makeText(this, R.string.bluetoothAdvertisingNotSupported, Toast.LENGTH_LONG).show();
  Log.e(TAG, "Advertising not supported");
}

And this is misuse of isMultipleAdvertisementSupported, check this AltBeacon/android-beacon-library#266:

It is important to understand that just because isMultipleAdvertisementSupported() returns false does not mean that the device cannot advertise at all -- it means either that it cannot advertise at all OR that it can only transmit one advertisement at a time. Many Motorola devices (Moto X, Moto G) behave this way. The way you are supposed to check if advertising is supported at all is to get an instance of BluetoothLEAdvertiser. If the call to get an instance fails, then it is not supported.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions