EasyManuals Logo
Home>Texas Instruments>Microcontrollers>CC253x

Texas Instruments CC253x Software Developers Guide

Texas Instruments CC253x
162 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 #23 background imageLoading...
Page #23 background image
www.ti.com
Application Initialization
23
SWRU271H–October 2010–Revised April 2019
Submit Documentation Feedback
Copyright © 2010–2019, Texas Instruments Incorporated
The Application and Profiles
4.4 Application Initialization
The initialization of the application occurs in two phases. OSAL calls the SimpleBLEPeripheral_Init()
function. This function sets up the GAP role profile parameters, GAP characteristics, the GAP bond
manager parameters, and simpleGATTprofile parameters. This function also sets an OSAL
SBP_START_DEVICE_EVT event.
The processing in this event triggers the second phase of the initialization, which is in the
SimpleBLEPeripheral_ProcessEvent() function. During this phase, the GAPRole_StartDevice() function is
called to set up the GAP functions. This function sets up the GAP functions of the application.
Connectable undirected advertisements make the device discoverable (for CC2540/41DK-MINI keyfob
builds, the device becomes discoverable when you press the button on the right). A central device can
discover the peripheral device by scanning. If a central device sends a request to connect to the
peripheral device, the peripheral device accepts the request and goes into a connected state as a slave. If
the peripheral device receives no connection request, the device remains discoverable for 30.72 seconds
before going into a standby state.
The project also includes the simpleGATTProfile service. A connected central device operating as a GATT
client can perform characteristic reads and writes on simpleGATTProfile characteristic values. The device
can also enable notifications of one of the characteristics.
4.5 Event Processing
After initialization, the application task processes events in SimpleBLEPeripheral_ProcessEvent when a bit
is set in its events variable. Possible sources of events are described in the following subsections
4.5.1 Periodic Event
The application contains an OSAL event called SBP_PERIODIC_EVT. An OSAL timer sets
SBP_PERIODIC_EVT to occur periodically. After the SBP_START_DEVICE_EVT processing has
completed, the timer is set with a time-out value of PERIODIC_EVT_PERIOD (the default value is 5000
milliseconds). Every 5 seconds the periodic event occurs and the function performPeriodicTask() is called.
The performPeriodicTask() function retrieves the value of the third characteristic in the simpleGATTProfile
and copies that value into the fourth characteristic. This periodic event processing is an example for
demonstration only but highlights how a custom operation can be performed in a periodic task. Before
processing the periodic event, a new OSAL timer is started, which sets up the next periodic task.

Table of Contents

Other manuals for Texas Instruments CC253x

Questions and Answers:

Question and Answer IconNeed help?

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

Texas Instruments CC253x Specifications

General IconGeneral
BrandTexas Instruments
ModelCC253x
CategoryMicrocontrollers
LanguageEnglish

Related product manuals