EasyManuals Logo
Home>Texas Instruments>Microcontrollers>CC2541

Texas Instruments CC2541 Application Guide

Texas Instruments CC2541
36 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Page #10 background imageLoading...
Page #10 background image
TI CC2540 Bluetooth low energy Sample Applications Guide v1.4.1 SWRU297 Version 1.4.1
Page 10 of 36
Copyright © 2011-2015 Texas Instruments, Inc
called to set up the GAP functions of the application. Then GAPBondMgr_Register is called to
register with the bond manager.
3.2.2 Event Processing
The application has two main event processing functions, Thermometer_ProcessEvent and
Thermometer_ProcessOSALMsg.
Function Thermometer_ProcessEvent handles events as follows:
SYS_EVENT_MSG: Service the OSAL queue and process OSAL messages.
START_DEVICE_EVT: Start the device, as described in the previous section.
TH_START_DISCOVERY_EVT: Start discovery, search for time service on collector.
TH_PERIODIC_MEAS_EVT: Start a measurement.
TH_PERIODIC_IMEAS_EVT: Send immediate measurement.
TH_DISCONNECT_EVT: Terminate connection.
Function Thermometer_ProcessOSALMsg handles OSAL messages as follows:
KEY_CHANGE: Handle key presses.
GATT_MSG_EVENT: This will handle reception of time information from collector.
3.2.3 Callbacks
The application callback functions are as follows:
PeripheralStateNotificationCB: This is the GAP event callback. It processes GAP
events for startup and link connect/disconnect.
ThermometerCB: This is the thermometer service callback. It handles enabling or
disabling measurements.
TimeAppPairStateCB: This is a GAPBOND callback to handle pairing states.
TimeAppPasscodeCB: Returns the passcode of 0.
3.2.4 Sending Temperature Indications
The application enables indication of the thermometer measurement when configured to do so by
the peer device.
When the peer device configures the thermometer measurement for indication the application will
receive a thermometer service callback. The application starts a timer to begin periodic simulated
thermometer measurements. When the timer expires the application calls
thermometerMeasIndicate to build and store a measurement. Once a measurement is ready,
the thermometer will enter connectable state and send advertisements. If the peer device
connects and the CCC is enabled, the thermometer will send the stored measurements. The
thermometer expects the peer device to send back an indication confirmation for each indication
sent.
3.2.5 Sending Intermediate Measurement Notifications
The application sends notification of the thermometer measurement when configured to do so by
the peer device.
When the peer device configures the thermometer measurement for notification the application
will receive a thermometer service callback. The application starts a timer to begin periodic
simulated thermometer measurements. When the timer expires the application calls
thermometerIMeasIndicate to build and send a measurement using the thermometer service
API.
3.2.6 Sending Interval Change Indications
If the CCC for interval change is enabled, the thermometer will send an indication to the peer if
the interval is changed by the thermometer. This can be triggered by pressing the right button
three times which will increase the simulated temperature by 3 degrees and also reset the interval
to 30 seconds.

Table of Contents

Other manuals for Texas Instruments CC2541

Questions and Answers:

Question and Answer IconNeed help?

Do you have a question about the Texas Instruments CC2541 and is the answer not in the manual?

Texas Instruments CC2541 Specifications

General IconGeneral
BrandTexas Instruments
ModelCC2541
CategoryMicrocontrollers
LanguageEnglish

Related product manuals