Bill Schilit / BLE_API

Fork of BLE_API by Bluetooth Low Energy

Embed: (wiki syntax)

« Back to documentation index

URIBeaconConfigService Class Reference

URIBeaconConfigService Class Reference

UriBeacon Configuration Service. More...

#include <URIBeaconConfigService.h>

Public Types

enum  TXPowerModes_t {
  TX_POWER_MODE_LOWEST = 0, TX_POWER_MODE_LOW = 1, TX_POWER_MODE_MEDIUM = 2, TX_POWER_MODE_HIGH = 3,
  NUM_POWER_MODES
}
 

Transmission Power Modes for UriBeacon.

More...

Public Member Functions

 URIBeaconConfigService (BLEDevice &bleIn, const char *uriDataIn, uint8_t flagsIn=0, const int8_t defaultPowerLevelsIn[NUM_POWER_MODES]=NULL, const int8_t firmwarePowerLevelsIn[NUM_POWER_MODES]=NULL, TXPowerModes_t powerModeIn=TX_POWER_MODE_LOW, uint16_t beaconPeriodIn=1000)
void setFlags (uint8_t flagsIn)
 Please note that the following public APIs are offered to allow modifying the service programmatically.
void setDefaultTxPowerLevels (const int8_t firmwarePowerLevelsIn[NUM_POWER_MODES], const int8_t defaultPowerLevelsIn[NUM_POWER_MODES])
 Update the txPowerLevels table.
void setTxPowerMode (TXPowerModes_t mode)
 Set the effective power mode from one of the values in the powerLevels tables.
void setBeaconPeriod (uint16_t beaconPeriodIn)
 The period in milliseconds that a UriBeacon packet is transmitted.

Detailed Description

UriBeacon Configuration Service.

Can be used to set URL, adjust power levels, and set flags.

Definition at line 39 of file URIBeaconConfigService.h.


Member Enumeration Documentation

Transmission Power Modes for UriBeacon.

Enumerator:
TX_POWER_MODE_LOWEST 

Lowest TX power mode

TX_POWER_MODE_LOW 

Low TX power mode

TX_POWER_MODE_MEDIUM 

Medium TX power mode

TX_POWER_MODE_HIGH 

High TX power mode

NUM_POWER_MODES 

Number of Power Modes defined

Definition at line 45 of file URIBeaconConfigService.h.


Constructor & Destructor Documentation

URIBeaconConfigService ( BLEDevice bleIn,
const char *  uriDataIn,
uint8_t  flagsIn = 0,
const int8_t  defaultPowerLevelsIn[NUM_POWER_MODES] = NULL,
const int8_t  firmwarePowerLevelsIn[NUM_POWER_MODES] = NULL,
TXPowerModes_t  powerModeIn = TX_POWER_MODE_LOW,
uint16_t  beaconPeriodIn = 1000 
)
Parameters:
ref]ble BLEDevice object for the underlying controller.
[in]uridataURI as a null-terminated string.
[in]flagsInUriBeacon Flags.
[in]powerLevels[]Table of UriBeacon Tx Power Levels in dBm.
[in]powerModeCurrently effective power mode.
[in]beaconPeriodInThe period in milliseconds that a UriBeacon packet is transmitted. A value of zero disables UriBeacon transmissions.

Definition at line 69 of file URIBeaconConfigService.h.


Member Function Documentation

void setBeaconPeriod ( uint16_t  beaconPeriodIn )

The period in milliseconds that a UriBeacon packet is transmitted.

Note:
A value of zero disables UriBeacon transmissions.
Parameters:
beaconPeriodInBeacon advertising period in milliseconds

Definition at line 187 of file URIBeaconConfigService.h.

void setDefaultTxPowerLevels ( const int8_t  firmwarePowerLevelsIn[NUM_POWER_MODES],
const int8_t  defaultPowerLevelsIn[NUM_POWER_MODES] 
)

Update the txPowerLevels table.

Parameters:
[in]powerLevelsInArray of power levels

Definition at line 158 of file URIBeaconConfigService.h.

void setFlags ( uint8_t  flagsIn )

Please note that the following public APIs are offered to allow modifying the service programmatically.

It is also possible to do so over BLE GATT transactions. Update flags of the URIBeacon dynamically.

Parameters:
[in]flagsIn
     *     ### UriBeacon Flags
     *     Bit   | Description
     *     :---- | :----------
     *     0     | Invisible Hint
     *     1..7  | Reserved for future use. Must be zero.
     * 

The `Invisible Hint` flag is a command for the user-agent that tells it not to access or display the UriBeacon. This is a guideline only, and is not a blocking method. User agents may, with user approval, display invisible beacons.

Definition at line 146 of file URIBeaconConfigService.h.

void setTxPowerMode ( TXPowerModes_t  mode )

Set the effective power mode from one of the values in the powerLevels tables.

Parameters:
[in]modeSet the TX Power Mode.

Definition at line 173 of file URIBeaconConfigService.h.