Cordio Stack and Cordio Profiles  r2p3-02rel0

Data Structures

struct  glpcFilter_t
 Glucose service RACP filter type. More...
 
struct  glpsGlm_t
 Glucose measurement structure. More...
 
struct  glpsGlmc_t
 Glucose measurement context structure. More...
 
struct  glpsRec_t
 Glucose measurement record. More...
 

Macros

#define GLP_ALL_SUPPORTED_FEATURES   0x000F
 All supported features of the glucose profile.
 
#define GLPS_RACP_MIN_WRITE_LEN   2
 Minimum RACP write length.
 
#define GLPS_RACP_RSP_LEN   4
 RACP response length.
 
#define GLPS_RACP_NUM_REC_RSP_LEN   4
 Glucose RACP number of stored records response length.
 
#define GLPS_OPERAND_MAX   ((CH_RACP_GLS_FILTER_TIME_LEN * 2) + 1)
 RACP operand maximum length.
 

Enumerations

enum  {
  GLPC_GLS_GLM_HDL_IDX,
  GLPC_GLS_GLM_CCC_HDL_IDX,
  GLPC_GLS_GLMC_HDL_IDX,
  GLPC_GLS_GLMC_CCC_HDL_IDX,
  GLPC_GLS_GLF_HDL_IDX,
  GLPC_GLS_RACP_HDL_IDX,
  GLPC_GLS_RACP_CCC_HDL_IDX,
  GLPC_GLS_HDL_LIST_LEN
}
 Glucose service enumeration of handle indexes of characteristics to be discovered. More...
 

Functions

void GlpcGlsDiscover (dmConnId_t connId, uint16_t *pHdlList)
 Perform service and characteristic discovery for Glucose service. Parameter pHdlList must point to an array of length GLPC_GLS_HDL_LIST_LEN. If discovery is successful the handles of discovered characteristics and descriptors will be set in pHdlList. More...
 
