Roy Want / Mbed OS beaconCompileReadyFork
Embed: (wiki syntax)

« Back to documentation index

URLFrame Class Reference

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

#include <URLFrame.h>

Public Member Functions

 URLFrame (void)
 Construct a new instance of this class.
void setUnencodedUrlData (uint8_t *rawFrame, int8_t advTxPower, const char *rawUrl)
 Construct the raw bytes of the Eddystone-URL frame from an unencoded URL (a null terminated string) that will be directly used in the advertising packets.
void clearFrame (uint8_t *frame)
 Clear frame (intervally indicated by length = 0 )
void setData (uint8_t *rawFrame, int8_t advPowerLevel, const uint8_t *encodedUrlData, uint8_t encodedUrlLen)
 Construct the raw bytes of the Eddystone-URL frame from an encoded URL plus length information.
uint8_t * getData (uint8_t *rawFrame)
 Get the URL frame data from the Eddystone-URL frame.
uint8_t getDataLength (uint8_t *rawFrame)
 Get the length of the URL frame data from the Eddystone-UID frame.
uint8_t * getAdvFrame (uint8_t *rawFrame)
 Get the URL Adv data from the Eddystone-URLframe.
uint8_t getAdvFrameLength (uint8_t *rawFrame)
 Get the length of the URLAdv data from the Eddystone-URL frame.
uint8_t * getEncodedUrl (uint8_t *rawFrame)
 Get just the encoded URL data from the Eddystone-URL frame.
uint8_t getEncodedUrlLength (uint8_t *rawFrame)
 Get the length of just the encoded URL data from the Eddystone-URL frame.
void setAdvTxPower (uint8_t *rawFrame, int8_t advTxPower)
 Set the Adv TX Power in the frame.

Static Public Attributes

static const uint8_t FRAME_TYPE_URL = 0x10
 The byte ID of an Eddystone-URL frame.

Detailed Description

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

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

Definition at line 27 of file URLFrame.h.


Constructor & Destructor Documentation

URLFrame ( void   )

Construct a new instance of this class.

Definition at line 20 of file URLFrame.cpp.


Member Function Documentation

void clearFrame ( uint8_t *  frame )

Clear frame (intervally indicated by length = 0 )

Definition at line 32 of file URLFrame.cpp.

uint8_t * getAdvFrame ( uint8_t *  rawFrame )

Get the URL Adv data from the Eddystone-URLframe.

This is the full service data included in the BLE service data params

Parameters:
[in]rawFramePointer to the location where the raw frame will be stored.
Returns:
A pointer to the bytes of the Eddystone-URLAdv frame data.

Definition at line 57 of file URLFrame.cpp.

uint8_t getAdvFrameLength ( uint8_t *  rawFrame )

Get the length of the URLAdv data from the Eddystone-URL frame.

Parameters:
[in]rawFramePointer to the location where the raw frame will be stored.
Returns:
The size in bytes of the Eddystone-URL Adv frame data.

Definition at line 62 of file URLFrame.cpp.

uint8_t * getData ( uint8_t *  rawFrame )

Get the URL frame data from the Eddystone-URL frame.

Parameters:
[in]rawFramePointer to the location where the raw frame will be stored.
Returns:
A pointer to the bytes of the Eddystone-URL frame data.

Definition at line 48 of file URLFrame.cpp.

uint8_t getDataLength ( uint8_t *  rawFrame )

Get the length of the URL frame data from the Eddystone-UID frame.

Parameters:
[in]rawFramePointer to the location where the raw frame will be stored.
Returns:
The size in bytes of the Eddystone-URL frame.

Definition at line 53 of file URLFrame.cpp.

uint8_t * getEncodedUrl ( uint8_t *  rawFrame )

Get just the encoded URL data from the Eddystone-URL frame.

Parameters:
[in]rawFramePointer to the location where the raw frame will be stored.
Returns:
A pointer to the bytes of the encoded URL in the Eddystone-URL frame.

Definition at line 67 of file URLFrame.cpp.

uint8_t getEncodedUrlLength ( uint8_t *  rawFrame )

Get the length of just the encoded URL data from the Eddystone-URL frame.

Parameters:
[in]rawFramePointer to the location where the raw frame will be stored.
Returns:
The size in bytes of the encoded URL in the Eddystone-URL frame.

Definition at line 72 of file URLFrame.cpp.

void setAdvTxPower ( uint8_t *  rawFrame,
int8_t  advTxPower 
)

Set the Adv TX Power in the frame.

This is necessary because the adv Tx Power might be updated independent of the data bytes

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

Definition at line 148 of file URLFrame.cpp.

void setData ( uint8_t *  rawFrame,
int8_t  advPowerLevel,
const uint8_t *  encodedUrlData,
uint8_t  encodedUrlLen 
)

Construct the raw bytes of the Eddystone-URL frame from an encoded URL plus length information.

Parameters:
[in]rawFramePointer to the location where the raw frame will be stored.
[in]advPowerLevelPower level value included in the raw frame.
[in]encodedUrlDataA pointer to the encoded URL bytes.
[in]encodedUrlLenThe length in bytes of the encoded URL

Definition at line 36 of file URLFrame.cpp.

void setUnencodedUrlData ( uint8_t *  rawFrame,
int8_t  advTxPower,
const char *  rawUrl 
)

Construct the raw bytes of the Eddystone-URL frame from an unencoded URL (a null terminated string) that will be directly used in the advertising packets.

Parameters:
[in]rawFramePointer to the location where the raw frame will be stored.
[in]advPowerLevelPower level value included in the raw frame.
[in]rawURLA null terminated string containing the URL

Definition at line 24 of file URLFrame.cpp.


Field Documentation

const uint8_t FRAME_TYPE_URL = 0x10 [static]

The byte ID of an Eddystone-URL frame.

Definition at line 146 of file URLFrame.h.