Cordio Stack and Cordio Profiles  r2p3-02rel0

Data Structures

struct  hrpsCfg_t
 Configurable parameters. More...
 

Enumerations

enum  {
  HRPC_HRS_HRM_HDL_IDX,
  HRPC_HRS_HRM_CCC_HDL_IDX,
  HRPC_HRS_BSL_HDL_IDX,
  HRPC_HRS_HRCP_HDL_IDX,
  HRPC_HRS_HDL_LIST_LEN
}
 Heart Rate service enumeration of handle indexes of characteristics to be discovered. More...
 

Functions

void HrpcHrsDiscover (dmConnId_t connId, uint16_t *pHdlList)
 Perform service and characteristic discovery for Heart Rate service. Parameter pHdlList must point to an array of length HRPC_HRS_HDL_LIST_LEN. If discovery is successful the handles of discovered characteristics and descriptors will be set in pHdlList. More...
 
void HrpcHrsControl (dmConnId_t connId, uint16_t handle, uint8_t command)
 Send a command to the heart rate control point. More...
 
uint8_t HrpcHrsValueUpdate (uint16_t *pHdlList, attEvt_t *pMsg)
 Process a value received in an ATT read response, notification, or indication message. Parameter pHdlList must point to an array of length HRPC_HRS_HDL_LIST_LEN. If the ATT handle of the message matches a handle in the handle list the value is processed, otherwise it is ignored. More...
 
void HrpsInit (wsfHandlerId_t handlerId, hrpsCfg_t *pCfg)
 Initialize the Heart Rate profile sensor. More...
 
void HrpsMeasStart (dmConnId_t connId, uint8_t timerEvt, uint8_t hrmCccIdx)
 Start periodic heart rate measurement. This function starts a timer to perform periodic measurements. More...
 
void HrpsMeasStop (dmConnId_t connId)
 Stop periodic heart rate measurement. More...
 
void HrpsProcMsg (wsfMsgHdr_t *pMsg)
 Process received WSF message. More...
 
uint8_t HrpsWriteCback (dmConnId_t connId, uint16_t handle, uint8_t operation, uint16_t offset, uint16_t len, uint8_t *pValue, attsAttr_t *pAttr)
 ATTS write callback for heart rate service Use this function as a parameter to SvcHrsCbackRegister(). More...
 
void HrpsSetFlags (uint8_t flags)
 Set the heart rate measurement flags. More...
 

Description

Enumeration Type Documentation

anonymous enum

Heart Rate service enumeration of handle indexes of characteristics to be discovered.

Enumerator
HRPC_HRS_HRM_HDL_IDX 

Heart rate measurement.

HRPC_HRS_HRM_CCC_HDL_IDX 

Heart rate measurement CCC descriptor.

HRPC_HRS_BSL_HDL_IDX 

Body sensor location.

HRPC_HRS_HRCP_HDL_IDX 

Heart rate control point.

HRPC_HRS_HDL_LIST_LEN 

Handle list length.

Definition at line 36 of file hrpc_api.h.

37 {
38  HRPC_HRS_HRM_HDL_IDX, /*!< \brief Heart rate measurement */
39  HRPC_HRS_HRM_CCC_HDL_IDX, /*!< \brief Heart rate measurement CCC descriptor */
40  HRPC_HRS_BSL_HDL_IDX, /*!< \brief Body sensor location */
41  HRPC_HRS_HRCP_HDL_IDX, /*!< \brief Heart rate control point */
42  HRPC_HRS_HDL_LIST_LEN /*!< \brief Handle list length */
43 };
Handle list length.
Definition: hrpc_api.h:42
Body sensor location.
Definition: hrpc_api.h:40
Heart rate control point.
Definition: hrpc_api.h:41
Heart rate measurement.
Definition: hrpc_api.h:38
Heart rate measurement CCC descriptor.
Definition: hrpc_api.h:39

Function Documentation

void HrpcHrsDiscover ( dmConnId_t  connId,
uint16_t pHdlList 
)

Perform service and characteristic discovery for Heart Rate service. Parameter pHdlList must point to an array of length HRPC_HRS_HDL_LIST_LEN. If discovery is successful the handles of discovered characteristics and descriptors will be set in pHdlList.

Parameters
connIdConnection identifier.
pHdlListCharacteristic handle list.
Returns
None.
void HrpcHrsControl ( dmConnId_t  connId,
uint16_t  handle,
uint8_t  command 
)

Send a command to the heart rate control point.

Parameters
connIdConnection identifier.
handleAttribute handle.
commandControl point command.
Returns
None.
uint8_t HrpcHrsValueUpdate ( uint16_t pHdlList,
attEvt_t pMsg 
)

Process a value received in an ATT read response, notification, or indication message. Parameter pHdlList must point to an array of length HRPC_HRS_HDL_LIST_LEN. If the ATT handle of the message matches a handle in the handle list the value is processed, otherwise it is ignored.

Parameters
pHdlListCharacterist handle list.
pMsgATT callback message.
Returns
ATT_SUCCESS if handle is found, ATT_ERR_NOT_FOUND otherwise.
void HrpsInit ( wsfHandlerId_t  handlerId,
hrpsCfg_t pCfg 
)

Initialize the Heart Rate profile sensor.

Parameters
handlerIdWSF handler ID of the application using this service.
pCfgConfigurable parameters.
Returns
None.
void HrpsMeasStart ( dmConnId_t  connId,
uint8_t  timerEvt,
uint8_t  hrmCccIdx 
)

Start periodic heart rate measurement. This function starts a timer to perform periodic measurements.

Parameters
connIdDM connection identifier.
timerEvtWSF event designated by the application for the timer.
hrmCccIdxIndex of heart rate CCC descriptor in CCC descriptor handle table.
Returns
None.
void HrpsMeasStop ( dmConnId_t  connId)

Stop periodic heart rate measurement.

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

Process received WSF message.

Parameters
pMsgEvent message.
Returns
None.
uint8_t HrpsWriteCback ( dmConnId_t  connId,
uint16_t  handle,
uint8_t  operation,
uint16_t  offset,
uint16_t  len,
uint8_t pValue,
attsAttr_t pAttr 
)

ATTS write callback for heart rate service Use this function as a parameter to SvcHrsCbackRegister().

Parameters
connIdDM connection identifier.
handleATT handle.
operationATT operation.
offsetWrite offset.
lenWrite length.
pValueValue to write.
pAttrAttribute to write.
Returns
ATT status.
void HrpsSetFlags ( uint8_t  flags)

Set the heart rate measurement flags.

Parameters
flagsHeart rate measurement flags.
Returns
None.