Cordio Stack and Cordio Profiles  r2p3-02rel0

Data Structures

struct  basCfg_t
 Battery service configurable parameters. More...
 

Functions

void BasInit (wsfHandlerId_t handlerId, basCfg_t *pCfg)
 Initialize the battery service server. More...
 
void BasMeasBattStart (dmConnId_t connId, uint8_t timerEvt, uint8_t battCccIdx)
 Start periodic battery level measurement. This function starts a timer to perform periodic battery measurements. More...
 
void BasMeasBattStop (dmConnId_t connId)
 Stop periodic battery level measurement. More...
 
void BasProcMsg (wsfMsgHdr_t *pMsg)
 Process received WSF message. More...
 
void BasSendBattLevel (dmConnId_t connId, uint8_t idx, uint8_t level)
 Send the battery level to the peer device. More...
 
uint8_t BasReadCback (dmConnId_t connId, uint16_t handle, uint8_t operation, uint16_t offset, attsAttr_t *pAttr)
 ATTS read callback for battery service used to read the battery level. Use this function as a parameter to SvcBattCbackRegister(). More...
 

Description

Function Documentation

void BasInit ( wsfHandlerId_t  handlerId,
basCfg_t pCfg 
)

Initialize the battery service server.

Parameters
handlerIdWSF handler ID of the application using this service.
pCfgBattery service configurable parameters.
Returns
None.
void BasMeasBattStart ( dmConnId_t  connId,
uint8_t  timerEvt,
uint8_t  battCccIdx 
)

Start periodic battery level measurement. This function starts a timer to perform periodic battery measurements.

Parameters
connIdDM connection identifier.
timerEvtWSF event designated by the application for the timer.
battCccIdxIndex of battery level CCC descriptor in CCC descriptor handle table.
Returns
None.
void BasMeasBattStop ( dmConnId_t  connId)

Stop periodic battery level measurement.

Parameters
connIdDM connection identifier.
Returns
None.
void BasProcMsg ( wsfMsgHdr_t pMsg)

Process received WSF message.

Parameters
pMsgEvent message.
Returns
None.
void BasSendBattLevel ( dmConnId_t  connId,
uint8_t  idx,
uint8_t  level 
)

Send the battery level to the peer device.

Parameters
connIdDM connection identifier.
idxIndex of battery level CCC descriptor in CCC descriptor handle table.
levelThe battery level.
Returns
None.
uint8_t BasReadCback ( dmConnId_t  connId,
uint16_t  handle,
uint8_t  operation,
uint16_t  offset,
attsAttr_t pAttr 
)

ATTS read callback for battery service used to read the battery level. Use this function as a parameter to SvcBattCbackRegister().

Parameters
connIdDM connection identifier.
handleATT handle.
operationATT operation.
offsetread offset.
pAttrpointer to Attribute
Returns
ATT status.