Reference Guide: CC2540 and CC2541 Bluetooth Low Energy Software Developer's
Reference Guide: CC2540 and CC2541 Bluetooth Low Energy Software Developer's
Reference Guide: CC2540 and CC2541 Bluetooth Low Energy Software Developer's
Software Developers
Reference Guide
Contents
Preface ........................................................................................................................................ 7
1
Overview ............................................................................................................................. 8
1.1
1.2
4.5
4.6
4.7
16
17
18
18
20
22
23
23
23
24
24
25
26
5.2
5.3
5.4
5.5
5.6
Configurations .............................................................................................................. 11
Projects ...................................................................................................................... 14
Software Overview ......................................................................................................... 14
Introduction ................................................................................................................... 8
BLE Protocol Stack Basics ................................................................................................. 9
Contents
27
27
31
31
32
32
35
37
37
38
40
45
45
47
49
52
63
63
63
63
www.ti.com
5.7
Drivers .............................................................................................................................. 65
6.1
6.2
6.3
6.4
6.5
6.6
6.7
6.8
6.9
7.6
71
71
71
72
77
79
102
104
105
105
106
68
68
68
68
68
68
69
69
69
69
70
70
66
66
66
66
66
66
66
67
67
ADC ..........................................................................................................................
AES ..........................................................................................................................
LCD ..........................................................................................................................
LED...........................................................................................................................
KEY ..........................................................................................................................
DMA ..........................................................................................................................
UART and SPI ..............................................................................................................
Other Peripherals...........................................................................................................
Simple NV (SNV) ...........................................................................................................
Commands ................................................................................................................
Configurable Parameters ................................................................................................
Callbacks...................................................................................................................
C.3.1 RSSI Callback (rssiCB) .........................................................................................
C.3.2 Central Event Callback (eventCB) .............................................................................
107
111
111
111
112
Contents
www.ti.com
D.1
D.2
D.3
D.4
D.5
D.6
113
114
120
121
123
123
................................................................................................................ 125
F
GAPBondMgr API ............................................................................................................. 127
F.1
Commands ................................................................................................................ 127
F.2
Configurable Parameters ................................................................................................ 130
F.3
Callbacks................................................................................................................... 131
F.3.1 Passcode Callback (passcodeCB) ............................................................................ 131
F.3.2 Pairing State Callback (pairStateCB) ......................................................................... 131
G
HCI Extension API ............................................................................................................ 133
G.1
Commands ................................................................................................................ 133
G.2
Host Error Codes ......................................................................................................... 151
Revision History ........................................................................................................................ 153
E.1
Commands
Contents
www.ti.com
List of Figures
.......................................................
1-1.
1-2.
2-1.
2-2.
3-1.
4-1.
4-2.
5-1.
5-2.
5-3.
5-4.
5-5.
5-6.
5-7.
5-8.
5-9.
5-10.
5-11.
5-12.
5-13.
6-1.
8-1.
8-2.
8-3.
8-4.
8-5.
8-6.
8-7.
8-8.
8-9.
8-10.
8-11.
.......................................................................
GAP State Diagram ........................................................................................................
Connection Event and Interval ...........................................................................................
Slave Latency ...............................................................................................................
GAP Abstraction ............................................................................................................
Just Works Pairing .........................................................................................................
Bonding After Just Works Pairing ........................................................................................
Pairing With MITM Authentication........................................................................................
GATT Client and Server ...................................................................................................
simpleGATTProfile Characteristic Table from BTool ..................................................................
GATT Client Abstraction...................................................................................................
GATT Server Abstraction..................................................................................................
Attribute Table Initialization ...............................................................................................
Get and Set Profile Parameter Usage ...................................................................................
HAL Drivers .................................................................................................................
IAR Embedded Workbench ...............................................................................................
Project Configurations and Options ......................................................................................
Project Configurations .....................................................................................................
Preprocessor Defined Symbols Settings ................................................................................
The buildConfig.h File .....................................................................................................
Configuration File Setup ...................................................................................................
Building a Project ...........................................................................................................
Debug Button in IAR .......................................................................................................
Target Selection ............................................................................................................
IAR Debug Toolbar.........................................................................................................
Map File in File List ........................................................................................................
List of Figures
25
27
28
29
31
40
42
43
45
47
49
52
53
62
65
72
73
73
74
75
75
77
78
78
79
79
www.ti.com
List of Tables
....................................................................................
5-1.
5-2.
G-1.
List of Tables
37
Preface
SWRU271G October 2010 Revised September 2015
References
The following references are included with the TI Bluetooth low energy v1.4.1 stack release.
NOTE: Path and file references in this document assume you have installed the BLE development
kit software to the path: C:\Texas Instruments\BLE-CC254X-1.4.1\. This path is referred to as
$INSTALL$.
References
Chapter 1
SWRU271G October 2010 Revised September 2015
Overview
The purpose of this document is to give an overview of the TI CC2540 and CC2541 Bluetooth low energy
(BLE) software development kit. This document also introduces the BLE standard but should not be used
as a substitute for the complete specification. For more details, see the Specification of the Bluetooth
System, Covered Core Package Version: 4.0 (30-June-2010).
IAR Overview has the release history of the BLE software development kit, including detailed information
on changes, enhancements, bug fixes, and issues.
NOTE: The TI BLE Stack v1.4.1 supports Bluetooth 4.0. For Bluetooth 4.1 support, see the TI
BLE Stack for the SimpleLink Bluetooth low energy CC2640 Wireless MCU.
1.1
Introduction
Version 4.0 of the Bluetooth standard supports the following two systems of wireless technology:
Basic Rate (BR, often referred to as BR/EDR for Basic Rate/Enhanced Data Rate)
Bluetooth low energy (BLE)
The BLE protocol was created to transmit very small packets of data at a time, while consuming
significantly less power than BR/EDR devices.
Devices that can support BR and BLE are referred to as dual-mode devices and should be branded as
Bluetooth Smart Ready. Typically in a Bluetooth system, a mobile phone or laptop computer will be a dualmode device. Devices that only support BLE are referred to as single-mode devices and should be
branded as Bluetooth Smart. These single-mode devices are used for application in which low power
consumption is a primary concern, such as those that run on coin-cell batteries. Figure 1-1 shows the
Bluetooth Smart and Bluetooth Smart Ready branding marks.
Figure 1-1. Bluetooth Smart and Bluetooth Smart Ready Branding Marks
Overview
www.ti.com
1.2
Overview
www.ti.com
Advertisers transmit data without forming a BLE connection, while scanners receive the data broadcasted
by advertisers. An initiator is a device that responds to an advertiser by requesting to connect. If the
advertiser accepts, both the advertiser and initiator connect. When a device is in a connected state, it is
either a master or slave. The device that initiated the connection becomes the master and the device that
accepted the request becomes the slave. This layer is implemented in the library code in the TI 1.4.1 BLE
stack, .
The host control interface (HCI) layer provides a means of communication between the host and controller
through a standardized interface. This layer can be implemented either through a software API, or by a
hardware interface such as UART, SPI, or USB. Device Information Service (Bluetooth Specification),
Version 1.0 (24-May-2011) specifies the standard HCI commands and events. The TI BLE Vendor
Specific HCI Reference Guide specifies the TI proprietary commands and events.
The link logical control and adaption protocol (L2CAP) layer provides data encapsulation services to the
upper layers, allowing for logical, end-to-end communication of data. For more information on TI's
implementation of the L2CAP layer, see Section 5.5.
The security manager (SM) layer defines the methods for pairing and key distribution, and provides
functions for the other layers of the protocol stack to securely connect with and exchange data with
another device. For more information on TI's implementation of the SM layer, see Section 5.3.
The GAP layer directly interfaces with the application and/or profiles to handle device discovery and
connection-related services for the device. GAP also handles the initiation of security features. For more
information on the GAP layer, see Section 5.1.
The attribute protocol (ATT) layer protocol lets a device expose certain pieces of data (attributes) to
another device.
The GATT layer is a service framework that defines the subprocedures for using ATT. GATT
subprocedures handle data communications between two devices in a BLE connection. The application
and/or profiles use GATT directly. For more information on the ATT and GATT layers, see Section 5.4.
10
Overview
Chapter 2
SWRU271G October 2010 Revised September 2015
2.1
Configurations
The platform supports two different stack and application configurations:
Single-Device: The controller, host, profiles, and application are implemented on the CC2540/41 as a
true single-chip solution. This configuration is the simplest and most common when using the
CC2540/41 devices. TI uses this configuration in most sample projects. The configuration is the most
cost effective and provides the lowest-power performance. The SimpleBLEPeripheral and
SimpleBLECentral projects are examples of applications built using the single-device configuration. For
more information on these projects, see Chapter 3.
11
Configurations
www.ti.com
12
Configurations
www.ti.com
Network Processor: The controller and host layers are implemented together on the CC2540/41, while
the profiles and the application are implemented separately on an external host processor. The
application and profiles communicate with the CC2540/41 through vendor-specific HCI commands
using an SPI, a UART interface, or a virtual UART interface over USB. This configuration is optimal for
applications that execute on another device such as an external microcontroller or a PC. When using
this type of application, you can develop it externally while running the BLE stack on the CC2540/41.
To use the network processor, you must use the HostTestRelease project.
13
Projects
2.2
www.ti.com
Projects
The SimpleBLEPeripheral project consists of sample code that demonstrates a simple application in the
single-device configuration. You can use this project as a reference for developing a slave/peripheral
application.
The SimpleBLECentral project is similar because it demonstrates a simple master/central application in
the single-device configuration, and can be a reference for developing master/central applications.
The HostTestRelease project is used to build the BLE network processor software for the CC2540/41.
This project contains configurations for both master and slave roles.
The BLE development kit includes other sample projects. These projects implement various profiles and
demonstration applications. For more information on these other projects, see the TI CC2540 Bluetooth
low energy Sample Applications Guide.
2.3
Software Overview
Software developed using the BLE software development kit consists of following five major components:
OSAL
HAL
The BLE Protocol Stack
Profiles
Application
The kit provides the BLE protocol stack as object code and the OSAL and HAL components in source
form.
The kit provides three GAP profiles:
Peripheral role
Central role
Peripheral bond manager
The kit also provides several sample GATT profiles and applications.
Path and file references in this document assume that you have installed the BLE development kit
software to the path: C:\Texas Instruments\BLE-CC254X-1.4.1\.
NOTE: This guide references the SimpleBLEPeripheral project. The BLE projects in the
development kit follow a similar structure.
14
Chapter 3
SWRU271G October 2010 Revised September 2015
The OSAL also provides services such as message passing, heap management, and timers. OSAL code
is provided in source form. For more information on the OSAL functions, see the OSAL API Guide.
15
Task Initialization
3.1
www.ti.com
Task Initialization
To use OSAL, locate a call to osal_start_system() at the end of the main() function. This function call is
the OSAL routine that starts the system. This routine starts the system and calls the osalInitTasks()
function defined by the application. In the SimpleBLEPeripheral project, you can find this function in
OSAL_SimpleBLEPeripheral.c:
Each layer of software using OSAL must have an initialization routine called from the function
osalInitTasks(). Within this function, the initialization routine for every layer of software is called within the
osalInitTasks(). As each task initialization routine is called, an 8-bit task ID value is assigned to the task.
NOTE: When creating an application, add this 8-bit task ID value to the end of the list and ensure
that the task ID is greater than the other task ID values. OSAL and HAL components are
provided in source form.
The task ID determines the priority of the tasks. The task ID gives lower values higher priority. The
protocol stack tasks must have the highest priority. The initialization function of the SimpleBLEPeripheral
application, SimpleBLEPeripheral_Init(), has the highest task ID and the lowest priority.
16
www.ti.com
3.2
17
Heap Manager
www.ti.com
Any layer of the software can set an OSAL event for any layer. Use the osal_set_event() function
(prototype in OSAL.h) to immediately schedule a new OSAL event. With this function, you specify the task
ID (of the task that will process the event) and the event flag as parameters.
An alternate method to set an OSAL event for any layer is to use the osal_start_timerEx() function
(prototype in OSAL_Timers.h). This function operates similarly to the osal_set_event() function. You select
the task ID of the task that will process the event and the event flag as parameters. The
osal_start_timerEx() function has a third parameter that you must use to input a time-out value in
milliseconds. This timeout parameter causes the OSAL to set a timer and set the specified event when the
timer expires.
3.3
Heap Manager
Th eOSAL provides basic memory management functions. The osal_mem_alloc() function can allocate
memory similarly to the standard C malloc function. The OSAL function takes a single parameter
specifying the number of bytes to allocate and returns a void pointer if successful. If memory is
unavailable, a NULL pointer is returned.
The osal_mem_free() function frees memory allocated using osal_mem_alloc() similarly to the standard C
free function.
The INT_HEAP_LEN preprocessor symbol reserves memory for dynamic allocation.
To profile dynamic memory usage, do the following:
1. Set the preprocessor symbol as OSALMEM_METRICS=TRUE in the project options.
2. Exercise the system in stress conditions that replicate the worst-case expected system load. (This may
involve having the maximum connected clients with maximum throughput while the application is
operating at maximum capactity.)
3. If configured, enable Pairing/Bonding.
4. Perform the test with encryption enabled.
5. Review the value of the variable memMax in OSAL_Memory.c to see the maximum amount of memory
allocated.
6. Use this value as a guideline for lowering INT_HEAP_LEN.
Because the BLE stack also uses the heap, you must test it with both components in the maximumexpected operating conditions.
3.4
OSAL Messages
OSAL provides a scheme for different subsystems of the software to communicate by sending or receiving
messages. Messages can contain any type of data and can be any size (assuming enough memory is
available).
To send an OSAL message, do the following:
1. Use the osal_msg_allocate() function to allocate the memory to store the messages by supplying a
length parameter that specifies the length of the message.
18
OSAL Messages
www.ti.com
NOTE:
A pointer to a buffer containing the allocated space is returned (you do not need to use
osal_mem_alloc() when using osal_msg_allocate()).
If no memory is available, a NULL pointer is returned.
The OSAL sets the SYS_EVENT_MSG flag for the receiving task that a message indicating that an
incoming message is available..This flag results in the event handler being invoked for the receiving task..
The receiving task retrieves the data by calling osal_msg_receive() and processes the message based on
the data contents. TI recommends every OSAL task have a local message processing function
(themessage processing function of the SimpleBLEPeripheral application is
simpleBLEPeripheral_ProcessOSALMsg()). The processing function chooses what action to take based
on the type of message received. When the receiving task processes the message, it must deallocate the
memory using the function osal_msg_deallocate() (you do not need to use osal_mem_free() when using
osal_msg_deallocate()). Examples of receiving OSAL messages will be depicted in the event processing
functions of the various layers.
19
Chapter 4
SWRU271G October 2010 Revised September 2015
4.1
Project Overview
On the left side of the IAR window, the Workspace section lists the files used by the project.
20
Project Overview
www.ti.com
21
Start-up in main()
4.2
www.ti.com
Start-up in main()
The main() function in SimpleBLEPeripheral_Main.c is the starting point at runtime. This function brings up
the board and initializes the OSAL and SNV drivers. Next, this function initializes power management and
creates the tasks. Finally, the function calls the osal_start_system(), which starts the processing loop
(OSAL) and does not return.
22
Application Initialization
www.ti.com
4.3
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 recieves 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.4
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
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.
23
Event Processing
www.ti.com
4.5
Callbacks
Other than processing events, application code can also within the callback functions defined by the
application such as simpleProfileChangeCB() and peripheralStateNotificationCB(). These callbacks
process in the context of the task that called them. Processing should be limited in these callbacks. If any
intensive processing must be done, send an event from the callback to the application so that processing
can occur. For more information, see Section 4.4.
24
www.ti.com
4.6
25
4.7
www.ti.com
26
Chapter 5
SWRU271G October 2010 Revised September 2015
5.1
5.1.1 Overview
The GAP layer of the BLE protocol stack defines the behavior of devices performing the following actions:
Device discovery
Link establishment
Link termination
Initiation of security features
Device configuration
See Figure 5-1 for an overview of possible device states.
27
www.ti.com
Connection Parameters
This section describes the connection parameters sent by the initiating device with the connection request.
These parameters can be modified by either device when the connection is established.
These parameters are the following:
Connection Interval BLE connections use a frequency-hopping scheme. The devices send and
receive data on a specific channel at a specific time and meet at a new channel later. The link layer of
the BLE protocol stack handles the channel switching. This meeting, where the two devices send and
receive data, is a connection event. If there is no application data sent or received, the devices
exchange link layer data to maintain the connection. The connection interval is the time between two
connection events in units of 1.25 ms. The connection interval can range from a minimum value of 6
(7.5 ms) to a maximum of 3200 (4.0 seconds).
28
www.ti.com
Slave Latency This parameter lets the slave (peripheral) device skip several connection events. If the
device has no data to send, it can skip connection events and deactivate its radio during the
connection event, which saves power. The slave latency value represents the maximum number of
events that can be skipped. This value ranges from a minimum value of 0 (no connection events)) to a
maximum of 499. The maximum value must create an effective connection interval less than 16
seconds. See Figure 5-3 for an overview of this parameter.
5.1.1.2
Supervision Time-out This parameter is the maximum time period between two successful
connection events. If this time period passes without a successful connection event, the device
considers the connection lost and returns to an unconnected state. This parameter value is
represented in units of 10 ms. The supervision time-out value can range from a minimum of 10 (100
ms) to 3200 (32 seconds). The time-out must be larger than the effective connection interval. For more
details, see Section 5.1.1.2.
Effective Connection Interval
The effective connection interval is equal to the amount of time between two connection events, assuming
the slave skips the maximum number of possible events if slave latency is allowed. The effective
connection interval is equal to the actual connection interval if slave latency is set to zero.
Calculate this interval using the following formula:
Effective Connection Interval = (Connection Interval) (1 + [Slave Latency])
Where:
Connection Interval: 80 (100 ms)
Slave Latency: 4
Effective Connection Interval: (100 ms) (1 + 4) = 500 ms
When no data is sent from the slave to the master, the slave will transmit during a connection event once
every 500 ms.
29
5.1.1.3
www.ti.com
In many applications, the slave skips the maximum number of connection events. Consider the effective
connection interval when selecting or requesting connection parameters. Selecting the correct group of
connection parameters helps optimize the power of the BLE device. The following list is a summary of the
trade-offs in connection-parameter settings:
Reducing the connection interval will do the following:
Increase the power consumed by both devices
Increase the throughput to and from both devices
Reduce the amount of time required to send data to and from both devices
Increasing the connection interval will do the following:
Reduce the power consumed by both devices
Reduce the throughput to and from both devices
Increase the amount of time required to send data to and from both devices
Reducing the slave latency or setting it to zero will do the following:
Increase the power consumed by the peripheral device
Reduce the amount of time required to send data from the central device to the peripheral device
Increasing the slave latency will do the following:
Reduce the power consumed by the peripheral device when it has no data to send to the central
device
Increase the amount of time required to send data from the central device to the peripheral device
5.1.1.4
Sometimes the central device will request a connection with a peripheral device containing connection
parameters unfavorable to the peripheral device. Other times, a peripheral device might change
parameters based on the peripheral application during a connection. The peripheral device can send a
Connection Parameter Update Request to the central device to change the connection settings. For
Bluetooth 4.0 devices, the L2CAP layer of the protocol stack handles this request.
This request contains the following four parameters:
A minimum connection interval
A maximum connection interval
A slave latency
A timeout
These values represent the parameters the peripheral device requires for the connection (the connection
interval is given as a range). When the central device receives this request, it can accept or reject the
parameters.
30
www.ti.com
5.1.1.5
Connection Termination
The master or slave can terminate a connection for any reason. When either device initiates termination,
the other must respond by acknowledging the termination indication before both devices disconnect.
31
GAPRole Task
5.2
www.ti.com
GAPRole Task
As in Section 3.1, the GAPRole task is a separate task (GAPRole_ProcessEvent) that simplifies the
application by handling most of the GAP layer functionality. This task is enabled and configured by the
application during initialization. Based on this configuration, many BLE protocol stack events are handled
directly by the GAPRole task and never passed to the application. Callbacks exist that the application can
register with the GAPRole task. This registration notifies the GAPRole task of certain events. See
Section B.3.1 for peripheral events or Section C.3.2 for central events.
Based on the configuration of the device, the GAP layer operates in one of the following four roles:
Broadcaster an advertiser that is nonconnectable
Observer scans for advertisements but cannot initiate connections
Peripheral an advertiser that is connectable and operates as a slave in a single link-layer connection
Central scans for advertisements and initiates connections and operates as a master in a single or
multiple link-layer connections (The BLE central protocol stack supports up to three simultaneous
connections.)
The BLE specification supports certain combinations of roles supported by the BLE protocol stack. See
the for sample projects of combination roles. The CC254x does not support simultaneous peripheral and
central device roles. This functionality is supported by the CC2640. The peripheral and central roles are
described in the following sections.
32
GAPRole Task
www.ti.com
2. Initialize the GAPRole task. Do this initialization when processing START_DEVICE_EVT. This
initialization involves passing function pointers to application callback functions. Section B.3 defines
these callbacks.
3. Send GAPRole commands from the application. The following is an example of the application using
GAPRole_TerminateConnection().
NOTE: The return value from the BLE protocol stack only indicates whether the attempt to terminate
the connection was initiated successfully. The termination of connection event sent to the
application asynchronously and is described in the following example. The API in Section B.3
lists the return parameters for each command and associated callback function events.
33
GAPRole Task
www.ti.com
4. The GAPRole task processes most of the GAP-related events passed to it from the BLE protocol
stack. The task forwards some events to the application. The following is an example tracing the
GAP_LINK_TERMINATED_EVENT from the BLE protocol stack to the application.
34
GAPRole Task
www.ti.com
2. Initialize the GAPRole task. Do this initialization when processing START DEVICE EVT. This
initialization involves passing function pointers to application callback functions. Section C.3 defines
these callbacks.
3. Send GAPRole commands from the application. The following is an example of the application using
GAPCentralRole_StartDiscovery().
NOTE: The return value from the BLE protocol stack only indicates whether the attempt to perform
device discovery was initiated or not. The termination of connection event is returned
asynchronously and is described in the following step. See appendices A through G for the
list of return parameter associated with each API.
35
GAPRole Task
www.ti.com
4. The GAPRole task processes some of the GAP-related events passed to it from the BLE protocol
stack. The task forwards some events to the application. The following is an example tracing the
GAP_DEVICE_DISCOVERY_EVENT from the BLE protocol stack to the application.
36
www.ti.com
5.3
Description
Pairing
Encryption
Authentication
Bonding
Authorization
OOB
Out of Band. Keys are not exchanged wirelessly, but rather over
some other source such as serial port or NFC. This also
provides MITM protection.
MITM
Just Works
37
www.ti.com
2. Register application callbacks with the GAPBondMgr. Do this registration after the GAPRole starts in
the START_DEVICE_EVT processing:
The GAPBondMgr is configured and operates autonomously. When a connection is established, the
GAPBondMgr initiates pairing and bonding depending on the configuration parameters from Step 1.
You can set a few parameters asynchronously such as GAPBOND_ERASE_ALLBONDS. All
communication between the GAPBondMgr and the application occurs through the callbacks that were
registered in Step 2. The following is a flow diagram example from SimpleBLECentral of the
GAPBondMgr, notifying the application that pairing has started. The following sections expand on
these callbacks.
38
www.ti.com
39
www.ti.com
Pairing Disabled
With pairing set to FALSE, the protocol stack rejects any attempt to pair.
5.3.3.2
Just Works pairing encrypts without MITM authentication and is vulnerable to MITM attacks. For Just
Works pairing without bonding, configure the GAPBondMgr as follows:
For an overview of this process for peripheral device, see Figure 5-5.
40
www.ti.com
The GAPBondMgr pairing states are passed to the application callback when required during the pairing
process. GAPBOND_PAIRING_STATE_STARTED is passed when sent or received by the stack.
GAPBOND_PAIRING_STATE_COMPLETE is sent when the pairing completes. A Just Works pairing
requires the pair-state callback. For more information, see Section F.3.
41
5.3.3.3
www.ti.com
To enable bonding with a Just Works pairing, use the following settings:
For an overview of this process for peripheral device, see Figure 5-6.
42
www.ti.com
5.3.3.4
Authenticated Pairing
Authenticated pairing requires MITM protection. This method is a way of transferring a passcode between
the devices. The passcode cannot transmit wirelessly and is displayed on one device (typically on an LCD
screen or a serial number on the device) and entered on the other device.
To pair with MITM authentication, use the following settings:
This method requires an additional step in the security process in Figure 5-7. After pairing is started, the
GAPBondMgr notifies the application that a passcode is required through a passcode callback. Depending
on the input and output capabilities of the device, the device must display and/or enter the passcode. If
entering a passcode, the application sends this passcode to the GAPBondMgr.
43
www.ti.com
This passcode communication with the GAPBondMgr uses a passcode callback function when registering
with GAPBondMgr. You must add a passcode function to the GAPBondMgr application callbacks. The
following is an example of a passcode function.
When the GAPBondMgr requires a passcode, the GAPBondMgr use the following callback to request a
passcode from the application. Depending on the input and output capabilities of the devices, the callback
function should either display a passcode or read in an entered passcode. This passcode must be sent by
the application to the GAPBondMgr using the GAPBondMgr_PasscodeRsp() function. The following is an
example of the SimpleBLECentral.
In the previous example, a random password is generated and displayed on an LCD screen by the
passcode callback function. The other connected device must then enter this passcode.
5.3.3.5
After pairing and encrypting with MITM authentication, bonding occurs similarly as described in
Section 5.3.3.3.
44
www.ti.com
5.4
45
www.ti.com
the attribute.
46
www.ti.com
47
www.ti.com
48
www.ti.com
5.4.3.1
This section describes how to use the GATT layer directly in the application. The functionality of the GATT
layer is implemented in the library code but you can find the header functions can in gatt.h. You can find
the complete API for the GATT layer in Appendix D. You can find more information on the functionality of
these commands in the Device Information Service (Bluetooth Specification), version 1.0 (24-May-2011).
GATT client applications uses these functions primarily. A few server-specific functions exist which are
described in the API and not considered here. Most GATT functions return ATT events to the application,
so consider the ATT API in Appendix D. Perform the following procedure to use the GATT layer when
functioning as a GATT client (that is, in the SimpleBLECentral project):
1. Initialize the GATT client. Do this in the application initialization function.
2. Register to receive incoming ATT indications and notifications. Do this in the application initialization
function.
49
www.ti.com
3. Perform a GATT client procedure. The following example uses GATT_WriteCharValue(), which is
triggered by pressing the key on the left in the SimpleBLECentral application.
50
www.ti.com
4. Receive and handle the response to the GATT client procedure in the application. In the following
example, the application receives an ATT_WRITE_RSP event. See Section D.5 for a list of GATT
commands and their corresponding ATT events.
NOTE: Though the event sent to the application is an ATT event, it is sent as a GATT protocol stack
message (GATT_MSG_EVENT).
Besides receiving responses to its own commands, a GATT client may also receive
asynchronous data from the GATT server as indications or notifications.
51
www.ti.com
5. Ensure the GATT client is registered to receive these ATT events in step 2.
These events will also be sent as ATT events in GATT messages to the application and should be
handled as described in this procedure.
GATTServApp Module
The GATTServApp module stores and manages the application-wide attribute table. Various profiles use
the table to add their characteristics to the attribute table. The BLE stack uses the table to respond to
discovery requests from a GATT client. For example, a GATT client may send a Discover all Primary
Characteristics message. The BLE stack on the GATT server receives this message and uses the
GATTServApp module to find and send the primary characteristics in the attribute table wirelessly. This
type of functionality is beyond the scope of this document and is implemented in the library code. The
functions of the GATTServApp are accessible from the profiles and defined in gattservapp_util.c and in the
API in Appendix E. These functions include finding specific attributes, reading client characteristic
configurations, and modifying client characteristic configurations.
52
www.ti.com
5.4.4.2
Profile Architecture
This section describes the architecture for profiles and provides functional examples of the
simpleGATTProfile in the SimpleBLEPeripheral project. See Section 5.4.2 for an overview of the
simpleGATTProfile.
To interface with the application and BLE protocol stack, each profile must contain the elements in the
following sections
53
www.ti.com
The length can be either ATT_BT_UUID_SIZE (2 bytes), or ATT_UUID_SIZE (16 bytes). The *uuid is a
pointer to a number either reserved by Bluetooth SIG (defined in gatt_uuid.c) or a custom UUID in the
profile.
permissions This element enforces how and if a GATT client device can access the value of the
attribute. Possible permissions are defined in gatt.h as the following:
GATT_PERMIT_READ // Attribute is Readable
GATT_PERMIT_WRITE // Attribute is Writable
GATT_PERMIT_AUTHEN_READ // Read requires Authentication
GATT_PERMIT_AUTHEN_WRITE // Write requires Authentication
GATT_PERMIT_AUTHOR_READ // Read requires Authorization
GATT_PERMIT_ENCRYPT_READ // Read requires Encryption
GATT_PERMIT_ENCRYPT_WRITE // Write requires Encryption
Section 5.3 describes authentication, authorization, and encryption further.
handle This is a placeholder in the table where GATTServApp assigns a handle. Handles are
assigned sequentially.
pValue This is a pointer to the attribute value. The size cannot be changed after initialization. The
maximum size is 512 octets.
The following sections provide examples of attribute definitions for common attribute types.
54
www.ti.com
This attribute is set to the Bluetooth SIG-defined primary service UUID (0x2800). A GATT client must read
this attribute so the permission is set to GATT_PERMIT_READ. The pValue is a pointer to the UUID of
the service, custom-defined as 0xFFF0:
NOTE:
These properties are visible to the GATT client stating the properties of the characteristic
value but the GATT permissions of the characteristic value affect its functionality in the
protocol stack. These properties must match the GATT permissions of the characteristic
value. The following section expands on this.
55
www.ti.com
The pValue is a pointer to the location of the actual value. This value is statically defined in the profile as
follows:
The type is set to the Bluetooth SIG-defined client characteristic configuration UUID (0x2902).
GATT clients must read and write to this so the GATT permissions are set to readable and writable.
The pValue is a pointer to the location of the client characteristic configuration array, defined in the profile
as the following:
NOTE: Because this value must be cached for each connection, this is an array ion.Tthe following
section describes this ion.
56
www.ti.com
57
www.ti.com
The application must define a callback of this type and pass it to the simpleGATTProfile with the
SimpleProfile_RegisterAppCBs() function. The application does this in simpleBLEPeripheral.c through the
following:
See the following section for the mechanism of how this callback is used.
5.4.4.2.4 Read and Write Callback Functions
The profile must define read and write callback functions that the protocol stack will call when one of the
attributes of the profile is written to and/or read from. The callbacks must be registered with GATTServApp
function as mentioned in Section 5.4.4.2.2. These callbacks perform the characteristic reads, writes, and
other processing like possibly calling an application callback defined by the profile.
58
www.ti.com
NOTE: Consider the processing in this section in the context of the protocol stack. If any intensive
profile related processing must be completed for an attribute read, this processing should be
split up and completed in the context of the application task. See the following write request
for more information.
59
www.ti.com
60
www.ti.com
NOTE: Minimize the processing done in the stack task. Set an application so processing can
complete in the application task if extensive additional processing beyond storing the
attribute write value in the profile is required.
61
www.ti.com
The code for this function is displayed in the following code from simpleGATTProfile.c. Other than setting
the value of the static simpleProfileChar4, this function also calls GATTServApp_ProcessCharCfg
because it has GATT_PROP_NOTIFY properties. This call forces GATTServApp to check if notifications
have been enabled by the GATT client. If so, the GATTServApp sends a notification of this attribute to the
GATT client.
62
L2CAP
www.ti.com
5.5
L2CAP
The L2CAP layer sits on top of the HCI layer and transfers data between the upper layers of the host
(GAP, GATT, application, and so forth) and the lower-layer protocol stack. This layer multiplexes higherlevel protocol and reassembles data exchanged between the host and the protocol stack. L2CAP permits
higher-level protocols and applications to transmit and receive upper-layer data packets (L2CAP Service
Data Units, [SDUs]) up to 64KB long. The amount of memory available on the specific device
implementation limits the size. The CC254x and the 1.4.1 stack support an effective MTU size of 23, set
by L2CAP_MTU_SIZE in l2cap.h. Changing the L2CAP_MTU_SIZE results in incorrect stack behavior.
5.6
HCI
The HCI layer is a thin layer that transports commands and events between the host and controller. In a
network processor application, the HCI layer is implemented by a transport protocol such as SPI or UART.
In embedded SoC projects, the HCI layer is implemented through function calls and callbacks. The
commands and events discussed previously in this guide pass from the given layer through the HCI layer
to the controller and through the controller to the HCI layer.
The GAPRole task receives events related to HCI extension commands, even if they are called from the
application. Implement a callback function to pass these events from the GAPRole task back to the
application if needed in the application.
63
Library Files
5.7
www.ti.com
Library Files
Each project must include the following two library files:
BLE Stack Library: This library includes the lower-layer stack functionality and varies based on the
GAP role. You can include the full library, but you can use a smaller subset to conserve code space
typically. This library is different for a CC2540 and CC2541 project.
HCI Transport Layer Library: This library includes transport layer functionality for a network processor.
This library is the same for CC2540 and CC2541.
The library files are at $INSTALL$\Projects\ble\Libraries. Use Table 5-2 to determine the correct library file
to use in the project.
Table 5-2. Supported BLE-Stack Library Configurations
GAP Roles Supported
Configuration
Broadcaster
Peripheral
Chipset
Library
Central
Network
processor
CC2540
CC2540_BLE.lib
CC254X_BLE_H
CI_TL_Full.lib
Single-device
CC2540
CC2540_BLE.lib
Single-device
CC2540
CC2540_BLE_b
cast.lib
Single-device
CC2540
CC2540_BLE_
bcast_observ.lib
Single-device
Single-device
Single-device
X
X
CC2540
CC2540_BLE_c
ent.lib
CC2540
CC2540_BLE_
cent_bcast.lib
CC2540
CC2540_BLE_o
bserv.lib
CC2540
CC2540_BLE_p
eri.lib
CC2540
CC2540_BLE_
peri_observ.lib
Single-device
Single-device
Network
processor
CC2541
CC2541_BLE.lib
CC254X_BLE_H
CI_TL_Full.lib
Single-device
CC2541
CC2541_BLE.lib
Single-device
CC2541
CC2541_BLE_
bcast.lib
Single-device
CC2541
CC2541_BLE_
bcast_observ.lib
Single-device
Single-device
Single-device
64
Observer
X
X
CC2541
CC2541_BLE_c
ent.lib
CC2541
CC2541_BLE_
cent_bcast.lib
CC2541
CC2541_BLE_
observ.lib
CC2541
CC2541_BLE_p
eri.lib
CC2541
CC2541_BLE_
peri_observ.lib
Single-device
Single-device
Chapter 6
SWRU271G October 2010 Revised September 2015
Drivers
The hardware abstraction layer (HAL) of the CC254x software provides an interface of abstraction
between the physical hardware and the application and/or protocol stack. This HAL allows for the
development of new hardware (such as a new PCB) without making changes to the protocol stack or
application source code. The HAL includes software for the SPI and UART communication interfaces,
AES, keys, LCD, and LEDs. The HAL drivers that support the following hardware platforms include the
following:
SmartRF05EB + CC2540EM
SmartRF05EB + CC2541EM
CC2540 Keyfob
CC2541 Keyfob
CC2541 SensorTag
CC2540 USB Dongle
When developing with a different hardware platform, you might need to modify the HAL source for
compatablility.
Find the HAL files in the sample projects by doing the following:
1. Click HAL.
2. Click Target.
3. Click CC2540EB.
4. Click Drivers. See Figure 6-1.
Drivers
65
ADC
www.ti.com
6.1
ADC
To include the ADC driver, define HAL_ADC=TRUE in the preprocessor definitions. See the hal_adc.h
header file for the ADC API. CC2541/43/44/45 Peripherals Software Examples (SWRC257) has several
ADC examples.
6.2
AES
To include the AES driver, define HAL_AES=TRUE. The stack requires AES for encryption. Always set
this symbol set to TRUE. You cannot reuse DMA channels 1 and 2 because the AES driver uses them.
Set the following in hal_aes.h:
You can find the AES API in hal_ase.h. TI recommends letting the application use the HCI encrypt and
decrypt functions (from hci.h):
6.3
LCD
To include the LCD driver, define HAL_LCD=TRUE in the preprocessor definitions. TI designed the driver
to function with the LCD on the SmartRF05 boards. You must modify parts of the driver such as the pin
and port definitions in hal_lcd.c to use it with custom hardware. See the CC2540/1 configuration in the
SimpleBLEPeripheral project for an example using the LCD driver.
6.4
LED
To include the LED driver, define HAL_LED=TRUE in the preprocessor definitions. TI designed the driver
to function with the LEDs on the Keyfob. You must modify parts of the driver such as the LED bit
definitions in hal_led.c to use it with custom hardware. See the CC2540/1 DK-miniKeyfob in the
SimpleBLEPeripheral project for an example using the LED driver.
6.5
KEY
The KEY driver handles button inputs. To include the KEY driver, define HAL_KEY=TRUE in the
preprocessor definitions. TI designed the driver to function with the buttons on the keyfob or SmartRF05
Board depending on whether CC2540_MINIDK is defined. You must modify parts of the driver such as the
port and pin definitions in hal_key.c to use it with custom hardware. See the SimpleBLEPeripheral project
for an example using the KEY driver.
6.6
DMA
To include the DMA driver, define HAL_DMA=TRUE in the preprocessor definitions. Because the AES
driver uses the DMA driver, always include the DMA driver in the project. Channels 1 and 2 are reserved
for the AES driver. If the UART DMA or SPI driver is used, other channels are used. You can find the
DMA API in hal_dma.h. See the SPI driver for an example of using the DMA driver.
6.7
66
Drivers
Other Peripherals
www.ti.com
6.8
Other Peripherals
See CC2541/43/44/45 Peripherals Software Examples (SWRC257) for examples of hardware peripherals
without drivers, such as the timers. See CC254x Chip Users Guide (SWRU191) for explanation of the
hardware peripherals.
6.9
Simple NV (SNV)
The SNV area of flash securely stores persistent data, such as encryption keys from bonding or custom
parameters. The protocol stack reserves two 2-kB flash pages for SNV. These pages are the last two
pages of flash by default. To minimize the number of erase cycles on the flash, the SNV manager
performs compactions on the flash sector when the sector has 80% invalidated data. A compaction is
copying valid data to a temporary area then erasing the sector where the data was stored. The SNV driver
uses the hal_flash driver.
SNV can be read from or written to using the following APIs:
uint8 osal_snv_read( osalSnvId_t id, osalSnvLen_t len, void *pBuf) Read data from NV
Parameters
id valid NV item
len Length of data to read
pBuf pointer to buffer to store data read
Returns
uint8 osal_snv_write( osalSnvId_t id, osalSnvLen_t len, void *pBuf) Write data to NV
Parameters
id valid NV item
len Length of data to write
pBuf pointer to buffer containing data to be written
Returns
Because SNV is shared with other modules in the BLE SDK such as the GAPBondMgr, carefully manage
the IDs of the NV item. The available IDs are defined in bcomdef.h by default:
Drivers
67
Chapter 7
SWRU271G October 2010 Revised September 2015
7.1
7.2
7.3
7.4
7.5
68
www.ti.com
Depending on the hardware platform (keyfob, EM, and so forth), the project contains a different board file.
These board files are specific to the given platform and must be adjusted for custom hardware. Some
modifications may include the following:
Modifying the symbols used by drivers for specific pins (that is, LED1_SBIT)
Selecting the 32-kHz oscillator source (OSC_32KHZ)
Initializing input and output pins to safe initialization levels to prevent current leakage
7.6
Software Considerations
If the return value of the notification or indication is SUCCESS (0x00), the stack freed the
memory.
If the return value is something other than SUCCESS (that is, blePending), free the memory
using GATT_bm_free().
69
Software Considerations
www.ti.com
The 2 ms are added as buffer to account for controller processing time. If extensive processing is required
in the application task, split it up using OSAL events in Section 3.2.
70
Chapter 8
SWRU271G October 2010 Revised September 2015
8.1
IAR Overview
Two options are available for developing software on the CC2540/41:
Download IAR Embedded Workbench 30-day Evaluation Edition This version of IAR is free and fully
functional for 30 days. This version includes the standard features. Download the IAR 30-day
Evaluation Edition from the following URL: http://supp.iar.com/Download/SW/?item=EW8051-EVAL
Purchase the full-featured version of IAR Embedded Workbench For complete BLE application
development using the CC2540/41, TI recommends the complete version of IAR without restrictions.
Information on purchasing the complete version of IAR is available at the following URL:
http://www.iar.com/en/Products/IAR-Embedded-Workbench/8051/
8.2
71
www.ti.com
This file is the workspace for the SimpleBLEPeripheral project. When you select this file, the files
associated with the workspace should also open with a list of files on the left side. See Figure 8-1 for the
IAR Embedded Workbench.
72
www.ti.com
73
www.ti.com
Compiler preprocessor definitions or symbols are important settings when building a project (see Figure 84).
You can find and set these values by doing the following:
1. Click the C/C++ Compiler category on the left.
2. Click the Preprocessor tab on the right:
74
www.ti.com
Symbols can be defined in configuration files, which are included when compiling. The Extra Options tab
under the compiler settings let you set up the configuration files to be included. You must include the
config.cfg file with every build because it defines some required universal constants. The buildConfig.h file
included with the software development kit defines the appropriate symbols for the project (see Figure 85).
75
www.ti.com
The BLE protocol stack and software uses the following symbols. You can find them in the sample project:
Symbols Mandatory for BLE Stack
INT_HEAP_LEN This symbol defines the size of the heap used by the OSAL Memory Manager (see
Section 3.3) in bytes. The default value in the sample project is 3072. You can increase this value if
the application requires additional heap memory. If this value is increased too much, you may exceed
the RAM limit. If the application requires additional memory for local variables, you may need to
increase this value. The memory set aside for the heap shows up in the map file under the
OSAL_Memory module. For more information on the map file, see section Section 8.2.4.
HALNODEBUG Define this symbol for all projects to disable HAL assertions.
OSAL_CBTIMER_NUM_TASKS This symbol defines the number of OSAL callback timers that you
can use. The BLE protocol stack uses the OSAL callback timer. You must define this value as either 1
or 2 (a maximum of two callback timers are allowed). For applications without any callback timers such
as the sample application, define this value as 1.
HAL_AES_DMA Define this symbol as TRUE because the BLE stack uses DMA for AES encryption.
HAL_DMA This value must be defined as TRUE for all BLE projects, as the DMA controller is used
by the stack when reading and writing to flash.
Optional Symbols
POWER_SAVING When defined, this symbol configures the system to go into sleep mode when free
of any pending tasks.
PLUS_BROADCASTER This symbol indicates that the device is using the GAP
Peripheral/Broadcaster multirole profile rather than the single GAP Peripheral role profile. The default
option in the simpleBLEPeripheral project is undefined.
HAL_LCD This symbol indicates whether to include and use the LCD driver when set to TRUE. If not
defined, it is set to TRUE.
HAL_LED This symbol indicates whether to include the LED driver when set to TRUE. If not defined,
it is set to TRUE.
HAL_KEY This symbol indicates whether to include the KEY driver when set to TRUE. If not defined,
it is set to TRUE.
HAL_UART This symbol indicates whether to include the UART driver when set to TRUE. If not
defined, it is set to FALSE.
CC2540_MINIDK Define this symbol when using the keyfob board in the CC2540/41DK-MINI
development kit. This symbol configures the hardware based on the keyfob board layout.
HAL_UART_DMA This symbol sets the UART interface to use DMA mode when set to 1. When
HAL_UART is defined, set either HAL_UART_DMA or HAL_UART_ISR to 1.
HAL_UART_ISR This symbol sets the UART interface to use ISR mode when set to 1. When
HAL_UART is defined, set either HAL_UART_DMA or HAL_UART_ISR to 1.
HAL_UART_SPI This symbol indicates whether to include the SPI driver.
GAP_BOND_MGR The HostTestRelease network processor project uses this symbol. When this
symbol is defined for slave and peripheral configurations, use the GAP peripheral bond manager
security profile to manage bonds and handle keys. See Section 5.3 for more information on the
peripheral bond manager.
GATT_DB_OFF_CHIP The HostTestRelease network processor project uses this symbol. This
symbol sets a GATT client in a network processor configuration to manage the attributes in the
application processor instead of the CC2540/41.
Other definitions relating to specific use cases such as the serial bootloader, OAD, and so forth are
defined in the documentation.
76
www.ti.com
3. To download the compiled code onto a CC2540/41 device and debug, connect the keyfob using a
hardware debugger (such as the CC Debugger included with the CC2540/41DK-MINI development kit)
connected to the PC over USB.
77
www.ti.com
4. Find the Debug button on the upper-right side of the IAR window (see Figure 8-8).
NOTE: If there are multiple debug devices connected, Figure 8-9 appears to select a device
6. Click the Go button on the toolbar to execute the program (see Figure 8-10).
78
www.ti.com
79
www.ti.com
The map file contains low-level information about the build. Lines of text similar to the following are at the
end of the map file:
118 544 bytes of CODE
memory
of BIT memory
This text shows the total code space (CODE memory) and RAM (XDATA memory) the project uses.
Ensure the sum of the CODE memory plus CONST memory does not exceed the maximum flash size of
the device (either 128KB or 256KB, depending on the version of the CC2540/41). Ensure the size of the
XDATA memory does not exceed 7936 bytes, as the CC2540/41 contains 8KB of SRAM (256 bytes are
reserved).
For more specific information, the map file contains a section called MODULE SUMMARY. This section is
approximately 200 to 300 lines before the end of the file (the exact location varies from build-to-build).
Within this section, you can see the exact amount of flash and memory for every module in the project.
80
Chapter 9
SWRU271G October 2010 Revised September 2015
General Information
The release notes also can be found in the installer at: $INSTALL$\README.txt.
9.1
General Information
81
www.ti.com
Fix for CC254x host Bond Manager setParam configuration does not support M/S LinkKey enc
exchange
Fixed TICKSPD, CLKSPD is overwritten on X/HS-OSC change
Fixed Device Fails to Return to Sleep After Last BLE Task
Known Issues:
Use of the NV memory (to save application data or BLE Host bonding information) during a BLE
connection may cause an unexpected disconnect. The likelihood of this happening increases with
frequent usage, especially when using short connection intervals. The cause is related to the NV wear
algorithm which at some point may cause an NV page erase which can disrupt system real-time
processing. TI recommends using the NV memory sparingly or only when a connection is not active.
HCI packet size of 128 bytes or more will be disregarded by the stack and no HCI event will be
returned.
For technical support, visit the Texas Instruments Bluetooth low energy E2E Forum: http://www.ti.com/bleforum
For additional sample applications, guides, and documentation, visit the Texas Instruments Bluetooth low
energy wiki page at: http://processors.wiki.ti.com/index.php/Category:BluetoothLE
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------Texas Instruments, Inc.
CC2540/41 Bluetooth low energy Software Development Kit Release Notes
Version 1.4.0 November 8, 2013
Notices:
This version of the Texas Instruments BLE stack and software is a minor update to the v1.3.2 release.
It contains some minor bug fixes and a few functional changes.
The BLE protocol stack, including both the controller and host, was completely retested for v1.4.0.
Changes and Enhancements:
All projects have been migrated from IAR v8.10.4 to IAR 8.20.2.To build all projects, upgrade to IAR
v8.20.2.
Updated SPI and UART_DMA drivers for improved robustness and throughput.
Added an overlapped processing feature to improve throughput and reduce power consumption in
devices where peak power consumption isn't an issue. Overlapped processing allows the stack to
concurrently process while the radio is active. Since the stack is concurrently processing, it is able to
insert new data in the Tx buffer during the connection event, causing additional packets to be sent
before the end of the event.
Added a Number of Completed Packets HCI command which offers the possibility of waiting for a
certain number of completed packets before reporting to the host. This allows higher throughput when
used with overlapped processing.
Added an HCI Extension command HCI_EXT_DelaySleepCmd which provides the user control of the
system initialization sleep delay (wake time from PM3/boot before going back to sleep). The default
sleep delay is based on the reference design 32 kHz XOSC stabilization time.
Added a low duty cycle directed advertising option.
Added support for deleting a single bond with the GAP_BondSetParam command.
Decreased CRC calculation time during OAD by using DMA.
82
General Information
www.ti.com
Bug Fixes:
Using a short connection interval and exercising high throughput, there was some loss of packets. This
was fixed by adding host to application flow control support.
Bonding was unstable at short connection intervals. This is now fixed.
Fixed USB CDC Drivers to work with Windows 8.
OAD sample project would fail if long connection interval was used. This was fixed by not allowing
parameter updates to the central device.
Fixed linking errors in UBL project.
Fixed minor issues in sample apps to work with PTS dongle.
Fixed USB descriptors in HostTestRelease to display correct string.
Known Issues:
Use of the NV memory (to save application data or BLE Host bonding information) during a BLE
connection may cause an unexpected disconnect. The likelihood of this happening increases with
frequent usage, especially when using short connection intervals. The cause is related to the NV wear
algorithm which at some point may cause an NV page erase which can disrupt system real-time
processing. It is therefore recommended that the NV memory be used sparingly, or only when a
connection is not active.
HCI packet size of 128 bytes or more will be disregarded by the stack, and as such, no HCI event will
be returned.
For technical support, visit the Texas Instruments Bluetooth low energy E2E Forum:
http://e2e.ti.com/support/low_power_rf/f/538.aspx
For additional sample applications, guides, and documentation, visit the Texas Instruments Bluetooth low
energy wiki page at: http://processors.wiki.ti.com/index.php/Category:BluetoothLE
------------------------------------------------------------------------------------------------------------------------------------------------------------Version 1.3.2 June 13, 2013
Notices:
This version of the Texas Instruments BLE stack and software is a minor update to the v1.3.1 release.
It contains some minor bug fixes and a few functional changes.
The BLE protocol stack, including both the controller and host, was completely retested for v1.3.2. The
profiles Running Speed and Cadence, Cycling Speed and Cadence, and Glucose were fully tested and
passed certification. Other profiles with no code changes since 1.3.1 were sanity tested only.
Changes and Enhancements:
Added Running Speed and Cadence profile and service. An example application demonstrating
running speed and cadence is provided.
Added Cycling Speed and Cadence profile and service. An example application demonstrating cycling
speed and cadence is provided.
Added delay before performing Connection Parameter changes. Implemented conn_pause_peripheral)
and TGAP(conn_pause_central) timers as described in CSA 3 rev 2, Gap Connection Parameters
Changes, Section 1.12. Updated HIDAdvRemote, HIDEmuKbd, KeyFob, SensorTag, and
SimpleBLEPeripheral applications.
Update Privacy Flag and Reconnection Address characteristics permissions (Erratum 4202)
A new Windows USB CDC driver has been included in the installer. This new driver is signed and is
functional on Windows 8 systems.
General Information
83
www.ti.com
Bug Fixes:
Some minor updates to glucose sensor and collector were made.
The gyroscope would draw continuous 6mA when enabled. The updated code now performs a read
and turns off the gyro after 60ms.
The masters host would accept invalid connection parameters requested by the Slave, and would
send back the Connection Parameter Update Response with parameters accepted. The host now
performs validation on these parameters.
When coming out of sleep, the HCI_EXT_ExtendRfRangeCmd would override
HCI_EXT_SetRxGainCmd setting and set it to default gain. This has been fixed.
Known Issues:
Use of the NV memory (to save application data or BLE Host bonding information) during a BLE
connection may cause an unexpected disconnect. The likelihood of this happening increases with
frequent usage, especially when using short connection intervals. The cause is related to the NV wear
algorithm which at some point may cause an NV page erase which can disrupt system real-time
processing. It is therefore recommended that the NV memory be used sparingly, or only when a
connection is not active.
HCI packet size of 128 bytes or more will be disregarded by the stack, and as such, no HCI event will
be returned.
The HAL SPI driver that was implemented since the v1.3 release can sometimes hang, particularly in
cases in which power management is used and when there is heavy traffic on the SPI bus.
For technical support, visit the Texas Instruments Bluetooth low energy E2E Forum:
http://e2e.ti.com/support/low_power_rf/f/538.aspx
------------------------------------------------------------------------------------------------------------------------------------------------------------Version 1.3.1 April 18, 2013
Notices:
This version of the Texas Instruments BLE stack and software is a minor update to the v1.3 release. It
contains some minor bug fixes, with no major functional changes. It also contains two additional
projects for the CC2541 Advanced Remote Control Kit.
Since none of the profile source code was significantly changed since the v1.3 release, no additional
re-testing of the profiles and sample application were done for v1.3.1. The only exception is the HIDover-GATT profile, which was fully re-tested for this release. The BLE protocol stack, including both the
controller and host, was completely retested for v1.3.1.
Major Changes and Enhancements:
The GAP parameter TGAP_LIM_ADV_TIMEOUT now uses units of seconds instead of milliseconds.
The HidAdvRemote Project has been added. This implements a full mouse-like pointing functionality
using motion and gesture control. The project runs on the CC2541 BLE Advanced Control included as
part of the CC2541DK-REMOTE kit. The application implements the HID-over-GATT (HOGP) profile
with a report descriptor supporting the keyboard, mouse, and consumer control classes of HID devices.
The HidAdvRemoteDongle project has been added. This application runs on the CC2540USB dongle,
and implements partial functionality of HID-over-GATT (HOGP) host with a fixed report descriptor to
match that of the descriptor of the HidAdvRemote Project. This means that the HidAdvRemoteDongle
was designed only to work with the HidAdvRemote, and will not be compatible with any other HOGP
devices. This project was created to allow users who are using a host device that does not have native
Bluetooth Smart Ready support and/or does not have HOGP support to use the BLE Advanced
Remote Control with their system.
For GAP central role applications, the bond manager now properly handles cases in which the
peripheral device has erased previously stored bonding information
A new HCI extension API has been added to allow peripheral/slave devices to temporarily ignore any
nonzero slave latency value, and explicitly wake up at every connection event regardless of whether it
has any data to send. The prototype for the API function HCI_EXT_SetSlaveLatencyOverrideCmd can
be found in hci.h, including the description of the function.
84
General Information
www.ti.com
A new HCI extension API has been added to allow the application layer to get or set a build revision
number.
Bug Fixes:
In some cases L2CAP Peripheral Connection Parameter Update requests failed due to a zero value in
the transmitWindowOffset parameter when the connection was initially established. This has been fixed
and updates should now work successfully.
During bonding, connection failures would occasionally occur due to the OSAL Simple NV driver
performing a page compaction and halting the CPU for longer than the time required for the link layer
to maintain proper connection timing. To prevent this from occurring, the simple NV driver now has any
API to force a page compaction if the page is full beyond a specified threshold. The bond manager
calls this API every time a connection is terminated to ensure that compaction occurs before the next
connection is set up.
Occasional slave connection failures would previously occur in cases in which the master device sends
Update Channel Map requests while a large slave latency value is in use. This has been fixed.
The SensorTag application now properly supports storage of GATT Client Characteristic Configuration
Descriptor values with bonded devices.
After disabling advertising, the CC254x would unnecessarily wake up for a short period of time 500ms
later. This unecessary wake-up has been removed.
Upon Power-On Reset or after wake-up from PM3, a 400ms delay has been implemented, during
which time the CC254x will not go into PM2 sleep. This allows time for the 32kHz crystal to stabilize.
Previously, in rare cases with certain hardware configurations the CC254x could have timing issues
due to the crystal not having time to stabilize.
Minor bug fixes to GlucoseSensor and GlucoseCollector projects.
Known Issues:
Use of the NV memory (to save application data or BLE Host bonding information) during a BLE
connection may cause an unexpected disconnect. The likelihood of this happening increases with
frequent usage, especially when using short connection intervals. The cause is related to the NV wear
algorithm which at some point may cause an NV page erase which can disrupt system real-time
processing. It is therefore recommended that the NV memory be used sparingly, or only when a
connection is not active.
HCI packet size of 128 bytes or more will be disregarded by the stack, and as such, no HCI event will
be returned.
The HAL SPI driver that was implemented since the v1.3 release can sometimes hang, particularly in
cases in which power management is used and when there is heavy traffic on the SPI bus.
For technical support, visit the Texas Instruments Bluetooth low energy E2E Forum:
http://e2e.ti.com/support/low_power_rf/f/538.aspx
------------------------------------------------------------------------------------------------------------------------------------------------------------Version 1.3 Dec 12, 2012
Notices:
This version of the Texas Instruments BLE stack and software features several changes,
enhancements, and bug fixes from v1.2.1. Details of these can be found below.
Changes and Enhancements:
A new sample project, SensorTag, has been added. This application runs on the CC2541 Sensor Tag
board, which is included as part of the CC2541DK-SENSOR development kit. The application includes
custom services for an accelerometer, barometer, gyro, humidity sensor, IR temperature sensor, and
magnetometer.
A new Boot Image Manager (BIM) is included. This allows one CC2540 or CC2541 device to contain
two separate software images (an "A" image and a "B" image) stored in flash. Upon power-up, the BIM
selects which image to boot into. This can be based on criteria such as the state of a GPIO pin, or
based on a selection from the previously running application upon reset.
SWRU271G October 2010 Revised September 2015
Submit Documentation Feedback
Copyright 20102015, Texas Instruments Incorporated
General Information
85
86
www.ti.com
A new Over-the-air firmware download (OAD) feature is included. The feature allows a peer device
(which could be a central BT Smart device such as a smartphone) to push a new firmware image onto
a peripheral device and update the firmware. This feature uses the BIM, in which case the downloaded
image gets stored in the opposite flash location as the currently running image. For example, if the "A"
image is the current image and is used to perform the download, then the downloaded image becomes
the "B" image. Upon reset, the "B" image with the updated firmware would be loaded. The OAD feature
optionally allows for the firmware image to be signed (using AES). Both the SensorTag and
SimpleBLEPeripheral projects include configurations for using the OAD feature. A central
"OADManager" application is also included, demonstrating a central implementation for sending a new
firmware image to an OAD target device.
The physical HCI interface used by the network processor (HostTestRelease) has been enhanced to
work while power management is enabled on the CC254x device. The UART interface, when using
RTS and CTS lines, can be used by an external application processor to wake-up the CC254x network
processor. When the network processor has completed all processing, it will go into deep sleep. In
addition to UART, an SPI interface has been added as an option for the physical HCI interface. It also
supports power management by means of the MRDY and SRDY lines.
The CC2541 configuration of the KeyFobDemo project has been modified to support the new CC2541
keyfob hardware, contained in the CC2541DK-MINI kit. The accelerometer has been changed, and a
TPS62730 DC/DC converter has been added.
The structure of all projects have been changed to include a Transport Layer ("TL") library and network
processor interface "NPI" source code. This new architecture allows for non-network processor
applications to have slightly reduced code size by removing unnecessary stack components.
An API has been provided allowing the device name and appearance characteristics in the GAP
service to be modified by the application layer.
KeyFobDemo project now includes visual feedback from LED to indicate when device has powered up
and when device is advertising.
The HID-over-GATT Profile (HOGP) implementation has been updated to now queue up HID report
and send notifications upon reconnection to a HID host.
A new implementation of the HID service has been included, which supports a combined keyboard,
mouse, and consumer class device in its HID report descriptor.
The API for sending L2CAP Connection Parameter Update Requests from the GAP Peripheral Role
Profile has been updated to take both the requested minimum and maximum connection intervals as
parameters.
BTool has been enhanced with a new GATT explorer table, displaying discovered attributes, handles,
and values. An XML file is included which allows the user to define descriptions of characteristics
based on their UUIDs.
HCI UART interface baud rate has been changed from 57600 to 115200.
General Information
www.ti.com
Bug Fixes:
When power management is used with long connection intervals (>2s), the CC254x remains sleeping
properly without unnecessary wake-ups.
When slave latency is used, peripheral devices now properly wake-up before the next connection
event when a data packet is queued
Various bug fixes on the GlucoseSensor and GlucoseCollector projects to improve compliance with
profile and service specifications.
HID-over-GATT Pofile (HOGP) implementation has been updated to provide better interoperability with
HID hosts.
Known Issues:
Use of the NV memory (to save application data or BLE Host bonding information) during a BLE
connection may cause an unexpected disconnect. The likelihood of this happening increases with
frequent usage, especially when using short connection intervals. The cause is related to the NV wear
algorithm which at some point may cause an NV page erase which can disrupt system real-time
processing. It is therefore recommended that the NV memory be used sparingly, or only when a
connection is not active.
HCI packet size of 128 bytes or more will be disregarded by the stack, and as such, no HCI event will
be returned.
For technical support, visit the Texas Instruments Bluetooth low energy E2E Forum:
http://e2e.ti.com/support/low_power_rf/f/538.aspx
------------------------------------------------------------------------------------------------------------------------------------------------------------Version 1.2.1 Apr 13, 2012
Notices:
This version of the Texas Instruments BLE stack and software is a minor update to the v1.2 release. It
contains some minor enhancements and bug fixes, with no API changes or major functional changes.
Changes and Enhancements:
When advertising is enabled by calling GAP_MakeDiscoverable, the first advertisement event will now
occur within a few milliseconds, rather than waiting for 10 ms.
Bug Fixes:
The HidEmuKbd project now properly implements the HID Service include of the Battery Service. This
bug fix allows for proper interoperability between the CC254x HID Profile and host systems running
Windows 8.
The source code file hal_board_cfg.h has been updated to better support the serial bootloader (SBL)
and Universal Bootloader (UBL).
Scanning in BTool can now be cancelled at any time without hanging or freezing the system.
Known Issues:
Use of the NV memory (to save application data or BLE Host bonding information) during a BLE
connection may cause an unexpected disconnect. The likelihood of this happening increases with
frequent usage, especially when using short connection intervals. The cause is related to the NV wear
algorithm which at some point may cause an NV page erase which can disrupt system real-time
processing. It is therefore recommended that the NV memory be used sparingly, or only when a
connection is not active.
For technical support, visit the Texas Instruments Bluetooth low energy E2E Forum:
http://e2e.ti.com/support/low_power_rf/f/538.aspx
-------------------------------------------------------------------------------------------------------------------------------------------------------------
General Information
87
www.ti.com
General Information
www.ti.com
Bug Fixes:
Duplicate filtering now works with combination states.
Various minor application / profile bug fixes.
Known Issues:
Use of the NV memory (to save application data or BLE Host bonding information) during a BLE
connection may cause an unexpected disconnect. The likelihood of this happening increases with
frequent usage, especially when using short connection intervals. The cause is related to the NV wear
algorithm which at some point may cause an NV page erase which can disrupt system real-time
processing. It is therefore recommended that the NV memory be used sparingly, or only when a
connection is not active.
For technical support, visit the Texas Instruments Bluetooth low energy E2E Forum:
http://e2e.ti.com/support/low_power_rf/f/538.aspx
------------------------------------------------------------------------------------------------------------------------------------------------------------Version 1.1b Nov 30, 2011
Notices:
This version of the Texas Instruments BLE stack and software includes support for the CC2541, as
well as some minor enhancements and bug fixes. Details of these can be found below. The general
software architecture remains the same as in the v1.1 and v1.1a releases.
Changes and Enhancements:
BLE stack libraries for the CC2541 are included.
All BLE libraries are renamed and now indicate whether they are used for CC2540 or CC2541.
For each project and configuration, new IAR projects are included for use with the CC2541. The only
SWRU271G October 2010 Revised September 2015
Submit Documentation Feedback
Copyright 20102015, Texas Instruments Incorporated
General Information
89
www.ti.com
exception is that any project/configuration that uses the USB interface has not been replicated for the
CC2541, as it does not have an on-chip hardware USB interface.
Link-layer processing has been optimized to provide for reduced power consumption during connection
events and advertising events.
SimpleBLEPeripheral and SimpleBLECentral now use the HCI_EXT_ClkDivOnHaltCmd, which reduces
the current level while the CC2540/41 radio is active.
The bond manager has been updated to allow peripheral devices to properly pair, bond, and resolve
the address of central devices that use the private resolvable address type.
New command HCI_EXT_SetMaxDtmTxPowerCmd included, which allows the maximum Tx power
level to be set. This is useful when using Direct Test Mode (DTM), in that the Tx power level will be set
to the maximum value set by the HCI_EXT_SetMaxDtmTxPowerCmd command, which may be less
than +4dBm for the CC2540 and less than 0dBm for the CC2541. The function prototype can be found
in hci.h.
Bug Fixes:
The command HCI_EXT_SetTxPowerCmd is now properly working.
Known Issues:
Use of the NV memory (to save application data or BLE Host bonding information) during a BLE
connection may cause an unexpected disconnect. The likelihood of this happening increases with
frequent usage, especially when using short connection intervals. The cause is related to the NV wear
algorithm which at some point may cause an NV page erase which can disrupt system real-time
processing. It is therefore recommended that the NV memory be used sparingly, or only when a
connection is not active.
Duplicate filtering does not work when scan is used in combination with a connection.
For technical support, visit the Texas Instruments Bluetooth low energy E2E Forum:
http://e2e.ti.com/support/low_power_rf/f/538.aspx
90
General Information
www.ti.com
General Information
91
www.ti.com
The following additional new controller stack features are included in this release:
Support for multiple simultaneous connections as a master (details above)
HCI Vendor Specific function HCI_EXT_SetSCACmd allows you to specify the exact sleep clock
accuracy as any value from 0 to 500 PPM, in order to support any crystal accuracy with optimal
power consumption. This feature is only available for slave / peripheral applications.
HCI Vendor Specific function HCI_EXT_SetMaxDtmTxPowerCmd allows you to set the maximum
transmit output power for Direct Test Mode. This allows you to perform use the LE Transmitter Test
command with power levels less than +4dBm.
A master device can now advertise while in a connection.
New production test mode (PTM) has been added allowing the CC2540 to run Direct Test Mode
(DTM) while connected to a tester using a "single-chip" BLE library.
The controller now uses DMA to more efficiently encrypt and decrypt packets. All BLE projects
must now define HAL_AES_DMA=TRUE in the preprocessor settings when using the v1.1 libraries.
The following additional new host stack features are included in this release:
A new GAP central role profile for single-chip embedded central applications is included, with
functions similar to the GAP peripheral role profile. The SimpleBLECentral project serves as an
example of an application making use of the central role profile.
The GAP peripheral role has been optimized to significantly improve power consumption while
advertising with small amounts of data by no longer transmitting non-significant bytes from in the
advertisement and scan response data.
The following additional new application / profile features are included in this release:
The GAP peripheral bond manager has been replaced with a general GAP bond manager, capable
of managing bond data for both peripheral and central role devices. The gap peripheral bond
manager has been included for legacy support; however it is recommend to switch to the general
GAP bond manager (gapbondmgr.c/h).
The bond manager also now manages the storage of client characteristic configurations for each
bond as per the Bluetooth 4.0 spec.
The simple GATT profile has a new fifth characteristic. This characteristic is 5 bytes long, and has
readable permissions only while in an authenticated connection. It should serve as a reference for
development of other profiles which require an encrypted link.
All GATT profiles have been updated to properly handle client characteristic configurations for both
single and multiple connections. Characteristic configurations now get reset to zero (notifications /
indications off) after a connection is terminated, and the bond manager now stores client
characteristic configurations for bonded devices so that they are remembered for next time when
the device reconnects.
Added linker configuration file for support of 128kB flash versions of the CC2540. An example is
included in the SimpleBLEPeripheral project.
The SimpleBLEPeripheral project "CC2540 Slave" configuration has been updated to better support
the SmartRF05EB + CC2540EM hardware platform, making use of the LCD display.
Bug Fixes:
The following bugs have been fixed in the controller stack:
Scanning now working for master devices with power savings enabled.
RSSI reads no longer require a data packet to update.
Improved stability when using very high slave latency setting
HCI LE direct test modes now working properly.
HCI Read Local Supported Features now returns the proper value.
Use of two advertising channels now works.
When connecting to a device on the whitelist, the correct peer device address is returned to the
host.
The following bugs have been fixed in the host stack:
Pairing no longer fails when either device is using a static, private resolvable, or private non92
General Information
www.ti.com
resolvable address.
The following bugs have been fixed in the profiles and applications:
Reading of RSSI with peripheral role profile now working.
Peripheral role profile now allows all legal whitelist modes.
Can now connect with short connection intervals (such as 7.5 ms), since bond manager now reads
data from NV memory upon initialization rather than immediately after a connection is established.
Pairing still may not be stable when using the bond manager with very short connection intervals
(for reason noted in the following Known Issues section)
Known Issues:
Use of the NV memory (to save application data or BLE Host bonding information) during a BLE
connection may cause an unexpected disconnect. The likelihood of this happening increases with
frequent usage, especially when using short connection intervals. The cause is related to the NV wear
algorithm which at some point may cause an NV page erase which can disrupt system real-time
processing. It is therefore recommended that the NV memory be used sparingly, or only when a
connection is not active.
Duplicate filtering does not work when scan is used in combination with a connection.
For technical support, visit the Texas Instruments Bluetooth low energy E2E Forum:
http://e2e.ti.com/support/low_power_rf/f/538.aspx
------------------------------------------------------------------------------------------------------------------------------------------------------------Version 1.0 October 7, 2010
Notices:
The Texas Instruments Bluetooth low energy (BLE) software development kit includes all necessary
software to get started on the development of single-mode BLE applications using the CC2540 systemon-chip. It includes object code with the BLE protocol stack, a sample project and applications with
source code, and BTool, a Windows PC application for testing BLE applications. In addition to the
software, the kit contains documentation, including a developers guide and BLE API guide.
For complete information on the BLE software development kit, please read the developer's guide:
BLE Software Developer's Guide: <Install
Directory>\Documents\TI_BLE_Software_Developer's_Guide.pdf, (Also can be accessed through
the Windows Start Menu)
The following additional documentation is included:
BLE API Guide:<Install Directory>\Documents\BLE_API_Guide_main.htm
Vendor Specific HCI Guide:<Install Directory>\Documents\TI_BLE_Vendor_Specific_HCI_Guide.pdf
HAL Drive API Guide:<Install Directory>\Documents\hal\HAL Driver API.pdf
OSAL API Guide:<Install Directory>\Documents\osal\OSAL API.pdf
The following software projects are included, all built using IAR Embedded Workbench v7.51A:
SimpleBLEPeripheral:<Install Directory>\Projects\ble\SimpleBLEPeripheral\CC2540DB
\SimpleBLEPeripheral.eww
HostTestRelease:<Install Directory>\Projects\ble\HostTestApp\CC2540\HostTestRelease.eww
The following Windows PC application is included:
BTool:<Install Directory>\Projects\BTool\BTool.exe (Also can be accessed through the Windows
Start Menu)
Changes:
Initial Release
Bug Fixes:
Initial Release
Known Issues:
SWRU271G October 2010 Revised September 2015
Submit Documentation Feedback
Copyright 20102015, Texas Instruments Incorporated
General Information
93
Document History
www.ti.com
Use of the NV memory (to save application data or BLE Host bonding information) during a BLE
connection may cause an unexpected disconnect. The likelihood of this happening increases with
frequent usage, especially when using short connection intervals. The cause is related to the NV wear
algorithm which at some point may cause an NV page erase which can disrupt system real-time
processing. It is therefore recommended that the NV memory be used sparingly, or only when a
connection is not active.
-------------------------------------------------------------------------------------------------------------------------------------------------------------
9.2
94
Document History
Revision
Date
Description/Changes
10/7/2010
Initial release
1.1
7/13/2011
1.1b
11/15/2011
1.2
2/13/2012
1.3.1
4/13/2012
1.3
12/19/2012
1.3.1
4/5/2013
1.3.2
6/12/2013
1.4.0
9/12/2013
1.4.1
5/15/2015
General Information
Appendix A
SWRU271G October 2010 Revised September 2015
GAP API
A.1
Commands
This section details the GAP commands from gap.h which the application uses. Other GAP commands
are abstracted through the GAPRole or the GAPBondMgr.
Returns
SUCCESS
INVALIDPARAMETER: paramID is invalid
A.2
Configurable Parameters
ParamID
Description
TGAP_GEN_DISC_ADV_MIN
TGAP_LIM_ADV_TIMEOUT
TGAP_GEN_DISC_SCAN
TGAP_LIM_DISC_SCAN
TGAP_CONN_EST_ADV_TIMEOUT
TGAP_CONN_PARAM_TIMEOUT
TGAP_LIM_DISC_ADV_INT_MIN
TGAP_LIM_DISC_ADV_INT_MAX
TGAP_GEN_DISC_ADV_INT_MIN
TGAP_GEN_DISC_ADV_INT_MAX
TGAP_CONN_ADV_INT_MIN
GAP API
95
Configurable Parameters
96
www.ti.com
ParamID
Description
TGAP_CONN_ADV_INT_MAX
TGAP_CONN_SCAN_INT
TGAP_CONN_SCAN_WIND
TGAP_CONN_HIGH_SCAN_INT
TGAP_CONN_HIGH_SCAN_WIND
TGAP_GEN_DISC_SCAN_INT
TGAP_GEN_DISC_SCAN_WIND
TGAP_LIM_DISC_SCAN_INT
TGAP_LIM_DISC_SCAN_WIND
TGAP_CONN_EST_INT_MIN
TGAP_CONN_EST_INT_MAX
TGAP_CONN_EST_SCAN_INT
TGAP_CONN_EST_SCAN_WIND
TGAP_CONN_EST_SUPERV_TIMEOUT
TGAP_CONN_EST_LATENCY
TGAP_CONN_EST_MIN_CE_LEN
TGAP_CONN_EST_MAX_CE_LEN
TGAP_PRIVATE_ADDR_INT
TGAP_CONN_PAUSE_CENTRAL
TGAP_CONN_PAUSE_PERIPHERAL
TGAP_SM_TIMEOUT
TGAP_SM_MIN_KEY_LEN
TGAP_SM_MAX_KEY_LEN
TGAP_FILTER_ADV_REPORTS
TGAP_SCAN_RSP_RSSI_MIN
GAP API
Configurable Parameters
www.ti.com
ParamID
Description
TGAP_REJECT_CONN_PARAMS
GAP API
97
Events
A.3
www.ti.com
Events
This section details the events relating to the GAP layer that can return to the application from the BLE
stack. Some of these events pass directly to the application and some are handled by the GAPRole or
GAPBondMgr layers. Whether they are handled by the GAPRole or GAPBondmgr layers, they pass as a
GAP_MSG_EVENT with a header:
The following is a list of the possible headers and the associated events. See gap.h for other definitions in
these events.
GAP_DEVICE_INIT_DONE_EVENT: Sent when the Device Initialization completes.
98
GAP API
Events
www.ti.com
GAP API
99
Events
100
www.ti.com
GAP_DEVICE_INFO_EVENT: Sent during the Device Discovery Process when a device is discovered.
GAP API
Events
www.ti.com
GAP API
101
Appendix B
SWRU271G October 2010 Revised September 2015
Commands
Returns
SUCCESS
INVALIDPARAMETER: param was not valid.
bleInvalidRange: len is not valid for the given param.
blePending: previous param update has not been completed
bleIncorrectMode: cannot start connectable advertising because nonconnectable
advertising is enabled
Returns
SUCCESS
INVALIDPARAMETER: param was not valid
SUCCESS
bleAlreadyInRequestedMode: device was already initialized
bStatus_t GAPRole_TerminateConnection(void)
Terminates an existing connection.
Returns
102
Commands
www.ti.com
Returns
103
Configurable Parameters
B.2
www.ti.com
Configurable Parameters
ParamID
R/W
Size
Description
GAPROLE_PROFILEROLE
uint8
GAPROLE_IRK
R/W
uint8[16]
GAPROLE_SRK
R/W
uint8[16]
GAPROLE_SIGNCOUNTER
R/W
uint32
Sign counter
GAPROLE_BD_ADDR
uint8[6]
GAPROLE_ADVERT_ENABLED
R/W
uint8
GAPROLE_ADVERT_OFF_TIME
R/W
uint16
GAPROLE_ADVERT_DATA
R/W
<uint8[32]
GAPROLE_SCAN_RSP_DATA
R/W
<uint8[32]
GAPROLE_ADV_EVENT_TYPE
R/W
uint8
GAPROLE_ADV_DIRECT_TYPE
R/W
uint8
GAPROLE_ADV_DIRECT_ADDR
R/W
uint8[6]
GAPROLE_ADV_CHANNEL_MAP
R/W
uint8
GAPROLE_ADV_FILTER_POLICY
R/W
uint8
GAPROLE_CONNHANDLE
uint16
GAPROLE_RSSI_READ_RATE
R/W
uint16
GAPROLE_PARAM_UPDATE_ENABLE
R/W
uint8
GAPROLE_MIN_CONN_INTERVAL
R/W
uint16
GAPROLE_MAX_CONN_INTERVAL
R/W
uint16
GAPROLE_SLAVE_LATENCY
R/W
uint16
Callbacks
www.ti.com
B.3
ParamID
R/W
Size
Description
GAPROLE_TIMEOUT_MULTIPLIER
R/W
uint16
GAPROLE_CONN_BD_ADDR
uint8[6]
GAPROLE_CONN_INTERVAL
uint16
GAPROLE_CONN_LATENCY
uint16
GAPROLE_CONN_TIMEOUT
uint16
GAPROLE_PARAM_UPDATE_REQ
uint8
GAPROLE_STATE
uint8
Callbacks
These callbacks are functions whose pointers are passed from the application to the GAPRole so the
GAPRole can return events to the application. They are passed as the following:
105
Callbacks
www.ti.com
This function passes a signed 1-byte value (newRSSI) of the last reported RSSI to the application.
106
Appendix C
SWRU271G October 2010 Revised September 2015
Commands
Returns
SUCCESS
bleAlreadyInRequestedMode: Device already started.
Returns
SUCCESS
INVALIDPARAMETER: param was not valid
bleInvalidRange: len is invalid for the given param
Returns
SUCCESS
INVALIDPARAMETER: param was not valid
107
Commands
www.ti.com
Returns
Returns
108
Commands
www.ti.com
Returns
Returns
109
Commands
www.ti.com
bStatus_t GAPCentralRole_CancelDiscovery(void)
Cancel a device discovery scan.
Parameters
None
Returns
Returns
Returns
SUCCESS
bleIncorrectMode: No active link.
110
Configurable Parameters
www.ti.com
C.2
C.3
Configurable Parameters
ParamID
R/W
Size
Description
GAPCENTRALROLE_IRK
R/W
uint8[16]
GAPCENTRALROLE_SRK
R/W
uint8[16]
GAPCENTRALROLE_SIGNCO R/W
UNTER
uint32
Sign counter.
GAPCENTRALROLE_BD_AD
DR
uint8[6]
GAPCENTRALROLE_MAX_S
CAN_RES
R/W
uint8
Callbacks
These callbacks are functions whose pointers are passed from the application to the GAPRole so that the
GAPRole can return events to the application. They are passed as the following:
This function passes a signed one byte value (newRSSI) of the last reported RSSI to the application for a
given connection handle (connHandle).
111
Callbacks
www.ti.com
NOTE: TRUE should be returned from this function if the GAPRole is to deallocate the event
message. FALSE should be returned if the application deallocates. By default, TRUE is
always returned. If the event message is to be processed by the application at a later time
(not just in the callback context), FALSE should be returned
The possible GAPRole central states are in the following list. See Section A.3 for more information on
these events:
GAP_DEVICE_INIT_DONE_EVENT
GAP_DEVICE_DISCOVERY_EVENT
GAP_LINK_ESTABLISHED_EVENT
GAP_LINK_TERMINATED_EVENT
GAP_LINK_PARAM_UPDATE_EVENT
GAP_DEVICE_INFO_EVENT
112
Appendix D
SWRU271G October 2010 Revised September 2015
GATT/ATT API
This section describes the API of the GATT and ATT layers. The sections are combined because the
procedure is to send GATT commands and receive ATT events in Section 5.4.3.1. The return values for
the commands in this section are in Section D.3. The possible return values are similar for these
commands so refer to Section D.3.
D.1
Server Commands
Corresponding Events
If the return status is SUCCESS, the calling application task will receive a
GATT_MSG_EVENT message with type ATT_HANDLE_VALUE_CFM upon an
acknowledgment. It is only at this point that this subprocedure is considered complete.
Corresponding Events
If the return status is SUCCESS, the notification has been successfully queued for
transmission.
GATT/ATT API
113
Client Commands
D.2
www.ti.com
Client Commands
bStatus_t GATT_InitClient(void)
Initialize the GATT client in the BLE Stack.
GATT clients should call this from the application initialization function.
Notes
Notes
GATT clients should call this from the application initialization function.
Corresponding Events
If the return status is SUCCESS, the calling application task receives multiple
GATT_MSG_EVENT messages with type ATT_READ_BY_GRP_TYPE_RSP or
ATT_ERROR_RSP (if an error occurred on the server). This sub-procedure is complete
when either ATT_READ_BY_GRP_TYPE_RSP (with bleProcedureComplete or
bleTimeout status) or the calling application task receives the ATT_ERROR_RSP (with
SUCCESS status).
Corresponding Events
114
GATT/ATT API
If the return status is SUCCESS, the calling application task receives multiple
GATT_MSG_EVENT messages with type ATT_FIND_BY_TYPE_VALUE_RSP or
ATT_ERROR_RSP (if an error occurred on the server). This sub-procedure is complete
when either ATT_FIND_BY_TYPE_VALUE_RSP (with bleProcedureComplete or
bleTimeout status) or the calling application task receives the ATT_ERROR_RSP (with
SUCCESS status).
Client Commands
www.ti.com
Corresponding Events
If the return status is SUCCESS, the calling application task receives multiple
GATT_MSG_EVENT messages with type ATT_READ_BY_TYPE_RSP or
ATT_ERROR_RSP (if an error occurred on the server). This subprocedure is complete
when either ATT_READ_BY_TYPE_RSP (with bleProcedureComplete or bleTimeout
status) or ATT_ERROR_RSP (with SUCCESS status) is received by the calling
application task. If the return status is SUCCESS, the calling application task receives
multiple GATT_MSG_EVENT messages with type ATT_FIND_BY_TYPE_VALUE_RSP
or ATT_ERROR_RSP (if an error occurred on the server). This sub-procedure is
complete when either ATT_FIND_BY_TYPE_VALUE_RSP (with bleProcedureComplete
or bleTimeout status) or the calling application task recieves the ATT_ERROR_RSP
(with SUCCESS status).
Returns
SUCCESS
INVALIDPARAMETER: param was not valid
Corresponding Events
If the return status is SUCCESS, the calling application task receives multiple
GATT_MSG_EVENT messages with type ATT_READ_BY_TYPE_RSP or
ATT_ERROR_RSP (if an error occurred on the server). This sub-procedure is complete
when either ATT_READ_BY_TYPE_RSP (with bleProcedureComplete or bleTimeout
status) or the calling application task receives the ATT_ERROR_RSP (with SUCCESS
status).
GATT/ATT API
115
Client Commands
www.ti.com
Corresponding Events
If the return status is SUCCESS, the calling application task receives multiple
GATT_MSG_EVENT messages with type ATT_READ_BY_TYPE_RSP or
ATT_ERROR_RSP (if an error occurred on the server). This sub-procedure is complete
when either ATT_READ_BY_TYPE_RSP (with bleProcedureComplete or bleTimeout
status) orthe calling application task recieves the ATT_ERROR_RSP (with SUCCESS
status).
Notes
Notes
116
GATT/ATT API
Client Commands
www.ti.com
Notes
If the return status is SUCCESS, the calling application task receives an OSAL
GATT_MSG_EVENT message with type ATT_READ_BY_TYPE_RSP or
ATT_ERROR_RSP (if an error occurred on the server). This sub-procedure is complete
when either ATT_READ_BY_TYPE_RSP (with SUCCESS or bleTimeout status) or the
calling application task receives the ATT_ERROR_RSP (with SUCCESS status).
Notes
If the return status is SUCCESS, the calling application task receives multiple
GATT_MSG_EVENT messages with type ATT_READ_BLOB_RSP or
ATT_ERROR_RSP (if an error occurred on the server). This sub-procedure is complete
when either ATT_READ_BLOB_RSP (with bleProcedureComplete or bleTimeout status)
or the calling application task receives the ATT_ERROR_RSP (with SUCCESS status).
Notes
If the return status from this function is SUCCESS, the calling application task receives
an OSAL GATT_MSG_EVENT message with type ATT_READ_MULTI_RSP or
ATT_ERROR_RSP (if an error occurred on the server). This sub-procedure is complete
when either ATT_READ_MULTI_RSP (with SUCCESS or bleTimeout status) or the
calling application task receives the ATT_ERROR_RSP (with SUCCESS status).
GATT/ATT API
117
Client Commands
www.ti.com
No response will be sent to the calling application task for this sub-procedure. If the
Characteristic Value write request is the wrong size or has an invalid value as defined by
the profile, the write fails and the server generates no error.
Notes
Notes
Notes
Notes
118
GATT/ATT API
Client Commands
www.ti.com
Notes
If the return status from this function is SUCCESS, the calling application task receives
an OSAL GATT_MSG_EVENT message with type ATT_READ_RSP or
ATT_ERROR_RSP (if an error occurred on the server). This sub-procedure is complete
when either ATT_READ_RSP (with SUCCESS or bleTimeout status) or the calling
application task receives the ATT_ERROR_RSP (with SUCCESS status).
Notes
If the return status from this function is SUCCESS, the calling application task receives
an OSAL GATT_MSG_EVENT message with type ATT_READ_RSP or
ATT_ERROR_RSP (if an error occurred on the server). This sub-procedure is complete
when either ATT_READ_RSP (with SUCCESS or bleTimeout status) or the calling
application task receives the ATT_ERROR_RSP (with SUCCESS status).
GATT/ATT API
119
Return Values
www.ti.com
Notes
D.3
Return Values
120
SUCCESS (0x00): Command was executed as expected. See the command API for corresponding
events to expect.
INVALIDPARAMETER (0x02): Invalid connection handle or request field
ATT_ERR_INSUFFICIENT_AUTHEN (0x05): The attribute requires authentication
ATT_ERR_INSUFFICIENT_KEY_SIZE (0x0C): The key size for encrypting is insufficient
ATT_ERR_INSUFFICIENT_ENCRYPT (0x0F): The attribute requires encryption
MSG_BUFFER_NOT_AVAIL (0x04): An HCI buffer is unavailable. Retry later.
bleNotConnected (0x14): The device is unconnected.
blePending (0x17):
When returned to a client function, a response is pending with the server or the GATT subprocedure is in progress.
When returned to server function, confirmation from a client is pending.
bleTimeout (0x16): The previous transaction timed out. No ATT or GATT messages can send until
reconnected.
bleMemAllocError (0x13): A memory allocation error occurred
bleLinkEncrypted (0x19): The link is encrypted. Do not send an attribute PDU includes an
authentication signature on an encrypted link
GATT/ATT API
Events
www.ti.com
D.4
Events
Events are received from the BLE stack in the application as a GATT_MSG_EVENT stack message sent
as an OSAL message. The events are received as the following structure, where the method signifies the
ATT event and the message is a union of the ATT events:
This section lists the ATT events by their method and display their structure that is used in the message
payload. These events are in the att.h file.
ATT_ERROR_RSP (0x01)
ATT_FIND_INFO_RSP (0x03)
ATT_FIND_BY_TYPE_VALUE_RSP (0x07)
ATT_READ_BY_TYPE_RSP (0x09)
ATT_READ_RSP (0x0B)
ATT_READ_BLOB_RSP (0x0D)
GATT/ATT API
121
Events
122
www.ti.com
ATT_READ_MULTI_RSP (0x0F)
ATT_READ_BY_GRP_TYPE_RSP (0x11)
ATT_WRITE_RSP (0x13)
ATT_PREPARE_WRITE_RSP (0x17)
ATT_EXECUTE_WRITE_RSP (0x19)
ATT_HANDLE_VALUE_NOTI (0x1B)
ATT_HANDLE_VALUE_IND (0x1D)
ATT_HANDLE_VALUE_CFM (0x1E)
Empty msg field
GATT/ATT API
www.ti.com
D.5
D.6
ATT_EXCHANGE_MTU_RSP
GATT_ExchangeMTU
ATT_FIND_INFO_RSP
GATT_DiscAllCharDescs,
GATT_DiscAllCharDescs
ATT_FIND_BY_TYPE_VALUE_RSP
GATT_DiscPrimaryServiceByUUID
ATT_READ_BY_TYPE_RSP
GATT_PrepareWriteReq,
GATT_ExecuteWriteReq,
GATT_FindIncludedServices,
GATT_DiscAllChars,
GATT_DiscCharsByUUID,
GATT_ReadUsingCharUUID,
ATT_READ_RSP
GATT_ReadCharValue,
GATT_ReadCharDesc
ATT_READ_BLOB_RSP
GATT_ReadLongCharValue,
GATT_ReadLongCharDesc
ATT_READ_MULTI_RSP
GATT_ReadMultiCharValues
ATT_READ_BY_GRP_TYPE_RSP
GATT_DiscAllPrimaryServices
ATT_WRITE_RSP
GATT_WriteCharValue,
GATT_WriteCharDesc
ATT_PREPARE_WRITE_RSP
GATT_WriteLongCharValue,
GATT_ReliableWrites,
GATT_WriteLongCharDesc
ATT_EXECUTE_WRITE_RSP
GATT_WriteLongCharValue,
GATT_ReliableWrites,
GATT_WriteLongCharDesc
GATT/ATT API
123
124
www.ti.com
GATT/ATT API
Appendix E
SWRU271G October 2010 Revised September 2015
GATTServApp API
This section details the API of the GATTServApp in gattservapp_util.c.
NOTE: These API are only the public commands that should be called by the profile and/or
application.
E.1
Commands
Returns
GATTServApp API
125
Commands
www.ti.com
Returns
Returns
126
GATTServApp API
Appendix F
SWRU271G October 2010 Revised September 2015
GAPBondMgr API
This section details the API of the GAPBondMgr in gapbondmgr.c.
NOTE: Many commands do not need to be called from the application because they are called by
the GAPRole or the BLE Stack.
F.1
Commands
GAPBondMgr API
127
Commands
www.ti.com
Returns
Returns
Returns
128
GAPBondMgr API
Commands
www.ti.com
Returns
Returns
id NV ID
len lengths in bytes of item.
Returns
GAPBondMgr API
129
Configurable Parameters
F.2
130
www.ti.com
Configurable Parameters
ParamID
R/W
Size
Description
GAPBOND_PAIRING_MODE
R/W
uint8
Default is
GAPBOND_PAIRING_MODE_WAIT_FOR_
REQ
GAPBOND_INITIATE_WAIT
R/W
uint16
GAPBOND_MITM_PROTECTION
R/W
uint8
GAPBOND_IO_CAPABILITIES
R/W
uint8
Default is
GAPBOND_IO_CAP_DISPLAY_ONLY
GAPBOND_OOB_ENABLED
R/W
uint8
GAPBOND_OOB_DATA
R/W
uint8[16]
GAPBOND_BONDING_ENABLED
R/W
uint8
GAPBOND_KEY_DIST_LIST
uint8
GAPBOND_DEFAULT_PASSCODE
uint32
GAPBOND_ERASE_ALLBONDS
None
GAPBOND_KEYSIZE
R/W
uint8
GAPBOND_AUTO_SYNC_WL
R/W
uint8
GAPBOND_BOND_COUNT
uint8
GAPBOND_BOND_FAIL_ACTION
uint8
GAPBOND_ERASE_SINGLEBOND
uint8[9]
GAPBondMgr API
Callbacks
www.ti.com
F.3
Callbacks
These callbacks are functions whose pointers are passed from the application to the GAPBondMgr so it
can return events to the application. The callbacks are passed as the following structure:
Based on the parameters passed to this callback like the pairing interface inputs and outputs, the
application displays the passcode or initiates the entrance of a passcode.
GAPBondMgr API
131
Callbacks
www.ti.com
132
GAPBondMgr API
Appendix G
SWRU271G October 2010 Revised September 2015
G.1
Commands
Returns
2. Configure the BLE protocol stack to return the event (in simpleBLEPeripheral_init())
133
Commands
www.ti.com
Returns (only when mode == HCI_EXT_SET_USER_REVISION) SUCCESS: build revision set succesfully
HCI_VendorSpecifcCommandCompleteEvent
A slave with one connection is supported (this API only works when the
device is configured as a slave and connected to one master). Send this
command after establishing a connection.
This command fails to return any events but has a meaningful return
status.
Parameters
Returns
SUCCESS or FAILURE
LL_STATUS_ERROR_BAD_PARAMETER: more than one bit is set.
2. Configure the BLE protocol stack to return the event (in SimpleBLEPeripheral
134
Commands
www.ti.com
135
Commands
www.ti.com
mode one of
HCI_EXT_NV_NOT_IN_USE
HCI_EXT_NV_IN_USE
mode one of
HCI_EXT_NV_NOT_IN_USE
HCI_EXT_NV_IN_USE
136
Commands
www.ti.com
HCI_VendorSpecifcCommandCompleteEvent
137
Commands
www.ti.com
HCI_VendorSpecifcCommandCompleteEvent
HCI_Disconnection_Complete
HCI_VendorSpecifcCommandCompleteEvent
138
Commands
www.ti.com
Parameters
139
Commands
www.ti.com
mode one of
HCI_EXT_HALT_DURING_RF_DISABLE
HCI_EXT_HALT_DURING_RF_ENABLE
140
Commands
www.ti.com
141
Commands
www.ti.com
HCI_VendorSpecifcCommandCompleteEvent
Corresponding Events
HCI_VendorSpecifcCommandCompleteEvent
142
Commands
www.ti.com
Corresponding Events
HCI_VendorSpecifcCommandCompleteEvent
143
Commands
www.ti.com
control HCI_EXT_DISABLE_ONE_PKT_PER_EVT,
HCI_EXT_ENABLE_ONE_PKT_PER_EVT
Corresponding Events
Corresponding Events
Corresponding Events
144
HCI_VendorSpecifcCommandCompleteEvent
Commands
www.ti.com
Note
NOTE:
Parameters
Corresponding Events
HCI_VendorSpecifcCommandCompleteEvent
mode HCI_EXT_RESET_SYSTEM_HARD
Corresponding Events
HCI_VendorSpecifcCommandCompleteEvent
HCI_VendorSpecifcCommandCompleteEvent
145
Commands
www.ti.com
bdAddr A pointer to a buffer to hold this address of the device. An invalid address (that
is, all FFs) restores the address of this device to the address set at initialization.
Corresponding Events
HCI_VendorSpecifcCommandCompleteEvent
control HCI_EXT_ENABLE_FAST_TX_RESP_TIME,
HCI_EXT_DISABLE_FAST_TX_RESP_TIME
Corresponding Events
HCI_VendorSpecifcCommandCompleteEvent
146
Commands
www.ti.com
Corresponding Events
HCI_VendorSpecifcCommandCompleteEvent
localFeatures A pointer to the feature set where each bit where each bit corresponds
to a feature 0: feature shall not be used
0: Feature shall not be used
1: Feature can be used
Corresponding Events
HCI_VendorSpecifcCommandCompleteEvent
147
Commands
www.ti.com
Parameters
Corresponding Events
HCI_VendorSpecifcCommandCompleteEvent
148
Commands
www.ti.com
Corresponding Events
HCI_VendorSpecifcCommandCompleteEvent
Corresponding Events
HCI_VendorSpecifcCommandCompleteEvent
Corresponding Events
HCI_VendorSpecifcCommandCompleteEvent
149
Commands
www.ti.com
150
HCI_EXT_TX_POWER_MINUS_21_DBM
HCI_EXT_TX_POWER_MINUS_18_DBM
HCI_EXT_TX_POWER_MINUS_15_DBM
HCI_EXT_TX_POWER_MINUS_12_DBM
HCI_EXT_TX_POWER_MINUS_9_DBM
HCI_EXT_TX_POWER_MINUS_6_DBM
HCI_EXT_TX_POWER_MINUS_3_DBM
HCI_EXT_TX_POWER_0_DBM
HCI_EXT_TX_POWER_1_DBM
HCI_EXT_TX_POWER_2_DBM
HCI_EXT_TX_POWER_3_DBM
HCI_EXT_TX_POWER_4_DBM
HCI_EXT_TX_POWER_5_DBM
www.ti.com
G.2
Parameter Description
0x00
SUCCESS
0x01
FAILURE
0x02
INVALIDPARAMETER
0x03
INVALID_TASK
0x04
MSG_BUFFER_NOT_AVAIL
0x05
INVALID_MSG_POINTER
0x06
INVALID_EVENT_ID
0x07
INVALID_INTERRUPT_ID
0x08
NO_TIMER_AVAIL
0x09
NV_ITEM_UNINIT
0x0A
NV_OPER_FAILED
0x0B
INVALID_MEM_SIZE
0x0C
NV_BAD_ITEM_LEN
0x10
bleNotReady
0x11
bleAlreadyInRequestedMode
0x12
bleIncorrectMode
0x13
bleMemAllocError
0x14
bleNotConnected
0x15
bleNoResources
0x16
blePending
0x17
bleTimeout
0x18
bleInvalidRange
0x19
bleLinkEncrypted
0x1A
bleProcedureComplete
0x30
bleGAPUserCanceled
0x31
bleGAPConnNotAcceptable
0x32
bleGAPBondRejected
0x40
bleInvalidPDU
0x41
bleInsufficientAuthen
0x42
bleInsufficientEncrypt
0x43
bleInsufficientKeySize
0xFF
INVALID_TASK_ID
151
152
www.ti.com
Revision History
www.ti.com
Revision History
Changes from F Revision (July 2013) to G Revision ...................................................................................................... Page
NOTE: Page numbers for previous revisions may differ from page numbers in the current version.
Revision History
153
IMPORTANT NOTICE
Texas Instruments Incorporated and its subsidiaries (TI) reserve the right to make corrections, enhancements, improvements and other
changes to its semiconductor products and services per JESD46, latest issue, and to discontinue any product or service per JESD48, latest
issue. Buyers should obtain the latest relevant information before placing orders and should verify that such information is current and
complete. All semiconductor products (also referred to herein as components) are sold subject to TIs terms and conditions of sale
supplied at the time of order acknowledgment.
TI warrants performance of its components to the specifications applicable at the time of sale, in accordance with the warranty in TIs terms
and conditions of sale of semiconductor products. Testing and other quality control techniques are used to the extent TI deems necessary
to support this warranty. Except where mandated by applicable law, testing of all parameters of each component is not necessarily
performed.
TI assumes no liability for applications assistance or the design of Buyers products. Buyers are responsible for their products and
applications using TI components. To minimize the risks associated with Buyers products and applications, Buyers should provide
adequate design and operating safeguards.
TI does not warrant or represent that any license, either express or implied, is granted under any patent right, copyright, mask work right, or
other intellectual property right relating to any combination, machine, or process in which TI components or services are used. Information
published by TI regarding third-party products or services does not constitute a license to use such products or services or a warranty or
endorsement thereof. Use of such information may require a license from a third party under the patents or other intellectual property of the
third party, or a license from TI under the patents or other intellectual property of TI.
Reproduction of significant portions of TI information in TI data books or data sheets is permissible only if reproduction is without alteration
and is accompanied by all associated warranties, conditions, limitations, and notices. TI is not responsible or liable for such altered
documentation. Information of third parties may be subject to additional restrictions.
Resale of TI components or services with statements different from or beyond the parameters stated by TI for that component or service
voids all express and any implied warranties for the associated TI component or service and is an unfair and deceptive business practice.
TI is not responsible or liable for any such statements.
Buyer acknowledges and agrees that it is solely responsible for compliance with all legal, regulatory and safety-related requirements
concerning its products, and any use of TI components in its applications, notwithstanding any applications-related information or support
that may be provided by TI. Buyer represents and agrees that it has all the necessary expertise to create and implement safeguards which
anticipate dangerous consequences of failures, monitor failures and their consequences, lessen the likelihood of failures that might cause
harm and take appropriate remedial actions. Buyer will fully indemnify TI and its representatives against any damages arising out of the use
of any TI components in safety-critical applications.
In some cases, TI components may be promoted specifically to facilitate safety-related applications. With such components, TIs goal is to
help enable customers to design and create their own end-product solutions that meet applicable functional safety standards and
requirements. Nonetheless, such components are subject to these terms.
No TI components are authorized for use in FDA Class III (or similar life-critical medical equipment) unless authorized officers of the parties
have executed a special agreement specifically governing such use.
Only those TI components which TI has specifically designated as military grade or enhanced plastic are designed and intended for use in
military/aerospace applications or environments. Buyer acknowledges and agrees that any military or aerospace use of TI components
which have not been so designated is solely at the Buyer's risk, and that Buyer is solely responsible for compliance with all legal and
regulatory requirements in connection with such use.
TI has specifically designated certain components as meeting ISO/TS16949 requirements, mainly for automotive use. In any case of use of
non-designated products, TI will not be responsible for any failure to meet ISO/TS16949.
Products
Applications
Audio
www.ti.com/audio
www.ti.com/automotive
Amplifiers
amplifier.ti.com
www.ti.com/communications
Data Converters
dataconverter.ti.com
www.ti.com/computers
DLP Products
www.dlp.com
Consumer Electronics
www.ti.com/consumer-apps
DSP
dsp.ti.com
www.ti.com/energy
www.ti.com/clocks
Industrial
www.ti.com/industrial
Interface
interface.ti.com
Medical
www.ti.com/medical
Logic
logic.ti.com
Security
www.ti.com/security
Power Mgmt
power.ti.com
www.ti.com/space-avionics-defense
Microcontrollers
microcontroller.ti.com
www.ti.com/video
RFID
www.ti-rfid.com
www.ti.com/omap
TI E2E Community
e2e.ti.com
Wireless Connectivity
www.ti.com/wirelessconnectivity
Mailing Address: Texas Instruments, Post Office Box 655303, Dallas, Texas 75265
Copyright 2015, Texas Instruments Incorporated