Wirepas SDK
|
Wirepas Mesh stack is capable of using the idle time between network protocol radio transmissions to transmit Bluetooth LE compatible beacons. The Beacon TX library provides an API for configuring each node to transmit beacons. It is recommended to read document WP-RM-103 - Wirepas Mesh Beacon API Reference Manual for an introduction of beacon support in the Wirepas Mesh stack. The Beacon TX library is not available on all radio architectures, only supported in 2.4GHz radio architectures.
Library services are accessed via lib_beacon_tx handle.
For examples on how to use these services, check out example application ble_beacon.
Definition in file wms_beacon_tx.h.
Go to the source code of this file.
Typedefs | |
typedef app_res_e(* | app_lib_beacon_tx_clear_beacons_f) (void) |
typedef app_res_e(* | app_lib_beacon_tx_enable_beacons_f) (bool enabled) |
typedef app_res_e(* | app_lib_beacon_tx_set_beacon_interval_f) (uint32_t interval) |
typedef app_res_e(* | app_lib_beacon_tx_set_beacon_power_f) (uint8_t index, int8_t *power_p) |
typedef app_res_e(* | app_lib_beacon_tx_set_beacon_channels_f) (uint8_t index, app_lib_beacon_tx_channels_mask_e mask) |
typedef app_res_e(* | app_lib_beacon_tx_set_beacon_contents_f) (uint_fast8_t index, const uint8_t *bytes, size_t num_bytes) |
Data Structures | |
struct | app_lib_beacon_tx_t |
Enumerations | |
enum | app_lib_beacon_tx_channels_mask_e { APP_LIB_BEACON_TX_CHANNELS_37 = 0, APP_LIB_BEACON_TX_CHANNELS_38, APP_LIB_BEACON_TX_CHANNELS_39, APP_LIB_BEACON_TX_CHANNELS_37_38, APP_LIB_BEACON_TX_CHANNELS_37_39, APP_LIB_BEACON_TX_CHANNELS_38_39, APP_LIB_BEACON_TX_CHANNELS_37_38_39, APP_LIB_BEACON_TX_CHANNELS_ALL = APP_LIB_BEACON_TX_CHANNELS_37_38_39 } |
Macros | |
#define | APP_LIB_BEACON_TX_NAME 0x0cb930b8 |
"BCONTX" More... | |
#define | APP_LIB_BEACON_TX_VERSION 0x200 |
#define | APP_LIB_BEACON_TX_MIN_INTERVAL 100 |
#define | APP_LIB_BEACON_TX_MAX_INTERVAL 60000 |
#define | APP_LIB_BEACON_TX_DEFAULT_INTERVAL 1000 |
#define | APP_LIB_BEACON_TX_MAX_INDEX 7 |
#define | APP_LIB_BEACON_TX_MAX_NUM_BYTES (38) |
typedef app_res_e(* app_lib_beacon_tx_clear_beacons_f) (void) |
Clear all beacon contents and set all values to defaults:
Definition at line 126 of file wms_beacon_tx.h.
typedef app_res_e(* app_lib_beacon_tx_enable_beacons_f) (bool enabled) |
Enable or disable beacon transmissions. A true value enables transmissions, false value disables beacon transmissions. Usually the beacon parameters are set up first and the transmission is enabled after that.
enabled | New state, true for enabled, false otherwise |
Definition at line 142 of file wms_beacon_tx.h.
typedef app_res_e(* app_lib_beacon_tx_set_beacon_channels_f) (uint8_t index, app_lib_beacon_tx_channels_mask_e mask) |
Set the channels to use for a beacon. The index parameter is the beacon number to change, from 0 to APP_LIB_BEACON_TX_MAX_INDEX. mask
is the channel mask, app_lib_beacon_tx_channels_mask_e.
index | Number of beacon (0 .. APP_LIB_BEACON_TX_MAX_INDEX) |
mask | Channels to use for transmission |
Definition at line 203 of file wms_beacon_tx.h.
typedef app_res_e(* app_lib_beacon_tx_set_beacon_contents_f) (uint_fast8_t index, const uint8_t *bytes, size_t num_bytes) |
Set beacon contents. The index
parameter is the beacon number to change, from 0 to APP_LIB_BEACON_TX_MAX_INDEX. bytes
is the beacon contents to set and num_bytes
is the number of bytes, or size, of the beacon. Anatomy of a beacon is shown in WP-RM-103 - Wirepas Mesh Beacon API Reference Manual.
If more than one beacon index is set up, the beacons are transmitted one after another, starting from index 0, separated by a gap set by the lib_beacon_tx->setBeaconInterval() function. Setting bytes to NULL or num_bytes
to 0 disables the beacon for that index.
index | Number of beacon (0 .. APP_LIB_BEACON_TX_MAX_INDEX) |
bytes | Beacon payload, or NULL to disable payload for this index |
num_bytes | Payload size in bytes, or 0 to disable payload for this index |
Definition at line 234 of file wms_beacon_tx.h.
typedef app_res_e(* app_lib_beacon_tx_set_beacon_interval_f) (uint32_t interval) |
Set the interval of beacon transmissions. If more than one beacon is set up, different beacon is transmitted after each interval.
interval | Sending interval in milliseconds |
interval
milliseconds apart Definition at line 162 of file wms_beacon_tx.h.
typedef app_res_e(* app_lib_beacon_tx_set_beacon_power_f) (uint8_t index, int8_t *power_p) |
Set the output power of a beacon. The index
parameter is the beacon number to change, from 0 to APP_LIB_BEACON_TX_MAX_INDEX. power_p
parameter is a pointer to the power value. The value is rounded to the nearest available power and the new value is stored in the address pointed by power_p
.
index | Number of beacon (0 .. APP_LIB_BEACON_TX_MAX_INDEX) |
power_p | Pointer to radio transmission power, in dBm |
power_p
is modified to the used value Definition at line 184 of file wms_beacon_tx.h.
struct app_lib_beacon_tx_t |
The function table returned from app_open_library_f
Definition at line 241 of file wms_beacon_tx.h.
Data Fields | ||
---|---|---|
app_lib_beacon_tx_clear_beacons_f | clearBeacons | |
app_lib_beacon_tx_enable_beacons_f | enableBeacons | |
app_lib_beacon_tx_set_beacon_channels_f | setBeaconChannels | |
app_lib_beacon_tx_set_beacon_contents_f | setBeaconContents | |
app_lib_beacon_tx_set_beacon_interval_f | setBeaconInterval | |
app_lib_beacon_tx_set_beacon_power_f | setBeaconPower |
The type is used as a parameter to lib_beacon_tx->setBeaconChannels(), to select which advertising channels are used for sending the beacon payload.
Definition at line 92 of file wms_beacon_tx.h.
#define APP_LIB_BEACON_TX_DEFAULT_INTERVAL 1000 |
The default interval of beacon transmissions, in milliseconds, to use if lib_beacon_tx->setBeaconInterval() is not called.
Definition at line 64 of file wms_beacon_tx.h.
#define APP_LIB_BEACON_TX_MAX_INDEX 7 |
Maximum beacon index for lib_beacon_tx->setBeaconPower(), lib_beacon_tx->setBeaconChannels() and lib_beacon_tx->setBeaconContents(). Each index is transmitted in a round-robin fashion, separated by the interval, set by lib_beacon_tx->setBeaconInterval() .
Definition at line 75 of file wms_beacon_tx.h.
#define APP_LIB_BEACON_TX_MAX_INTERVAL 60000 |
The maximum amount of time, in milliseconds, between beacon transmissions. Used as a parameter to to lib_beacon_tx->setBeaconInterval().
Definition at line 57 of file wms_beacon_tx.h.
#define APP_LIB_BEACON_TX_MAX_NUM_BYTES (38) |
Maximum number of bytes per beacon, for lib_beacon_tx->setBeaconContents().
Definition at line 85 of file wms_beacon_tx.h.
#define APP_LIB_BEACON_TX_MIN_INTERVAL 100 |
The minimum amount of time, in milliseconds, between beacon transmissions. Used as a parameter to lib_beacon_tx->setBeaconInterval().
Definition at line 50 of file wms_beacon_tx.h.
#define APP_LIB_BEACON_TX_NAME 0x0cb930b8 |
"BCONTX"
This is the library name for use with app_global_functions_t::openLibrary
Definition at line 38 of file wms_beacon_tx.h.
#define APP_LIB_BEACON_TX_VERSION 0x200 |
This is the library version for use with app_global_functions_t::openLibrary
Definition at line 43 of file wms_beacon_tx.h.