2

I have an Android device broadcasting a BLE advertisement using the following commands of AltBeacon library:

ADVERTISE_MODE_LOW_LATENCY  approx 1 Hz
ADVERTISE_MODE_BALANCED     approx 3 Hz
ADVERTISE_MODE_LOW_POWER    approx 10 Hz

I would like to increase this frequency more than 10 times per second. Is there a way to increase advertising frequency in Android? Or it is unchangeable?

Markus Kauppinen
  • 3,025
  • 4
  • 20
  • 30
Nikita
  • 21
  • 2
  • 100ms is the highest frequency you can broadcast with. That is also usually the maximum common devices allow you to set. – Cheesebaron Nov 21 '18 at 14:23

2 Answers2

2

You can reach it with stopping and starting advertisement with code like this:

while (true) {
    beaconTransmitter.stopAdvertising()
    beaconTransmitter.startAdvertising(beacon, object : AdvertiseCallback() }
1

The different options you have shown that work with the Android Beacon Library's BeaconTransmitter class are built-in to Android. Unfortunately there are no other higher frequencies of transmission offered by Android APIs.

However, on many newer devices you may start more than one advertiser at a time. If you have a device like this (Pixel, Nexus, Galaxy, Nokia) you can simply start more than one BeaconTransmitter instance at a time, each set to advertise 10Hz. If you start 10, you effectively get advertising at 100Hz.

davidgyoung
  • 63,876
  • 14
  • 121
  • 204