uint8_t GlpcGlsValueUpdate (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 GLPC_GLS_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 GlpcGlsRacpSend (dmConnId_t connId, uint16_t handle, uint8_t opcode, uint8_t oper, glpcFilter_t *pFilter)
 Send a command to the glucose service record access control point. More...
 
void GlpcGlsSetLastSeqNum (uint16_t seqNum)
 Set the last received glucose measurement sequence number. More...
 
uint16_t GlpcGlsGetLastSeqNum (void)
 Get the last received glucose measurement sequence number. More...
 
void GlpsInit (void)
 Initialize the Glucose profile sensor. More...
 
void GlpsProcMsg (wsfMsgHdr_t *pMsg)
 This function is called by the application when a message that requires processing by the glucose profile sensor is received. More...
 
void GlpsBtn (dmConnId_t connId, uint8_t btn)
 Handle a button press. More...
 
uint8_t GlpsRacpWriteCback (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 glucose service record access control point. Use this function as a parameter to SvcGlsCbackRegister(). More...
 
void GlpsSetFeature (uint16_t feature)
 Set the supported features of the glucose sensor. More...
 
void GlpsSetCccIdx (uint8_t glmCccIdx, uint8_t glmcCccIdx, uint8_t racpCccIdx)
 Set the CCCD index used by the application for glucose service characteristics. More...
 
void glpsDbInit (void)
 Initialize the glucose record database. More...
 
uint8_t glpsDbGetNextRecord (uint8_t oper, uint8_t *pFilter, glpsRec_t *pCurrRec, glpsRec_t **pRec)
 Get the next record that matches the given filter parameters that follows the given current record. More...
 
uint8_t glpsDbDeleteRecords (uint8_t oper, uint8_t *pFilter)
 Delete records that match the given filter parameters. More...
 
uint8_t glpsDbGetNumRecords (uint8_t oper, uint8_t *pFilter, uint8_t *pNumRec)
 Get the number of records matching the filter parameters. More...
 
void glpsDbGenerateRecord (void)
 Generate a new record. More...
 
void glpsDbToggleMedicationUnits (void)
 For conformance testing only. Toggle the sample data record number 2's medication quantity unit flag between Kilograms and Liters. Also modifies quantity. More...
 

Description

Enumeration Type Documentation

anonymous enum

Glucose service enumeration of handle indexes of characteristics to be discovered.

Enumerator
GLPC_GLS_GLM_HDL_IDX 

Glucose measurement.

GLPC_GLS_GLM_CCC_HDL_IDX 

Glucose measurement CCC descriptor.

GLPC_GLS_GLMC_HDL_IDX 

Glucose measurement context.

GLPC_GLS_GLMC_CCC_HDL_IDX 

Glucose measurement context CCC descriptor.

GLPC_GLS_GLF_HDL_IDX 

Glucose feature.

GLPC_GLS_RACP_HDL_IDX 

Record access control point.

GLPC_GLS_RACP_CCC_HDL_IDX 

Record access control point CCC descriptor.

GLPC_GLS_HDL_LIST_LEN 

Handle list length.

Definition at line 36 of file glpc_api.h.

37 {
38  GLPC_GLS_GLM_HDL_IDX, /*!< \brief Glucose measurement */
39  GLPC_GLS_GLM_CCC_HDL_IDX, /*!< \brief Glucose measurement CCC descriptor */
40  GLPC_GLS_GLMC_HDL_IDX, /*!< \brief Glucose measurement context */
41  GLPC_GLS_GLMC_CCC_HDL_IDX, /*!< \brief Glucose measurement context CCC descriptor */
42  GLPC_GLS_GLF_HDL_IDX, /*!< \brief Glucose feature */
43  GLPC_GLS_RACP_HDL_IDX, /*!< \brief Record access control point */
44  GLPC_GLS_RACP_CCC_HDL_IDX, /*!< \brief Record access control point CCC descriptor */
45  GLPC_GLS_HDL_LIST_LEN /*!< \brief Handle list length */
46 };
Handle list length.
Definition: glpc_api.h:45
Glucose measurement context.
Definition: glpc_api.h:40
Record access control point.
Definition: glpc_api.h:43
Glucose measurement context CCC descriptor.
Definition: glpc_api.h:41
Record access control point CCC descriptor.
Definition: glpc_api.h:44
Glucose measurement CCC descriptor.
Definition: glpc_api.h:39
Glucose measurement.
Definition: glpc_api.h:38
Glucose feature.
Definition: glpc_api.h:42

Function Documentation

void GlpcGlsDiscover ( dmConnId_t  connId,
uint16_t pHdlList 
)

Perform service and characteristic discovery for Glucose service. Parameter pHdlList must point to an array of length GLPC_GLS_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.
uint8_t GlpcGlsValueUpdate ( 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 GLPC_GLS_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
pHdlListCharacteristic handle list.
pMsgATT callback message.
Returns
ATT_SUCCESS if handle is found, ATT_ERR_NOT_FOUND otherwise.
void GlpcGlsRacpSend ( dmConnId_t  connId,
uint16_t  handle,
uint8_t  opcode,
uint8_t  oper,
glpcFilter_t pFilter 
)

Send a command to the glucose service record access control point.

Parameters
connIdConnection identifier.
handleAttribute handle.
opcodeCommand opcode.
operCommand operator or 0 if no operator required.
pFilterCommand filter parameters or NULL of no parameters required.
Returns
None.
void GlpcGlsSetLastSeqNum ( uint16_t  seqNum)

Set the last received glucose measurement sequence number.

Parameters
seqNumGlucose measurement sequence number.
Returns
None.
uint16_t GlpcGlsGetLastSeqNum ( void  )

Get the last received glucose measurement sequence number.

Returns
Last received glucose measurement sequence number.
void GlpsInit ( void  )

Initialize the Glucose profile sensor.

Returns
None.
void GlpsProcMsg ( wsfMsgHdr_t pMsg)

This function is called by the application when a message that requires processing by the glucose profile sensor is received.

Parameters
pMsgEvent message.
Returns
None.
void GlpsBtn ( dmConnId_t  connId,
uint8_t  btn 
)

Handle a button press.

Parameters
connIdConnection identifier.
btnButton press.
Returns
None.
uint8_t GlpsRacpWriteCback ( 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 glucose service record access control point. Use this function as a parameter to SvcGlsCbackRegister().

Parameters
connIdDM connection identifier.
handleATT handle.
operationATT operation.
offsetWrite offset.
lenWrite length.
pValueValue to write.
pAttrAttribute to write.
Returns
ATT status.
void GlpsSetFeature ( uint16_t  feature)

Set the supported features of the glucose sensor.

Parameters
featureFeature bitmask.
Returns
None.
void GlpsSetCccIdx ( uint8_t  glmCccIdx,
uint8_t  glmcCccIdx,
uint8_t  racpCccIdx 
)

Set the CCCD index used by the application for glucose service characteristics.

Parameters
glmCccIdxGlucose measurement CCCD index.
glmcCccIdxGlucose measurement context CCCD index.
racpCccIdxRecord access control point CCCD index.
Returns
None.
void glpsDbInit ( void  )

Initialize the glucose record database.

Returns
None.
uint8_t glpsDbGetNextRecord ( uint8_t  oper,
uint8_t pFilter,
glpsRec_t pCurrRec,
glpsRec_t **  pRec 
)

Get the next record that matches the given filter parameters that follows the given current record.

Parameters
operOperator.
pFilterGlucose service RACP filter parameters.
pCurrRecPointer to current record.
pRecReturn pointer to next record, if found.
Returns
CH_RACP_RSP_SUCCESS if a record is found, otherwise an error status is returned.
uint8_t glpsDbDeleteRecords ( uint8_t  oper,
uint8_t pFilter 
)

Delete records that match the given filter parameters.

Parameters
operOperator.
pFilterGlucose service RACP filter parameters.
Returns
CH_RACP_RSP_SUCCESS if records deleted, otherwise an error status is returned.
uint8_t glpsDbGetNumRecords ( uint8_t  oper,
uint8_t pFilter,
uint8_t pNumRec 
)

Get the number of records matching the filter parameters.

Parameters
operOperator.
pFilterGlucose service RACP filter parameters.
pNumRecReturns number of records which match filter parameters.
Returns
RACP status.
void glpsDbGenerateRecord ( void  )

Generate a new record.

Returns
None.
void glpsDbToggleMedicationUnits ( void  )

For conformance testing only. Toggle the sample data record number 2's medication quantity unit flag between Kilograms and Liters. Also modifies quantity.

Returns
None.