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
Application Logic

The application level logic above the BLE GATT and GAP. More...

Functions

void CGM_Init (uint8 task_id)
 Initialization function for the CGM App Task. More...
 
uint16 CGM_ProcessEvent (uint8 task_id, uint16 events)
 CGM Application Task event processor. This function is called to process all events for the task. Events include timers, messages and any other user defined events. More...
 
static void cgm_ProcessOSALMsg (osal_event_hdr_t *pMsg)
 Process an incoming task message. More...
 
static void cgm_HandleKeys (uint8 shift, uint8 keys)
 Handles all key events for this device. More...
 
static uint8 cgmVerifyTime (UTCTimeStruct *pTime)
 Verify time values are suitable for filtering. More...
 
static uint8 cgmVerifyTimeZone (int8 input)
 Verify time zone values are compliant to the standard. More...
 
static uint8 cgmVerifyDSTOffset (uint8 input)
 Verify the daylight saving time input is compliant to the standard. More...
 
static void cgmSimulationAppInit ()
 Initialize the CGM simulator application. Reset the historical database. More...
 

Detailed Description

The application level logic above the BLE GATT and GAP.

Function Documentation

static void cgm_HandleKeys ( uint8  shift,
uint8  keys 
)
static

Handles all key events for this device.

Parameters
shift- true if in shift/alt.
keys- bit field for key events. Valid entries: HAL_KEY_SW_2 HAL_KEY_SW_1
Returns
none

Here is the caller graph for this function:

void CGM_Init ( uint8  task_id)

Initialization function for the CGM App Task.

The routine to iniialize the CGM simulator.

This is called during initialization and should contain any application specific initialization (ie. hardware initialization/setup, table initialization, power up notificaiton ... ).

Parameters
[in]task_idthe ID assigned by OSAL. This ID should be used to send messages and set timers.
Returns
none

Here is the call graph for this function:

Here is the caller graph for this function:

uint16 CGM_ProcessEvent ( uint8  task_id,
uint16  events 
)

CGM Application Task event processor. This function is called to process all events for the task. Events include timers, messages and any other user defined events.

The routine to enable CGM application to process the system event.

This function is registered into the OS task scheduler. It will be run periodically. If System message arrives, it will be fed into this function for processing.

Parameters
[in]task_id- The OSAL assigned task ID.
[in]events- events to process. This is a bit map and can contain more than one event.
Returns
events not processed

Here is the call graph for this function:

static void cgm_ProcessOSALMsg ( osal_event_hdr_t *  pMsg)
static

Process an incoming task message.

Parameters
pMsg- message to process
Returns
none

Here is the call graph for this function:

Here is the caller graph for this function:

static void cgmSimulationAppInit ( )
static

Initialize the CGM simulator application. Reset the historical database.

Returns
none

Here is the call graph for this function:

Here is the caller graph for this function:

static uint8 cgmVerifyDSTOffset ( uint8  input)
static

Verify the daylight saving time input is compliant to the standard.

Parameters
input- the dayligt saving code to be tested
Returns
true if time is ok, false otherwise

Here is the caller graph for this function:

static uint8 cgmVerifyTime ( UTCTimeStruct *  pTime)
static

Verify time values are suitable for filtering.

Parameters
pTime- UTC time struct
Returns
true if time is ok, false otherwise
static uint8 cgmVerifyTimeZone ( int8  input)
static

Verify time zone values are compliant to the standard.

Parameters
input- the time zone code to be tested
Returns
true if time is ok, false otherwise

Here is the caller graph for this function: