Skip to content

BLE beacons

Beacons are BLE (Bluetooth Low Energy) devices that send out advertisement packets that can be received by any Bluetooth device nearby. They can be used for triggering offers in apps while users are walking in a store, sending out sensor values, or any other advertisement based data that only needs one-way communication.

Use cases

Mobile marketing

By placing beacons in a store, it is possible to trigger deals to open in a user's smart phone when they are in the beacons' proximity.

image not loaded
Figure 1: A store with beacons

By combining the IPv6 mesh technology with MiraOS and beacon functionality, it is easy to remotely update the offers in the beacons.

Indoor positioning

By having beacons placed around the building as anchors, a smart phone can use their positions and the estimated distance from these beacons to give an absolute position inside the building.

Sensor values

Beacons can locally send out sensor values as beacons, for instance the temperature and air quality in a room as collected by a HVAC system.

image not loaded
Figure 2: Sensor values shown in app

Sensor values could be collected from different sensors in the room, and aggregated into a single beacon packet to be transmitted by one of the nodes, rather than by all nodes.

Network status

Beacons can also be used to have Mira nodes advertise their network status for an installer, to easily see a node's status direcly in a smart phone app.

Beacon types

There are several beacon types, which have different packet formats and features. We will only mention the two most common here, iBeacons and Eddystone.

iBeacon

iBeacon was released by Apple in 2013. It was originally designed to allow retailers to trigger on-site offers to customers with a compatible app in their smartphones. iOS has built-in native support for iBeacons, and it's also supported in Android by using 3rd party libraries.

Read more at https://developer.apple.com/ibeacon/

Eddystone

Eddystone is a beacon profile released by Google in 2015 and can be used without restrictions. Eddystone also contains a telemetry frame (Eddystone-TLM) designed for reporting on a beacon's health, including for example battery level.

Read more at https://developers.google.com/beacons/

In the example directory in the MiraOS SDK you will find an example of an Eddystone beacon transmitting an URL.

Others

There are several other formats as well, and it is also possible to create custom beacon types of your own to suit your specific need.

Defines

MIRA_BLE_ADVERTISEMENT_PAYLOAD_LEN_MAX

#define MIRA_BLE_ADVERTISEMENT_PAYLOAD_LEN_MAX

Enums

mira_ble_advertisement_address_type_t

BLE advertisement source address type

Name Description
MIRA_BLE_ADVERTISEMENT_ADDRESS_TYPE_STATIC Default
MIRA_BLE_ADVERTISEMENT_ADDRESS_TYPE_RANDOM

Functions

mira_ble_advertisement_send_adv_nonconn_ind

mira_status_t mira_ble_advertisement_send_adv_nonconn_ind(mira_ble_advertisement_address_type_t source_address_type, const void *payload, uint8_t payload_len);

Send a non connection BLE advertisement packet.

Note

While up to 10 advertisements per second is supported, keep in mind that BLE-beacons use the radio, and therefore impact Mira network performance. Use BLE-beacons with constraint in performance sensitive Mira applications.

Note

With Mira net initialized but the node not joined, calling this function too often affects join time negatively.

Parameters

Name Description
source_address_type Type of source address (TX address bit).
payload Payload of the advertisement packet.
payload_len Length of the payload of the advertisement packet.

Return value

Status of the operation.

Return value

Name Description
MIRA_SUCCESS The BLE advertisement was successful.
MIRA_BLE_ADVERTISEMENT_ERROR_UNABLE_TO_SEND_PACKET The BLE advertisement was unsuccessful.
Back to top