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

Configure discoverability and connectivity of the device. More...

Collaboration diagram for Device Access:

Macros

#define DEFAULT_FAST_ADV_INTERVAL   32
 Fast advertising interval in 625us units. More...
 
#define DEFAULT_FAST_ADV_DURATION   30
 Duration of fast advertising duration in sec. More...
 
#define DEFAULT_SLOW_ADV_INTERVAL   1600
 Slow advertising interval in 625us units. More...
 
#define DEFAULT_SLOW_ADV_DURATION   30
 Duration of slow advertising duration in sec. More...
 
#define DEFAULT_ENABLE_UPDATE_REQUEST   TRUE
 Whether to enable automatic parameter update request when a connection is formed. More...
 
#define DEFAULT_DESIRED_MIN_CONN_INTERVAL   200
 Minimum connection interval (units of 1.25ms) if automatic parameter update request is enabled. More...
 
#define DEFAULT_DESIRED_MAX_CONN_INTERVAL   1600
 Maximum connection interval (units of 1.25ms) if automatic parameter update request is enabled. More...
 
#define DEFAULT_DESIRED_SLAVE_LATENCY   1
 Slave latency to use if automatic parameter update request is enabled. More...
 
#define DEFAULT_DESIRED_CONN_TIMEOUT   1000
 

Functions

static void cgmGapStateCB (gaprole_States_t newState)
 Notification from the profile of a state change. More...
 
static void CGM_HandleConnStatusCB (uint16 connHandle, uint8 changeType)
 Simple Profile link status change handler function. More...
 

Variables

uint16 gapConnHandle
 Local version of the GAP connection handle. More...
 
static gaprole_States_t gapProfileState = GAPROLE_INIT
 
static uint8 scanData []
 GAP Profile - Name attribute for SCAN RSP data. More...
 
static uint8 advertData []
 Define the Advertizing data. More...
 
static uint8 attDeviceName [GAP_DEVICE_NAME_LEN] = "CGM Simulator"
 The device name variable. More...
 
static bool cgmBonded = FALSE
 Local variable storing the current bonding stage of the sensor. More...
 
static uint8 cgmBondedAddr [B_ADDR_LEN]
 Local variable storing the address of the bonded peer. More...
 
static bool cgmAdvCancelled = FALSE
 

Detailed Description

Configure discoverability and connectivity of the device.

Variable for registerint the GAP Role Callbacks.

Macro Definition Documentation

#define DEFAULT_DESIRED_CONN_TIMEOUT   1000

Supervision timeout value (units of 10ms) if automatic parameter update request is enabled

#define DEFAULT_DESIRED_MAX_CONN_INTERVAL   1600

Maximum connection interval (units of 1.25ms) if automatic parameter update request is enabled.

#define DEFAULT_DESIRED_MIN_CONN_INTERVAL   200

Minimum connection interval (units of 1.25ms) if automatic parameter update request is enabled.

#define DEFAULT_DESIRED_SLAVE_LATENCY   1

Slave latency to use if automatic parameter update request is enabled.

#define DEFAULT_ENABLE_UPDATE_REQUEST   TRUE

Whether to enable automatic parameter update request when a connection is formed.

#define DEFAULT_FAST_ADV_DURATION   30

Duration of fast advertising duration in sec.

#define DEFAULT_FAST_ADV_INTERVAL   32

Fast advertising interval in 625us units.

#define DEFAULT_SLOW_ADV_DURATION   30

Duration of slow advertising duration in sec.

#define DEFAULT_SLOW_ADV_INTERVAL   1600

Slow advertising interval in 625us units.

Function Documentation

static void CGM_HandleConnStatusCB ( uint16  connHandle,
uint8  changeType 
)
static

Simple Profile link status change handler function.

Parameters
connHandle- connection handle
changeType- type of change
Returns
none
static void cgmGapStateCB ( gaprole_States_t  newState)
static

Notification from the profile of a state change.

Parameters
newState- new state
Returns
none

Variable Documentation

uint8 advertData[]
static
Initial value:
=
{
0x02,
GAP_ADTYPE_FLAGS,
GAP_ADTYPE_FLAGS_LIMITED | GAP_ADTYPE_FLAGS_BREDR_NOT_SUPPORTED,
0x05,
GAP_ADTYPE_16BIT_MORE,
LO_UINT16(CGM_SERV_UUID),
HI_UINT16(CGM_SERV_UUID),
LO_UINT16(DEVINFO_SERV_UUID),
}
#define CGM_SERV_UUID
GM service.
Definition: cgmservice.h:79

Define the Advertizing data.

uint8 attDeviceName[GAP_DEVICE_NAME_LEN] = "CGM Simulator"
static

The device name variable.

bool cgmAdvCancelled = FALSE
static

Denote the advertising state.

bool cgmBonded = FALSE
static

Local variable storing the current bonding stage of the sensor.

uint8 cgmBondedAddr[B_ADDR_LEN]
static

Local variable storing the address of the bonded peer.

static uint16 gapConnHandle

Local version of the GAP connection handle.

The handle for the current GAP connection.

gaprole_States_t gapProfileState = GAPROLE_INIT
static

The connection state of the GAP layer

uint8 scanData[]
static
Initial value:
=
{
0x08,
0x09,
'C', 'G', 'M', ' ', 'S', 'i', 'm'
}

GAP Profile - Name attribute for SCAN RSP data.