CGM Simulator  0.1.3
A CGM simulator to demonstrate the BLE CGM profile v1.1
 All Data Structures Files Functions Variables Typedefs Macros Groups Pages
Generic Attribute Profile (GATT)

This group contains modules related to generic attribute profile layer. More...

Collaboration diagram for Generic Attribute Profile (GATT):

Modules

 CGM Specific Control Point (CGMCP)
 This group contains modules falling into the CGMCP.
 
 Glucose Measurement Characteristic
 This group contains modules falling into glucose measurement preparation and reporting.
 
 Session Start Time Charateristic
 This group contains modules related to session start time characteristic implementation.
 
 Session Run Time Characteristic
 This group contains modules related to session run time characteristic implementation.
 
 CGM Status Charateristic
 This group contains modules related to CGM status characteristic implementation.
 
 CGM Feature Characteristic
 This group contains modules related to CGM feature characteristic implementation.
 
 Record Access Control Point (RACP)
 The macros, constants, variables, functions that are related to the RACP.
 

Functions

static void cgmservice_cb (uint8 event, uint8 *valueP, uint8 *len, uint8 *result)
 The callback function in the application layer when the GATT service layer receives read/write operation to one of the CGM service characteristic. More...
 
bStatus_t CGM_AddService (uint32 services)
 Initializes the CGM service by registering GATT attributes with the GATT server. More...
 
void CGM_Register (CGMServiceCB_t pfnServiceCB)
 Register a callback function with the CGM Service. More...
 
static uint8 CGM_ReadAttrCB (uint16 connHandle, gattAttribute_t *pAttr, uint8 *pValue, uint8 *pLen, uint16 offset, uint8 maxLen)
 The callback function when an attribute is being read by a collector. More...
 
static bStatus_t CGM_WriteAttrCB (uint16 connHandle, gattAttribute_t *pAttr, uint8 *pValue, uint8 len, uint16 offset)
 The CGM service layer callback function when an attribute is being written to by the collector. More...
 

Variables

static CGMServiceCB_t CGMServiceCB
 The variable to register the CGM service callback function. More...
 
static gattAttribute_t CGMAttrTbl []
 
CONST gattServiceCBs_t CGMCBs
 

Detailed Description

This group contains modules related to generic attribute profile layer.

@}

@{

Function Documentation

bStatus_t CGM_AddService ( uint32  services)

Initializes the CGM service by registering GATT attributes with the GATT server.

Parameters
services- services to add. This is a bit map and can contain more than one service.
Returns
Success or Failure

Here is the caller graph for this function:

static uint8 CGM_ReadAttrCB ( uint16  connHandle,
gattAttribute_t *  pAttr,
uint8 *  pValue,
uint8 *  pLen,
uint16  offset,
uint8  maxLen 
)
static

The callback function when an attribute is being read by a collector.

Parameters
connHandle- connection message was received on
pAttr- pointer to attribute
pValue- pointer to data to be read
pLen- length of data to be read
offset- offset of the first octet to be read
maxLen- maximum length of data to be read
Returns
Success or Failure
void CGM_Register ( CGMServiceCB_t  pfnServiceCB)

Register a callback function with the CGM Service.

Parameters
pfnServiceCB- Callback function.
Returns
None.

Here is the caller graph for this function:

static bStatus_t CGM_WriteAttrCB ( uint16  connHandle,
gattAttribute_t *  pAttr,
uint8 *  pValue,
uint8  len,
uint16  offset 
)
static

The CGM service layer callback function when an attribute is being written to by the collector.

Parameters
connHandle- connection message was received on
pAttr- pointer to attribute
pValue- pointer to data to be written
len- length of data
offset- offset of the first octet to be written
Returns
Success or Failure
static void cgmservice_cb ( uint8  event,
uint8 *  valueP,
uint8 *  len,
uint8 *  result 
)
static

The callback function in the application layer when the GATT service layer receives read/write operation to one of the CGM service characteristic.

Parameters
event- service event. Enumeration can be found in cgmservice.h
valueP- data value past from the GATT layer to the Application Layer, or vice versa.
result- the address to the memory to pass the processing result back to the GATT layer
len- pointer to the length of the data residing in valueP
Returns
none

Here is the call graph for this function:

Here is the caller graph for this function:

Variable Documentation

gattAttribute_t CGMAttrTbl[]
static

This variable is used to define the attributes of the CGM service

CONST gattServiceCBs_t CGMCBs
Initial value:
=
{
NULL
}
static uint8 CGM_ReadAttrCB(uint16 connHandle, gattAttribute_t *pAttr, uint8 *pValue, uint8 *pLen, uint16 offset, uint8 maxLen)
The callback function when an attribute is being read by a collector.
Definition: cgmservice.c:421
static bStatus_t CGM_WriteAttrCB(uint16 connHandle, gattAttribute_t *pAttr, uint8 *pValue, uint8 len, uint16 offset)
The CGM service layer callback function when an attribute is being written to by the collector...
Definition: cgmservice.c:475

Service Callbacks

CGMServiceCB_t CGMServiceCB
static

The variable to register the CGM service callback function.