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
Record Access Control Point (RACP)

The macros, constants, variables, functions that are related to the RACP. More...

Collaboration diagram for Record Access Control Point (RACP):

Data Structures

struct  cgmRACPMsg_t
 The container for receiving RACP data message from the CGM service layer. More...
 

Functions

static uint8 cgmSearchMeasDB (uint8 filter, uint16 operand1, uint16 operand2)
 This function implements the search function for the gluocose measurement. More...
 
static void cgmAddRecord (cgmMeasC_t *cgmCurrentMeas)
 Add record to the database. More...
 
static void cgmProcessRACPMsg (cgmRACPMsg_t *pMsg)
 Record Access Control Point messages processing. More...
 
static void cgmResetMeasDB ()
 Reset the cgm measurement history database. More...
 
static uint8 cgmRACPClearRecord (uint8 startindx, uint8 endindx, uint16 count)
 The function to delete a block of entries from the measurement database. More...
 
bStatus_t CGM_RACPIndicate (uint16 connHandle, attHandleValueInd_t *pInd, uint8 taskId)
 Send an indication to the RACP characteristic. More...
 
bool CGM_SetSendState (bool input)
 Set the state of the CGM database transmission indicator. More...
 

Variables

static attHandleValueInd_t cgmRACPRsp
 
static attHandleValueNoti_t cgmRACPRspNoti
 
static cgmMeasC_tcgmMeasDB
 Pointer to the glucose measurement history database. More...
 
static uint8 cgmMeasDBWriteIndx
 Hold the array index of the next place to write record. More...
 
static uint8 cgmMeasDBCount
 The number of records being stored into the database. More...
 
static uint8 cgmMeasDBOldestIndx
 The index pointing to the oldest record in the database. More...
 
static uint8 cgmMeasDBSearchStart
 The starting index records meeting the search criterion. More...
 
static uint8 cgmMeasDBSearchEnd
 The ending index of records meeting the search criterion. More...
 
static uint16 cgmMeasDBSearchNum
 The resulting record number that matches the criterion. More...
 
static uint8 cgmMeasDBSendIndx
 
static bool cgmMeasDBSendInProgress
 An variable to indicate whether the RACP transmission is in progress. More...
 

Detailed Description

The macros, constants, variables, functions that are related to the RACP.

Function Documentation

bStatus_t CGM_RACPIndicate ( uint16  connHandle,
attHandleValueInd_t *  pInd,
uint8  taskId 
)

Send an indication to the RACP characteristic.

Parameters
connHandle- connection handle
pInd- pointer to indication structure
taskId- the task id of the CGM application
Returns
Success or Failure

Here is the caller graph for this function:

bool CGM_SetSendState ( bool  input)

Set the state of the CGM database transmission indicator.

Parameters
input-
Returns
none

Here is the caller graph for this function:

static void cgmAddRecord ( cgmMeasC_t cgmCurrentMeas)
static

Add record to the database.

Parameters
cgmCurrentMeas- the add of the current measurement to be added to the database.

Here is the caller graph for this function:

static void cgmProcessRACPMsg ( cgmRACPMsg_t pMsg)
static

Record Access Control Point messages processing.

Parameters
pMsg- The input RACP message data structure
Returns
none

Here is the call graph for this function:

Here is the caller graph for this function:

static uint8 cgmRACPClearRecord ( uint8  startindx,
uint8  endindx,
uint16  count 
)
static

The function to delete a block of entries from the measurement database.

Parameters
[in]startindx- the starting index of the record entry block
[in]endindx- the ending index of the record entry block
[in]count- the total number of record in the entry block.
Returns
The code corresponds to the RACP response code.

Here is the call graph for this function:

Here is the caller graph for this function:

static void cgmResetMeasDB ( )
static

Reset the cgm measurement history database.

Returns
none

Here is the caller graph for this function:

static uint8 cgmSearchMeasDB ( uint8  filter,
uint16  operand1,
uint16  operand2 
)
static

This function implements the search function for the gluocose measurement.

It assumes the measurement database consists of continous records arranged in ascending order. The current version is based on the sequential search for demo purpose. Therefore, we assume records are arranged in ascending order based on offset time.

Parameters
filter- the filter type in searching
operand1- the primary operand to the search operation.
operand2- the scrondary operand to the search operation, it is currently used only in searching for a range of record.
Returns
the result code

Here is the caller graph for this function:

Variable Documentation

cgmMeasC_t* cgmMeasDB
static

Pointer to the glucose measurement history database.

uint8 cgmMeasDBCount
static

The number of records being stored into the database.

uint8 cgmMeasDBOldestIndx
static

The index pointing to the oldest record in the database.

uint8 cgmMeasDBSearchEnd
static

The ending index of records meeting the search criterion.

uint16 cgmMeasDBSearchNum
static

The resulting record number that matches the criterion.

uint8 cgmMeasDBSearchStart
static

The starting index records meeting the search criterion.

uint8 cgmMeasDBSendIndx
static

The index of the next record to be sent. It is used in RACP reporting record function.

bool cgmMeasDBSendInProgress
static

An variable to indicate whether the RACP transmission is in progress.

uint8 cgmMeasDBWriteIndx
static

Hold the array index of the next place to write record.

attHandleValueInd_t cgmRACPRsp
static

Container for holding the RACP response indication message, which would be passed down to the GATT service layer

attHandleValueNoti_t cgmRACPRspNoti
static

Container for holding the RACP notification message, which would be passed down to the GATT service layer. The notification will appear as the CGM measurement notification.