TI CC2540 Bluetooth low energy Sample Applications Guide v1.4.1 SWRU297 Version 1.4.1
Page 20 of 36
Copyright © 2011-2015 Texas Instruments, Inc
GlucCollPairStateCB: This is the GAP bond manager state callback. It displays the
status of pairing and bonding operations.
GlucCollPasscodeCB: This is the GAP bond manager passcode callback. It generates
and displays a passcode.
7.2.4 Service Discovery
The GlucColl application performs service discovery for the Glucose service and Device
Information service. Discovery is initiated when a connection is established by setting OSAL
event START_DISCOVERY_EVT. This will result in execution of function
GlucCollCentralStartDiscovery, which performs primary service discovery for the Glucose
service and Device ID service. When GATT events are received during service discovery
function glucCollProcessGATTMsg is called. This function processes the results of the previous
GATT procedure and initiates the next step in the discovery process.
7.2.5 Service Configuration
When service discovery completes the service configuration procedure is initiated. This
procedure reads and writes characteristics of interest in the discovered services.
The main service configuration function is glucoseConfigNext. This function searches the
cached handle array for the next characteristic of interest and performs a read or write on that
characteristic.
When a GATT read or write response is received, function glucoseConfigGattMsg is called.
This function processes the received response and performs an action, such as updating the
clock display, and then calls glucoseConfigNext to initiate the next read or write.
The application writes all discovered client characteristic configuration descriptors to enable
notification or indication. The application also reads some characteristics and then performs no
action with the received response. This is done simply for testing and demonstration.
7.2.6 Record Access Control Point
The Glucose profile uses a characteristic called the record access control point to perform
operations on glucose measurement records stored by the glucose sensor. File glucose_ctlpnt.c
contains functions for sending control point messages. The following different operations can be
performed:
Retrieve stored records.
Delete stored records.
Abort an operation in progress.
Report number of stored records.
The collector sends control point messages to a sensor by using write requests, while the sensor
sends control point messages to the collector by using indications. When records are retrieved,
the glucose measurement and glucose context are sent via notifications on their respective
characteristics.
If an expected response is not received, the operation will time out after 30 seconds and the
collector will close the connection.
8 Glucose Sensor
This sample project implements the Glucose profile in a BLE peripheral device to provide an
example glucose sensor using simulated measurement data. The application implements the
"Sensor" role of the Glucose Profile.
8.1 Project Overview
The project structure is very similar to that of the SimpleBLEPeripheral project. The APP
directory contains the application source code and header files. The project contains one
configuration, CC2540DK-MINI Keyfob Slave, using the keyfob hardware platform.
8.1.1 User Interface