BLE EddystoneService example

Embed: (wiki syntax)

« Back to documentation index

TLMFrame Class Reference

TLMFrame Class Reference

Class that encapsulates data that belongs to the Eddystone-TLM frame. More...

#include <TLMFrame.h>

Public Member Functions

 TLMFrame (uint8_t tlmVersionIn=0, uint16_t tlmBatteryVoltageIn=0, uint16_t tlmBeaconTemperatureIn=0x8000, uint32_t tlmPduCountIn=0, uint32_t tlmTimeSinceBootIn=0)
 Construct a new instance of this class.
void setTLMData (uint8_t tlmVersionIn=0)
 Set the Eddystone-TLM version number.
void constructTLMFrame (uint8_t *rawFrame)
 Construct the raw bytes of the Eddystone-TLM frame that will be directly used in the advertising packets.
size_t getRawFrameSize (void) const
 Get the size of the Eddystone-TLM frame constructed with the current state of the TLMFrame object.
void updateTimeSinceBoot (uint32_t nowInMillis)
 Update the time since boot.
void updateBatteryVoltage (uint16_t tlmBatteryVoltageIn)
 Update the Battery Voltage.
void updateBeaconTemperature (uint16_t tlmBeaconTemperatureIn)
 Update the Beacon Temperature.
void updatePduCount (void)
 Increment the current PDU counter by 1.
uint16_t getBatteryVoltage (void) const
 Get the current Battery Voltage.
uint16_t getBeaconTemperature (void) const
 Get the current Beacon Temperature.
uint8_t getTLMVersion (void) const
 Get the current TLM Version number.

Detailed Description

Class that encapsulates data that belongs to the Eddystone-TLM frame.

For more information refer to https://github.com/google/eddystone/tree/master/eddystone-tlm.

Definition at line 26 of file TLMFrame.h.


Constructor & Destructor Documentation

TLMFrame ( uint8_t  tlmVersionIn = 0,
uint16_t  tlmBatteryVoltageIn = 0,
uint16_t  tlmBeaconTemperatureIn = 0x8000,
uint32_t  tlmPduCountIn = 0,
uint32_t  tlmTimeSinceBootIn = 0 
)

Construct a new instance of this class.

Parameters:
[in]tlmVersionInEddystone-TLM version number to use.
[in]tlmBatteryVoltageInInitial value for the Eddystone-TLM Battery Voltage.
[in]tlmBeaconTemperatureInInitial value for the Eddystone-TLM Beacon Temperature.
[in]tlmPduCountInInitial value for the Eddystone-TLM Advertising PDU Count.
[in]tlmTimeSinceBootInIntitial value for the Eddystone-TLM time since boot timer. 8 This timer has a 0.1 second resolution.

Definition at line 19 of file TLMFrame.cpp.


Member Function Documentation

void constructTLMFrame ( uint8_t *  rawFrame )

Construct the raw bytes of the Eddystone-TLM frame that will be directly used in the advertising packets.

Parameters:
[in]rawFramePointer to the location where the raw frame will be stored.

Definition at line 45 of file TLMFrame.cpp.

uint16_t getBatteryVoltage ( void   ) const

Get the current Battery Voltage.

Returns:
The Battery Voltage.

Definition at line 92 of file TLMFrame.cpp.

uint16_t getBeaconTemperature ( void   ) const

Get the current Beacon Temperature.

Returns:
The Beacon Temperature.

Definition at line 97 of file TLMFrame.cpp.

size_t getRawFrameSize ( void   ) const

Get the size of the Eddystone-TLM frame constructed with the current state of the TLMFrame object.

Returns:
The size in bytes of the Eddystone-TLM frame.

Definition at line 66 of file TLMFrame.cpp.

uint8_t getTLMVersion ( void   ) const

Get the current TLM Version number.

Returns:
The TLM Version number.

Definition at line 102 of file TLMFrame.cpp.

void setTLMData ( uint8_t  tlmVersionIn = 0 )

Set the Eddystone-TLM version number.

Definition at line 33 of file TLMFrame.cpp.

void updateBatteryVoltage ( uint16_t  tlmBatteryVoltageIn )

Update the Battery Voltage.

Parameters:
[in]tlmBatteryVoltageInThe new Battery Voltage value.

Definition at line 77 of file TLMFrame.cpp.

void updateBeaconTemperature ( uint16_t  tlmBeaconTemperatureIn )

Update the Beacon Temperature.

Parameters:
[in]tlmBeaconTemperatureInThe new Beacon Temperature value.

Definition at line 82 of file TLMFrame.cpp.

void updatePduCount ( void   )

Increment the current PDU counter by 1.

Definition at line 87 of file TLMFrame.cpp.

void updateTimeSinceBoot ( uint32_t  nowInMillis )

Update the time since boot.

Parameters:
[in]nowInMillisThe time since boot in milliseconds.

Definition at line 71 of file TLMFrame.cpp.