chuongle
chuongle

Reputation: 49

Can we monitor BLE service the same way as we monitor beacon (enter region, exit region)?

I'm trying to wrap my head around the different between regular BLE service and Beacon. Based on this post BLE beacon frame is just a specialized payload inside a BLE advertisement frame. iOS and Android both allow us to monitor if we enter or exit beacon region. Is it possible to do the same thing for BLE service?

Upvotes: 0

Views: 139

Answers (1)

davidgyoung
davidgyoung

Reputation: 64941

The short answer is YES, you can use a BLE service in a similar way monitoring beacons. But there are disadvantages:

The term BLE Service is more precisely referred to as a Bluetooth LE GATT Service. This is much more complex than a standalone Bluetooth LE advertisement used by a Bluetooth LE Beacon.

To use a Bluetooth LE Beacon:

  1. The Bluetooth LE device advertises a Bluetooth LE advertisement with a fixed series of bytes that uniquely identify the beacon, typically sending out one packet at a rate between 1Hz and 10HZ.

  2. Mobile phones listen for the Bluetooth LE advertisement with a Bluetooth LE scan.

  3. The mobile phone uses a beacon SDK (e.g. CoreBluetooth on iOS and the Android Beacon Library or others on Android) to convert appearances/disappearances of advertisements in these scans into "enter region" and "exit region" events. A beacon identifier is embedded inside the advertisement, and is passed on by the SDK through these events.

To use a Bluetooth LE GATT Service, steps 1 and 2 are the same as above. But then things get much more complicated:

  1. Software on the mobile phone establishes a connection with the Bluetooth LE device.
  2. Software on the mobile phone queries the Bluetooth LE device for GATT Services
  3. Software on the mobile phone queries the Bluetooth LE device for GATT Characteristics supported by a specific GATT Service of interest
  4. Software on the mobile phone reads the value of a GATT characteristic, which will return a value stored inside the Bluetooth LE device. For beacon-like use cases, this characteristic will often-store a beacon identifier, much like is embedded in the advertisement itself in the case of a traditional Bluetooth LE Beacon.
  5. Custom software converts the appearance/disappearance of this device hosting the Bluetooth LE GATT service to enter/exit region events based on the identifier embedded in the GATT characteristic.

Using a technique like above, you certainly can use Bluetooth LE services like beacons. But it is much more complex and requires custom software do to it. This is why it is far more common to use the more standard approach of not using a service.

Upvotes: 2

Related Questions