Texas Instruments CC2540 Software Developers Manual

Texas Instruments CC2540 Software Developers Manual

Bluetooth low energy
Hide thumbs Also See for CC2540:
Table of Contents

Advertisement

Quick Links

CC2540 and CC2541 Bluetooth
Low Energy
®
Software Developers Guide
Literature Number: SWRU271H
October 2010 – Revised April 2019

Advertisement

Table of Contents
loading

Summary of Contents for Texas Instruments CC2540

  • Page 1 CC2540 and CC2541 Bluetooth Low Energy ® Software Developers Guide Literature Number: SWRU271H October 2010 – Revised April 2019...
  • Page 2: Table Of Contents

    ..................Generic Attribute Profile (GATT) ................5.5.1 GATT Characteristics and Attributes ..................5.5.2 GATT Services and Profile ..................5.5.3 GATT Client Abstraction Contents SWRU271H – October 2010 – Revised April 2019 Submit Documentation Feedback Copyright © 2010–2019, Texas Instruments Incorporated...
  • Page 3 Porting BLEv1.4.0 Projects to BLEv1.4.1 ..............9.3.3 Porting BLEv1.3.2 Projects to BLEv1.4.0 ................9.3.4 Porting BLEv1.2 Projects to BLEv1.3 ..............9.3.5 Porting From CC2540 to CC2541 Project ..................... Release Notes History ......................Document History .......................... GAP API ........................ Commands SWRU271H – October 2010 – Revised April 2019...
  • Page 4 F.4.1 Passcode Callback (passcodeCB) ................. F.4.2 Pairing State Callback (pairStateCB) ......................HCI Extension API ........................Overview ........................ Commands ......................Host Error Codes ........................Revision History Contents SWRU271H – October 2010 – Revised April 2019 Submit Documentation Feedback Copyright © 2010–2019, Texas Instruments Incorporated...
  • Page 5 9-4. Stack Build Configuration ................9-5. BLE Library: Exclude From Custom Build ..................9-6. BLE Library: Add To LIB Group SWRU271H – October 2010 – Revised April 2019 List of Figures Submit Documentation Feedback Copyright © 2010–2019, Texas Instruments Incorporated...
  • Page 6 List of Tables ..................5-1. GAP Bond Manager Security Terms ................5-2. Supported BLE-Stack Library Configurations ......................G-1. Host Error Codes List of Tables SWRU271H – October 2010 – Revised April 2019 Submit Documentation Feedback Copyright © 2010–2019, Texas Instruments Incorporated...
  • Page 7: Preface

    SWRU271H – October 2010 – Revised April 2019 Preface The purpose of this document is to give an overview of the TI CC2540 and CC2541 Bluetooth Low Energy software development kit. This document also introduces the Bluetooth Low Energy standard, but should not be used as a substitute for the complete specification.
  • Page 8: Overview

    NOTE: The TI BLE-Stack v1.5.x is qualified to Bluetooth 5.0 using the same core specification features as defined by Bluetooth 4.0 and implemented in previous BLE-Stack v1.4.x releases. References to Bluetooth 4.0 in this and related CC2540/CC2541 documentation using the v1.5.x release refer to functionality only. For an overview of TI devices that implement features defined by newer Bluetooth specifications, see www.ti.com/ble.
  • Page 9: Bluetooth Low Energy Protocol Stack Basics

    The link layer (LL) controls the RF state of the device. The device has five possible states: • Standby • Advertising • Scanning • Initiating • Connected SWRU271H – October 2010 – Revised April 2019 Overview Submit Documentation Feedback Copyright © 2010–2019, Texas Instruments Incorporated...
  • Page 10 Bluetooth Low Energy connection. The application and profiles use GATT directly. For more information on the ATT and GATT layers, see Section 5.5. Overview SWRU271H – October 2010 – Revised April 2019 Submit Documentation Feedback Copyright © 2010–2019, Texas Instruments Incorporated...
  • Page 11: The Ti Bluetooth Low Energy Software Development Platform

    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.
  • Page 12: Single-Device Configuration

    Configurations www.ti.com Figure 2-1. Single-Device Configuration The TI Bluetooth Low Energy Software Development Platform SWRU271H – October 2010 – Revised April 2019 Submit Documentation Feedback Copyright © 2010–2019, Texas Instruments Incorporated...
  • Page 13: Network Processor Configuration

    • 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.
  • Page 14: Projects

    The HostTestRelease project is used to build the Bluetooth Low Energy network processor software for the CC2540/41. This project contains configurations for both master and slave roles. The Bluetooth Low Energy development kit includes other sample projects. These projects implement various profiles and demonstration applications.
  • Page 15: The Operating System Abstraction Layer (Osal)

    For more information on the OSAL functions, see the OSAL API Guide. SWRU271H – October 2010 – Revised April 2019 The Operating System Abstraction Layer (OSAL) Submit Documentation Feedback Copyright © 2010–2019, Texas Instruments Incorporated...
  • Page 16: Task Initialization

    ID is greater than the other task ID values. OSAL and HAL components are provided in source form. The Operating System Abstraction Layer (OSAL) SWRU271H – October 2010 – Revised April 2019 Submit Documentation Feedback Copyright © 2010–2019, Texas Instruments Incorporated...
  • Page 17: Task Events And Event Processing

    IDs in the osalInitTasks() function. Maintaining this task order is required for the correct software layer to process events. SWRU271H – October 2010 – Revised April 2019 The Operating System Abstraction Layer (OSAL) Submit Documentation Feedback Copyright © 2010–2019, Texas Instruments Incorporated...
  • Page 18: Heap Manager

    Because the Bluetooth Low Energy stack also uses the heap, you must test it with both components in the maximum-expected operating conditions. The Operating System Abstraction Layer (OSAL) SWRU271H – October 2010 – Revised April 2019 Submit Documentation Feedback Copyright © 2010–2019, Texas Instruments Incorporated...
  • Page 19: Osal Messages

    Examples of receiving OSAL messages will be depicted in the event processing functions of the various layers. SWRU271H – October 2010 – Revised April 2019 The Operating System Abstraction Layer (OSAL) Submit Documentation Feedback Copyright © 2010–2019, Texas Instruments Incorporated...
  • Page 20: The Application And Profiles

    The Bluetooth Low Energy software development kit contains a sample project, SimpleBLEPeripheral, that implements a basic Bluetooth Low Energy peripheral device. This project is built using the single-device stack configuration, with the stack, profiles, and application running on the CC2540/41. Project Overview On the left side of the IAR window, the Workspace section lists the files used by the project.
  • Page 21 INCLUDE – This group includes all of the necessary header files for the Bluetooth Low Energy protocol stack API. For details, see Appendix A through Appendix G CC2540 Bluetooth low energy API Guide. • LIB – This group contains the protocol stack library file CC2540_BLE_peri.lib. For more information on the protocol stack libraries, see Section 5.8.
  • Page 22: Start-Up In Main()

    Finally, the function calls the osal_start_system(), which starts the processing loop (OSAL) and does not return. The Application and Profiles SWRU271H – October 2010 – Revised April 2019 Submit Documentation Feedback Copyright © 2010–2019, Texas Instruments Incorporated...
  • Page 23: Application Initialization

    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.
  • Page 24: Osal Messages

    HAL. The application has code specific to the Keyfob reference hardware in the CC2540/41DK-MINI development kit. This code is surrounded by the preprocessor directive #if defined (CC2540_MINIDK) and gets compiled when using the CC2540/41DK- MINI Keyfob configuration.
  • Page 25: Complete Attribute Table

    5.5. When working with the SimpleBLEPeripheral application, print Figure 4-2 as a reference. Figure 4-2. SimpleBLEPeripheral Complete Attribute Table SWRU271H – October 2010 – Revised April 2019 The Application and Profiles Submit Documentation Feedback Copyright © 2010–2019, Texas Instruments Incorporated...
  • Page 26: Additional Sample Projects

    A heart rate monitor • A health thermometer • A proximity key fob For more information on these projects, see Chapter The Application and Profiles SWRU271H – October 2010 – Revised April 2019 Submit Documentation Feedback Copyright © 2010–2019, Texas Instruments Incorporated...
  • Page 27: The Bluetooth Low Energy Protocol Stack

    Device configuration For an overview of possible device states, see Figure 5-1. Figure 5-1. GAP State Diagram SWRU271H – October 2010 – Revised April 2019 The Bluetooth Low Energy Protocol Stack Submit Documentation Feedback Copyright © 2010–2019, Texas Instruments Incorporated...
  • Page 28: Connection Event And Interval

    Applications may require different connection intervals. This difference affects the power consumption of the device. For more detailed information on power consumption, see the Measuring Power Consumption. The Bluetooth Low Energy Protocol Stack SWRU271H – October 2010 – Revised April 2019 Submit Documentation Feedback Copyright © 2010–2019, Texas Instruments Incorporated...
  • Page 29: Slave Latency

    When no data is sent from the slave to the master, the slave will transmit during a connection event once every 500 ms. SWRU271H – October 2010 – Revised April 2019 The Bluetooth Low Energy Protocol Stack Submit Documentation Feedback Copyright © 2010–2019, Texas Instruments Incorporated...
  • Page 30 When the central device receives this request, it can accept or reject the parameters. The Bluetooth Low Energy Protocol Stack SWRU271H – October 2010 – Revised April 2019 Submit Documentation Feedback Copyright © 2010–2019, Texas Instruments Incorporated...
  • Page 31: Gap Abstraction

    These parameters include advertising and scanning intervals, windows, and so forth (see B and C [GAPRole xxx API). A configuration of the GAP layer in SimpleBLEPeripheral_init() folows. SWRU271H – October 2010 – Revised April 2019 The Bluetooth Low Energy Protocol Stack Submit Documentation Feedback Copyright © 2010–2019, Texas Instruments Incorporated...
  • Page 32: Gaprole Task

    1. Initialize the GAPRole parameters, see Section B.2. Do this initialization in the application initialization function (that is, SimpleBLEPeripheral_init()). The Bluetooth Low Energy Protocol Stack SWRU271H – October 2010 – Revised April 2019 Submit Documentation Feedback Copyright © 2010–2019, Texas Instruments Incorporated...
  • Page 33 The API in Section B.3 lists the return parameters for each command and associated callback function events. SWRU271H – October 2010 – Revised April 2019 The Bluetooth Low Energy Protocol Stack Submit Documentation Feedback Copyright © 2010–2019, Texas Instruments Incorporated...
  • Page 34 Energy protocol stack. The task forwards some events to the application. The following is an example tracing the GAP_LINK_TERMINATED_EVENT from the Bluetooth Low Energy protocol stack to the application. The Bluetooth Low Energy Protocol Stack SWRU271H – October 2010 – Revised April 2019 Submit Documentation Feedback Copyright © 2010–2019, Texas Instruments Incorporated...
  • Page 35: Central Role

    For the list of return parameter associated with each API, see Appendix A through Appendix SWRU271H – October 2010 – Revised April 2019 The Bluetooth Low Energy Protocol Stack Submit Documentation Feedback Copyright © 2010–2019, Texas Instruments Incorporated...
  • Page 36 Energy protocol stack. The task forwards some events to the application. The following is an example tracing the GAP_DEVICE_DISCOVERY_EVENT from the Bluetooth Low Energy protocol stack to the application. The Bluetooth Low Energy Protocol Stack SWRU271H – October 2010 – Revised April 2019 Submit Documentation Feedback Copyright © 2010–2019, Texas Instruments Incorporated...
  • Page 37: Gap Bond Manager (Gapbondmgr)

    This feature is called bonding and it lets the devices store the security keys and quickly reestablish encryption and authentication after reconnecting without going through the pairing process. SWRU271H – October 2010 – Revised April 2019 The Bluetooth Low Energy Protocol Stack Submit Documentation Feedback Copyright © 2010–2019, Texas Instruments Incorporated...
  • Page 38: Using The Gapbondmgr Profile

    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. The Bluetooth Low Energy Protocol Stack SWRU271H – October 2010 – Revised April 2019 Submit Documentation Feedback Copyright © 2010–2019, Texas Instruments Incorporated...
  • Page 39 Gap Bond Manager (GAPBondMgr) www.ti.com SWRU271H – October 2010 – Revised April 2019 The Bluetooth Low Energy Protocol Stack Submit Documentation Feedback Copyright © 2010–2019, Texas Instruments Incorporated...
  • Page 40: Gapbondmgr Examples For Various Security Modes

    For an overview of this process for peripheral device, see Figure 5-5. Figure 5-5. Just Works Pairing The Bluetooth Low Energy Protocol Stack SWRU271H – October 2010 – Revised April 2019 Submit Documentation Feedback Copyright © 2010–2019, Texas Instruments Incorporated...
  • Page 41 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.4. SWRU271H – October 2010 – Revised April 2019 The Bluetooth Low Energy Protocol Stack Submit Documentation Feedback Copyright © 2010–2019, Texas Instruments Incorporated...
  • Page 42: Bonding After Just Works Pairing

    For an overview of this process for peripheral device, see Figure 5-6. Figure 5-6. Bonding After Just Works Pairing The Bluetooth Low Energy Protocol Stack SWRU271H – October 2010 – Revised April 2019 Submit Documentation Feedback Copyright © 2010–2019, Texas Instruments Incorporated...
  • Page 43: Pairing With Mitm Authentication

    GAPBondMgr. Figure 5-7. Pairing With MITM Authentication SWRU271H – October 2010 – Revised April 2019 The Bluetooth Low Energy Protocol Stack Submit Documentation Feedback Copyright © 2010–2019, Texas Instruments Incorporated...
  • Page 44 Authenticated Pairing With Bonding Enabled After pairing and encrypting with MITM authentication, bonding occurs similarly as described in Section 5.4.3.3. The Bluetooth Low Energy Protocol Stack SWRU271H – October 2010 – Revised April 2019 Submit Documentation Feedback Copyright © 2010–2019, Texas Instruments Incorporated...
  • Page 45: Generic Attribute Profile (Gatt)

    (UUID). Some of these UUIDs are defined by Bluetooth SIG and others are user- definable. SWRU271H – October 2010 – Revised April 2019 The Bluetooth Low Energy Protocol Stack Submit Documentation Feedback Copyright © 2010–2019, Texas Instruments Incorporated...
  • Page 46: Gatt Services And Profile

    Section 5.5.4.2. Figure 5-9. simpleGATTProfile Characteristic Table from BTool The Bluetooth Low Energy Protocol Stack SWRU271H – October 2010 – Revised April 2019 Submit Documentation Feedback Copyright © 2010–2019, Texas Instruments Incorporated...
  • Page 47 SIMPLEPROFILE_CHAR4 for notifications (writing 0x0001) or indications (writing 0x0002). Writing a 0x0000 to this attribute will disable notifications and indications. SWRU271H – October 2010 – Revised April 2019 The Bluetooth Low Energy Protocol Stack Submit Documentation Feedback Copyright © 2010–2019, Texas Instruments Incorporated...
  • Page 48: Gatt Client Abstraction

    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. The Bluetooth Low Energy Protocol Stack SWRU271H – October 2010 – Revised April 2019 Submit Documentation Feedback Copyright © 2010–2019, Texas Instruments Incorporated...
  • Page 49 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. SWRU271H – October 2010 – Revised April 2019 The Bluetooth Low Energy Protocol Stack Submit Documentation Feedback Copyright © 2010–2019, Texas Instruments Incorporated...
  • Page 50 Besides receiving responses to its own commands, a GATT client may also receive asynchronous data from the GATT server as indications or notifications. The Bluetooth Low Energy Protocol Stack SWRU271H – October 2010 – Revised April 2019 Submit Documentation Feedback Copyright © 2010–2019, Texas Instruments Incorporated...
  • Page 51: Gatt Server Abstraction

    Appendix E. These functions include finding specific attributes, reading client characteristic configurations, and modifying client characteristic configurations. SWRU271H – October 2010 – Revised April 2019 The Bluetooth Low Energy Protocol Stack Submit Documentation Feedback Copyright © 2010–2019, Texas Instruments Incorporated...
  • Page 52: Attribute Table Initialization

    To interface with the application and Bluetooth Low Energy protocol stack, each profile must contain the elements in the following sections The Bluetooth Low Energy Protocol Stack SWRU271H – October 2010 – Revised April 2019 Submit Documentation Feedback Copyright © 2010–2019, Texas Instruments Incorporated...
  • Page 53 512 octets. The following sections provide examples of attribute definitions for common attribute types. SWRU271H – October 2010 – Revised April 2019 The Bluetooth Low Energy Protocol Stack Submit Documentation Feedback Copyright © 2010–2019, Texas Instruments Incorporated...
  • Page 54 These properties must match the GATT permissions of the characteristic value. The following section expands on this. The Bluetooth Low Energy Protocol Stack SWRU271H – October 2010 – Revised April 2019 Submit Documentation Feedback Copyright © 2010–2019, Texas Instruments Incorporated...
  • Page 55 NOTE: Because this value must be cached for each connection, this is an array ion.Tthe following section describes this ion. SWRU271H – October 2010 – Revised April 2019 The Bluetooth Low Energy Protocol Stack Submit Documentation Feedback Copyright © 2010–2019, Texas Instruments Incorporated...
  • Page 56 GATTServApp function assigns handles for each attribute. This function also passes pointers the callback of the profile to the stack to initiate communication between the GATTServApp and the profile. The Bluetooth Low Energy Protocol Stack SWRU271H – October 2010 – Revised April 2019 Submit Documentation Feedback Copyright © 2010–2019, Texas Instruments Incorporated...
  • Page 57 5.5.4.2.2. These callbacks perform the characteristic reads, writes, and other processing like possibly calling an application callback defined by the profile. SWRU271H – October 2010 – Revised April 2019 The Bluetooth Low Energy Protocol Stack Submit Documentation Feedback Copyright © 2010–2019, Texas Instruments Incorporated...
  • Page 58 For more information, see Section 5.5.4.2.4.2. The Bluetooth Low Energy Protocol Stack SWRU271H – October 2010 – Revised April 2019 Submit Documentation Feedback Copyright © 2010–2019, Texas Instruments Incorporated...
  • Page 59 SWRU271H – October 2010 – Revised April 2019 The Bluetooth Low Energy Protocol Stack Submit Documentation Feedback Copyright © 2010–2019, Texas Instruments Incorporated...
  • Page 60 The Bluetooth Low Energy Protocol Stack SWRU271H – October 2010 – Revised April 2019 Submit Documentation Feedback Copyright © 2010–2019, Texas Instruments Incorporated...
  • Page 61: Get And Set Profile Parameter Usage

    GATT client. If so, the GATTServApp sends a notification of this attribute to the GATT client. SWRU271H – October 2010 – Revised April 2019 The Bluetooth Low Energy Protocol Stack Submit Documentation Feedback Copyright © 2010–2019, Texas Instruments Incorporated...
  • Page 62: L2Cap

    Implement a callback function to pass these events from the GAPRole task back to the application if needed in the application. The Bluetooth Low Energy Protocol Stack SWRU271H – October 2010 – Revised April 2019 Submit Documentation Feedback Copyright © 2010–2019, Texas Instruments Incorporated...
  • Page 63: Library Files

    Bluetooth Low Energy 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. •...
  • Page 64: Drivers

    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 SWRU271H – October 2010 – Revised April 2019 Submit Documentation Feedback Copyright © 2010–2019, Texas Instruments Incorporated...
  • Page 65: Hal Drivers

    Overview www.ti.com Figure 6-1. HAL Drivers SWRU271H – October 2010 – Revised April 2019 Drivers Submit Documentation Feedback Copyright © 2010–2019, Texas Instruments Incorporated...
  • Page 66: Adc

    For an example using the LCD driver, see the CC2540/1 configuration in the SimpleBLEPeripheral project. To include the LED driver, define HAL_LED=TRUE in the preprocessor definitions. TI designed the driver to function with the LEDs on the key fob.
  • Page 67: Other Peripherals

    Because SNV is shared with other modules in the Bluetooth Low Energy SDK such as the GAPBondMgr, carefully manage the IDs of the NV item. The available IDs are defined in bcomdef.h by default: SWRU271H – October 2010 – Revised April 2019 Drivers Submit Documentation Feedback Copyright © 2010–2019, Texas Instruments Incorporated...
  • Page 68: Creating A Custom Bluetooth Low Energy Application

    You can find the board file (hal_board_cfg.h) in the sample projects by doing the following: 1. Click HAL. 2. Click Target. 3. Click CC2540EB. 4. Click Config. Creating a Custom Bluetooth Low Energy Application SWRU271H – October 2010 – Revised April 2019 Submit Documentation Feedback Copyright © 2010–2019, Texas Instruments Incorporated...
  • Page 69: Adjusting For 32-Mhz Crystal Stabilization Time

    32-MHz ticks. This definition is set in hal_sleep.c to 25 for the CC2541 EM and 35 for the CC2540 EM by default. If the value of the definition is larger, the buffer time is longer and more power is wasted.
  • Page 70: Limit Application Processing During Bluetooth Low Energy Activity

    Bluetooth Low Energy event postprocessing. Never globally disable interrupts during Bluetooth Low Energy activity. Creating a Custom Bluetooth Low Energy Application SWRU271H – October 2010 – Revised April 2019 Submit Documentation Feedback Copyright © 2010–2019, Texas Instruments Incorporated...
  • Page 71: Development And Debugging

    Using IAR Embedded Workbench After the required version of IAR has been installed, you are ready to develop for the CC2540/41. This section describes how to open and build an existing project for a CC2540. Similar steps apply for a CC2541.
  • Page 72: Iar Embedded Workbench

    For the IAR Embedded Workbench, see Figure 8-1. Figure 8-1. IAR Embedded Workbench Development and Debugging SWRU271H – October 2010 – Revised April 2019 Submit Documentation Feedback Copyright © 2010–2019, Texas Instruments Incorporated...
  • Page 73: Project Options, Configurations, And Defined Symbols

    CC2540/41DK mini development kit. Alternatively, CC2540 is optimized for the SmartRF05 + CC2540 EM included with the full development kit. Other configurations include a 128-KB part, an OAD, and so forth: Figure 8-3.
  • Page 74: Preprocessor Defined Symbols Settings

    When preceded by an x, the symbol has no valid definition and can be considered disabled. Removing the preceding x to restore the proper name of the symbol reenables the feature or definition. Development and Debugging SWRU271H – October 2010 – Revised April 2019 Submit Documentation Feedback Copyright © 2010–2019, Texas Instruments Incorporated...
  • Page 75: The Buildconfig.h File

    Select the Use command line option box through the Extra Options tab shown in Figure 8-6 to supply the compiler with additional options. Figure 8-6. Configuration File Setup SWRU271H – October 2010 – Revised April 2019 Development and Debugging Submit Documentation Feedback Copyright © 2010–2019, Texas Instruments Incorporated...
  • Page 76 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. •...
  • Page 77: Building And Debugging A Project

    NOTE: This action compiles the source code, links the files, and builds the project. Any compiler errors or warnings appear in the Build window. 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.
  • Page 78: Debug Button In Iar

    6. Click the Go button on the toolbar to execute the program, see Figure 8-10. Development and Debugging SWRU271H – October 2010 – Revised April 2019 Submit Documentation Feedback Copyright © 2010–2019, Texas Instruments Incorporated...
  • Page 79: Linker Map File

    Figure 8-10 shows both of these buttons: Figure 8-10. IAR Debug Toolbar 8. While the program executes, disconnect the hardware debugger from the CC2540/41. The debugger runs while the device remains powered. 8.3.4 Linker Map File After building a project, IAR generates a linker map file that you can find in the Output group in the file list.
  • Page 80 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).
  • Page 81: General Information

    \Components\osal\mcu\cc2540\osal_snv.c f. \Components\hal\target\CC2540EB\_hal_uart_dma.c and \Components\hal\target\CC2540USB\_hal_uart_dma.c g. \Projects\ble\Profiles\Roles\gapbondmgr.c 2. Update the CC2540 USB Library: All library sub folders and files from \Components\hal\target\CC2540USB\* 3. The following GATT services have minor updates. Copy the respective service.c file from \Projects\ble\Profiles to your project: a.
  • Page 82: Porting From Earlier Ble-Stack Versions

    Porting From Earlier BLE-Stack Versions This section explains necessary steps to port a BLE-Stack v1.x.x project running on a certain stack version to a newer one, and how to port between CC2540 and CC2541 projects. 9.3.1 Porting BLEv1.4.1 Projects to BLEv1.4.2 BLE v1.4.2 is a BLE-Stack maintenance release to the v1.4.1 release with all bug fixes applied in the...
  • Page 83 *pValue; //!< Part of the value of the attribute to be written (0 to ATT_MTU_SIZE-5) - must be allocated } attPrepareWriteReq_t; SWRU271H – October 2010 – Revised April 2019 General Information Submit Documentation Feedback Copyright © 2010–2019, Texas Instruments Incorporated...
  • Page 84 GATT notification / indication is to used. That is, using a profile’s SetParameter function (i.e. SimpleProfile_SetParameter()) and calling GATTServApp_ProcessCharCfg(). See the simpleGATTProfile.c for an example of this. General Information SWRU271H – October 2010 – Revised April 2019 Submit Documentation Feedback Copyright © 2010–2019, Texas Instruments Incorporated...
  • Page 85 // Allocate Client Characteristic Configuration table simpleProfileChar4Config = (gattCharCfg_t *)osal_mem_alloc( sizeof(gattCharCfg_t) * linkDBNumConns ); if ( simpleProfileChar4Config == NULL ) return ( bleMemAllocError ); SWRU271H – October 2010 – Revised April 2019 General Information Submit Documentation Feedback Copyright © 2010–2019, Texas Instruments Incorporated...
  • Page 86: Porting Blev1.3.2 Projects To Blev1.4.0

    1.3.2\Projects\ble\$PROJECT$ to C:\Texas Instruments\BLE-CC254x- 1.3\Projects\ble\$PROJECT$ where $PROJECT$ is your project folder. 2. If you modifed any files from C:\Texas Instruments\BLE-CC254x-1.3.2\Projects\Profiles, you will need to merge your changes with the new 1.4.0 version. 3. Open your project (now in the 1.4.0 folder) with IAR 8.20.
  • Page 87: Porting From Cc2540 To Cc2541 Project

    9.3.5 Porting From CC2540 to CC2541 Project This chapter describes how to port a CC2540 Project to work on a CC2541. Similar steps can be taken for the reverse direction. 1. Create and select a new CC2540 project configuration based on the CC2541 configuration under Project ->...
  • Page 88: Iar Project Options - Predefined Symbols

    Porting From Earlier BLE-Stack Versions www.ti.com 3. Under C/C++ Compiler, in the Preprocessor tab, define CC2540 (and make sure CC2541 is not defined). Figure 9-3. IAR Project Options - Predefined Symbols General Information SWRU271H – October 2010 – Revised April 2019 Submit Documentation Feedback Copyright ©...
  • Page 89: Stack Build Configuration

    5. In the Workspace pane, under the LIB group, exclude the 2541 library by right clicking on CC2541_BLE_peri.lib and selecting options. Then check “Exclude from build". Figure 9-5. BLE Library: Exclude From Custom Build SWRU271H – October 2010 – Revised April 2019 General Information Submit Documentation Feedback Copyright © 2010–2019, Texas Instruments Incorporated...
  • Page 90: Release Notes History

    6. Add the CC2540_BLE_peri.lib to the library group. Figure 9-6. BLE Library: Add To LIB Group 7. You also have to ensure to exclude the CC2540 library from the other CC2541 configurations. Release Notes History Texas Instruments, Inc. CC2540/41 Bluetooth® Low Energy Software Development Kit Version 1.4.2 June 7, 2016...
  • Page 91 Version 1.4.1 May 18, 2015 Notices: • This version of the Texas Instruments Bluetooth Low Energy stack and software is a maintenance update to the v1.4 release. It contains several bug fixes and enhancements. • The Bluetooth Low Energy protocol stack, including both the controller and host, was completely retested for v1.4.1.
  • Page 92 Version 1.4.0 November 8, 2013 Notices: • This version of the Texas Instruments Bluetooth Low Energy 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 Bluetooth Low Energy protocol stack, including both the controller and host, was completely retested for v1.4.0.
  • Page 93 Version 1.3.2 June 13, 2013 Notices: • This version of the Texas Instruments Bluetooth Low Energy 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 Bluetooth Low Energy protocol stack, including both the controller and host, was completely retested for v1.3.2.
  • Page 94 Notices: • This version of the Texas Instruments Bluetooth Low Energy 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.
  • Page 95 • 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.
  • Page 96 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 SWRU271H – October 2010 – Revised April 2019 Submit Documentation Feedback Copyright © 2010–2019, Texas Instruments Incorporated...
  • Page 97 Version 1.2.1 Apr 13, 2012 Notices: • This version of the Texas Instruments Bluetooth Low Energy 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.
  • Page 98 Notices: • This version of the Texas Instruments Bluetooth Low Energy stack and software includes support for the CC2541, as well as some enhancements and bug fixes. Details of these can be found below. If you have not previously worked with the v1.1b release (which had limited distribution), TI recommends you also read the notes detailing the changes and enhancements from v1.1a to v1.1b in addition to the...
  • Page 99 • Bluetooth Low Energy stack libraries for the CC2541 are included. • All Bluetooth Low Energy libraries are renamed and now indicate whether they are used for CC2540 or CC2541. SWRU271H – October 2010 – Revised April 2019 General Information Submit Documentation Feedback Copyright ©...
  • Page 100 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.
  • Page 101 – 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" Bluetooth Low Energy library.
  • Page 102 – 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.
  • Page 103 Bluetooth Low Energy applications using the CC2540 system-on-chip. It includes object code with the Bluetooth Low Energy protocol stack, a sample project and applications with source code, and BTool, a Windows PC application for testing Bluetooth Low Energy applications.
  • Page 104: Document History

    1.4.0 9/12/2013 Updated for BLEv1.4.0 software release 1.4.1 5/15/2015 Updated for BLEv1.4.1 software release 15.0 4/16/2019 Updated for BLEv1.5.0 software release General Information SWRU271H – October 2010 – Revised April 2019 Submit Documentation Feedback Copyright © 2010–2019, Texas Instruments Incorporated...
  • Page 105: Gap Api

    Maximum advertising interval in general discovery mode (n × 0.625 ms) TGAP_CONN_ADV_INT_MIN Minimum advertising interval when in connectable mode (n × 0.625 ms) SWRU271H – October 2010 – Revised April 2019 GAP API Submit Documentation Feedback Copyright © 2010–2019, Texas Instruments Incorporated...
  • Page 106 SM Minimum Key Length supported. Default 7. TGAP_SM_MAX_KEY_LEN SM Maximum Key Length supported. Default 16. TGAP_FILTER_ADV_REPORTS TRUE to filter duplicate advertising reports. Default TRUE. GAP API SWRU271H – October 2010 – Revised April 2019 Submit Documentation Feedback Copyright © 2010–2019, Texas Instruments Incorporated...
  • Page 107 Minimum RSSI required for scan responses to be reported to the application. Default –127. TGAP_REJECT_CONN_PARAMS Whether or not to reject Connection Parameter Update Request received on Central device. Default FALSE. SWRU271H – October 2010 – Revised April 2019 GAP API Submit Documentation Feedback Copyright © 2010–2019, Texas Instruments Incorporated...
  • Page 108: Events

    GAP_ADV_DATA_UPDATE_DONE_EVENT: Sent when the Advertising Data or SCAN_RSP Data is updated. • GAP_MAKE_DISCOVERABLE_DONE_EVENT: Sent when the Make Discoverable Request is complete. GAP API SWRU271H – October 2010 – Revised April 2019 Submit Documentation Feedback Copyright © 2010–2019, Texas Instruments Incorporated...
  • Page 109 GAP_LINK_TERMINATED_EVENT: Sent when a connection terminates. • GAP_LINK_PARAM_UPDATE_EVENT: Sent when an Update Parameters Event is received. • GAP_RANDOM_ADDR_CHANGED_EVENT: Sent when a random address changes. SWRU271H – October 2010 – Revised April 2019 GAP API Submit Documentation Feedback Copyright © 2010–2019, Texas Instruments Incorporated...
  • Page 110 GAP_SLAVE_REQUESTED_SECURITY_EVENT: Sent when a Slave Security Request is received. • GAP_DEVICE_INFO_EVENT: Sent during the Device Discovery Process when a device is discovered. GAP API SWRU271H – October 2010 – Revised April 2019 Submit Documentation Feedback Copyright © 2010–2019, Texas Instruments Incorporated...
  • Page 111 Events www.ti.com • GAP_BOND_COMPLETE_EVENT: Sent when the bonding process completes. • GAP_PAIRING_REQ_EVENT: Sent when an unexpected Pairing Request is received. SWRU271H – October 2010 – Revised April 2019 GAP API Submit Documentation Feedback Copyright © 2010–2019, Texas Instruments Incorporated...
  • Page 112: Gaprole Peripheral Role Api

    Terminates an existing connection. SUCCESS: connection termination process has started. Returns bleIncorrectMode: there is no active connection. LL_STATUS_ERROR_CTRL_PROC_ALREADY_ACTIVE: disconnect is in progress. GAPRole Peripheral Role API SWRU271H – October 2010 – Revised April 2019 Submit Documentation Feedback Copyright © 2010–2019, Texas Instruments Incorporated...
  • Page 113 GAPROLE_TERMINATE_LINK 2 // Terminate link upon unsuccessful parameter updates. SUCCESS: parameter update process has started Returns BleNotConnected: there is no connection so cannot update parameters SWRU271H – October 2010 – Revised April 2019 GAPRole Peripheral Role API Submit Documentation Feedback Copyright © 2010–2019, Texas Instruments Incorporated...
  • Page 114: Configurable Parameters

    Also used for param update. GAPROLE_SLAVE_LATENCY uint16 Slave latency to use for a parameter update. Range: 0 to 499. Default is 0. GAPRole Peripheral Role API SWRU271H – October 2010 – Revised April 2019 Submit Documentation Feedback Copyright © 2010–2019, Texas Instruments Incorporated...
  • Page 115: Callbacks

    GAPROLE_CONNECTED //!< In a connection • GAPROLE_CONNECTED_ADV //!< In a connection + advertising • GAPROLE_ERROR //!< Error occurred – invalid state SWRU271H – October 2010 – Revised April 2019 GAPRole Peripheral Role API Submit Documentation Feedback Copyright © 2010–2019, Texas Instruments Incorporated...
  • Page 116: Rssi Callback (Pfnrssiread)

    This function is defined as follows: This function passes a signed 1-byte value (newRSSI) of the last reported RSSI to the application. GAPRole Peripheral Role API SWRU271H – October 2010 – Revised April 2019 Submit Documentation Feedback Copyright © 2010–2019, Texas Instruments Incorporated...
  • Page 117: Gaprole Central Role Api

    C.2) Parameters pValue – pointer to buffer to contain the read data SUCCESS Returns INVALIDPARAMETER: param was not valid SWRU271H – October 2010 – Revised April 2019 GAPRole Central Role API Submit Documentation Feedback Copyright © 2010–2019, Texas Instruments Incorporated...
  • Page 118 Returns bleIncorrectMode: invalid profile role. bleNotReady: a scan is in progress. bleAlreadyInRequestedMode: cannot process now. bleNoResources: too many links. GAPRole Central Role API SWRU271H – October 2010 – Revised April 2019 Submit Documentation Feedback Copyright © 2010–2019, Texas Instruments Incorporated...
  • Page 119 Returns bleAlreadyInRequestedMode: Device discovery already started. bleMemAllocError: not enough memory to allocate device discovery structure. LL_STATUS_ERROR_BAD_PARAMETER: bad parameter LL_STATUS_ERROR_COMMAND_DISALLOWED SWRU271H – October 2010 – Revised April 2019 GAPRole Central Role API Submit Documentation Feedback Copyright © 2010–2019, Texas Instruments Incorporated...
  • Page 120 Cancel periodic RSSI reads on a link. connHandle - connection handle of link Parameters SUCCESS Returns bleIncorrectMode: No active link. GAPRole Central Role API SWRU271H – October 2010 – Revised April 2019 Submit Documentation Feedback Copyright © 2010–2019, Texas Instruments Incorporated...
  • Page 121: Configurable Parameters

    This function passes a signed one byte value (newRSSI) of the last reported RSSI to the application for a given connection handle (connHandle). SWRU271H – October 2010 – Revised April 2019 GAPRole Central Role API Submit Documentation Feedback Copyright © 2010–2019, Texas Instruments Incorporated...
  • Page 122: Central Event Callback (Eventcb)

    The possible GAPRole central states are in the following list. For more information on these events, see Section A.3: • 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 GAPRole Central Role API SWRU271H – October 2010 – Revised April 2019 Submit Documentation Feedback Copyright © 2010–2019, Texas Instruments Incorporated...
  • Page 123: Gatt/Att Api

    If the return status is SUCCESS, the notification has been successfully queued for Corresponding Events transmission. SWRU271H – October 2010 – Revised April 2019 GATT/ATT API Submit Documentation Feedback Copyright © 2010–2019, Texas Instruments Incorporated...
  • Page 124: Client Commands

    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). GATT/ATT API SWRU271H – October 2010 – Revised April 2019 Submit Documentation Feedback Copyright © 2010–2019, Texas Instruments Incorporated...
  • Page 125 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). SWRU271H – October 2010 – Revised April 2019 GATT/ATT API Submit Documentation Feedback Copyright © 2010–2019, Texas Instruments Incorporated...
  • Page 126 This sub- procedure is complete when either ATT_READ_RSP (with SUCCESS or bleTimeout status) or the calling application receives the ATT_ERROR_RSP (with SUCCESS status). GATT/ATT API SWRU271H – October 2010 – Revised April 2019 Submit Documentation Feedback Copyright © 2010–2019, Texas Instruments Incorporated...
  • Page 127 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). SWRU271H – October 2010 – Revised April 2019 GATT/ATT API Submit Documentation Feedback Copyright © 2010–2019, Texas Instruments Incorporated...
  • Page 128 ATT_ERROR_RSP (if an error occurred on the server). This sub-procedure is complete when either ATT_WRITE_RSP (with SUCCESS or bleTimeout status) or the calling application task receives the ATT_ERROR_RSP (with SUCCESS status). GATT/ATT API SWRU271H – October 2010 – Revised April 2019 Submit Documentation Feedback Copyright © 2010–2019, Texas Instruments Incorporated...
  • Page 129 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). SWRU271H – October 2010 – Revised April 2019 GATT/ATT API Submit Documentation Feedback Copyright © 2010–2019, Texas Instruments Incorporated...
  • Page 130: Return Values

    • bleLinkEncrypted (0x19): The link is encrypted. Do not send an attribute PDU includes an authentication signature on an encrypted link GATT/ATT API SWRU271H – October 2010 – Revised April 2019 Submit Documentation Feedback Copyright © 2010–2019, Texas Instruments Incorporated...
  • Page 131: Events

    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) SWRU271H – October 2010 – Revised April 2019 GATT/ATT API Submit Documentation Feedback Copyright © 2010–2019, Texas Instruments Incorporated...
  • Page 132 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 SWRU271H – October 2010 – Revised April 2019 Submit Documentation Feedback Copyright © 2010–2019, Texas Instruments Incorporated...
  • Page 133: Gatt Commands And Corresponding Att Events

    ATT_ERR_INVALID_VALUE_SIZE (0x0D): The attribute value length is invalid for the operation. • ATT_ERR_UNLIKELY (0x0E): The attribute request requested has encountered an error that was unlikely and failed to complete as requested. SWRU271H – October 2010 – Revised April 2019 GATT/ATT API Submit Documentation Feedback Copyright © 2010–2019, Texas Instruments Incorporated...
  • Page 134 ATT_ERR_UNSUPPORTED_GRP_TYPE (0x10): The attribute type is not a supported grouping attribute as defined by a higher layer specification. • ATT_ERR_INSUFFICIENT_RESOURCES (0x11): Insufficient resources exist to complete the request. GATT/ATT API SWRU271H – October 2010 – Revised April 2019 Submit Documentation Feedback Copyright © 2010–2019, Texas Instruments Incorporated...
  • Page 135: Gattservapp Api

    ATT request is pending LINKDB_ERR_INSUFFICIENT_AUTHEN: authentication is required but link is not authenticated bleMemAllocError: memory allocation failure occurred when allocating buffer SWRU271H – October 2010 – Revised April 2019 GATTServApp API Submit Documentation Feedback Copyright © 2010–2019, Texas Instruments Incorporated...
  • Page 136 ATT_ERR_INVALID_VALUE: not a valid value for a CCC ATT_ERR_INVALID_VALUE_SIZE: not a valid size for a CCC ATT_ERR_ATTR_NOT_LONG: offset needs to be 0 ATT_ERR_INSUFFICIENT_RESOURCES: CCC not found GATTServApp API SWRU271H – October 2010 – Revised April 2019 Submit Documentation Feedback Copyright © 2010–2019, Texas Instruments Incorporated...
  • Page 137: Gapbondmgr Api

    – peer device address connHandle – connection handle role – master or slave role Returns SUCCESS: GAPBondMgr was notified of link establishment SWRU271H – October 2010 – Revised April 2019 GAPBondMgr API Submit Documentation Feedback Copyright © 2010–2019, Texas Instruments Incorporated...
  • Page 138 SUCCESS – bond record found and changed Returns bleNoResources – no bond records found (for 0xFFFF connectionHandle) bleNotConnected – connection with connectionHandle is invalid GAPBondMgr API SWRU271H – October 2010 – Revised April 2019 Submit Documentation Feedback Copyright © 2010–2019, Texas Instruments Incorporated...
  • Page 139 – lengths in bytes of item. SUCCESS: NV item is the correct length Returns FAILURE: NV item is an incorrect length SWRU271H – October 2010 – Revised April 2019 GAPBondMgr API Submit Documentation Feedback Copyright © 2010–2019, Texas Instruments Incorporated...
  • Page 140: Configurable Parameters

    Default is 0x02 (Terminate link when a bonding is unsuccessful). GAPBOND_ERASE_SINGLEBOND uint8[9] Erase a single bonded device. Must provide address type followed by device address. GAPBondMgr API SWRU271H – October 2010 – Revised April 2019 Submit Documentation Feedback Copyright © 2010–2019, Texas Instruments Incorporated...
  • Page 141: Callbacks

    This function is defined as the following: SWRU271H – October 2010 – Revised April 2019 GAPBondMgr API Submit Documentation Feedback Copyright © 2010–2019, Texas Instruments Incorporated...
  • Page 142 LL_CTRL_PKT_TIMEOUT_TERM (0x22): Timeout waiting for response • bleGAPBondRejected (0x32): This status is received due to one of the above three errors. GAPBondMgr API SWRU271H – October 2010 – Revised April 2019 Submit Documentation Feedback Copyright © 2010–2019, Texas Instruments Incorporated...
  • Page 143: Hci Extension Api

    1. Define the event in the application. 2. Configure the Bluetooth Low Energy protocol stack to return the event (in simpleBLEPeripheral_init()) SWRU271H – October 2010 – Revised April 2019 HCI Extension API Submit Documentation Feedback Copyright © 2010–2019, Texas Instruments Incorporated...
  • Page 144 Returns LL_STATUS_ERROR_BAD_PARAMETER: more than one bit is set. Example (code additions to SimpleBLEPeripheral.c): 1. Define the event in the application. HCI Extension API SWRU271H – October 2010 – Revised April 2019 Submit Documentation Feedback Copyright © 2010–2019, Texas Instruments Incorporated...
  • Page 145 Bluetooth Low Energy data is automatically decrypted by the stack and operates free of this API. mode – one of… Parameters HCI_EXT_NV_NOT_IN_USE HCI_EXT_NV_IN_USE HCI_VendorSpecifcCommandCompleteEvent Corresponding Events: SWRU271H – October 2010 – Revised April 2019 HCI Extension API Submit Documentation Feedback Copyright © 2010–2019, Texas Instruments Incorporated...
  • Page 146 0x16 (that is, connection terminated by local host), followed by an HCI vendor specific event. connHandle– The handle of the connection. Parameters HCI_Disconnection_Complete Corresponding Events: HCI_VendorSpecifcCommandCompleteEvent HCI Extension API SWRU271H – October 2010 – Revised April 2019 Submit Documentation Feedback Copyright © 2010–2019, Texas Instruments Incorporated...
  • Page 147 CC2590 High Gain Mode (HGM) Low/High setting. When using this command, the CC254x Tx output power and Rx gain retain their previous values unless the previous Tx output power value was set to 4 dBm on the CC2540. In this case, the value is set to 0dBm.
  • Page 148 Connection ID, Connection Role, Peer Device Address, and Peer Address Type, which requires (the number of active connections × 9 bytes) of memory: HCI_VendorSpecifcCommandCompleteEvent Corresponding Events: HCI Extension API SWRU271H – October 2010 – Revised April 2019 Submit Documentation Feedback Copyright © 2010–2019, Texas Instruments Incorporated...
  • Page 149 If the halt during RF is disabled, the HCI_EXT_ClkDivOnHaltCmd is disallowed. mode – one of… Parameters HCI_EXT_HALT_DURING_RF_DISABLE HCI_EXT_HALT_DURING_RF_ENABLE HCI_VendorSpecifcCommandCompleteEvent Corresponding Events: SWRU271H – October 2010 – Revised April 2019 HCI Extension API Submit Documentation Feedback Copyright © 2010–2019, Texas Instruments Incorporated...
  • Page 150 – one of the following: • HCI_EXT_PM_IO_PORT_PIN0 • HCI_EXT_PM_IO_PORT_PIN1 • HCI_EXT_PM_IO_PORT_PIN2 • HCI_EXT_PM_IO_PORT_PIN3 • HCI_EXT_PM_IO_PORT_PIN4 • HCI_EXT_PM_IO_PORT_PIN5 • HCI_EXT_PM_IO_PORT_PIN6 • HCI_EXT_PM_IO_PORT_PIN7 HCI_VendorSpecifcCommandCompleteEvent Corresponding Events: HCI Extension API SWRU271H – October 2010 – Revised April 2019 Submit Documentation Feedback Copyright © 2010–2019, Texas Instruments Incorporated...
  • Page 151 When the HCI_EXT_EndModemTest is issued to stop this test, the controller resets. rxFreq- selects which channel [0 to 39] on which to receive Parameters HCI_VendorSpecifcCommandCompleteEvent Corresponding Events SWRU271H – October 2010 – Revised April 2019 HCI Extension API Submit Documentation Feedback Copyright © 2010–2019, Texas Instruments Incorporated...
  • Page 152 • HCI_EXT_ENABLE_NUM_COMPL_PKTS_ON_EVENT: return the number of completed packets event at the end of every connection event HCI_VendorSpecifcCommandCompleteEvent Corresponding Events HCI Extension API SWRU271H – October 2010 – Revised April 2019 Submit Documentation Feedback Copyright © 2010–2019, Texas Instruments Incorporated...
  • Page 153 The connection ID to perform the command Parameters command- HCI_EXT_PER_RESET, HCI_EXT_PER_READ HCI_VendorSpecifcCommandCompleteEvent Corresponding Events SWRU271H – October 2010 – Revised April 2019 HCI Extension API Submit Documentation Feedback Copyright © 2010–2019, Texas Instruments Incorporated...
  • Page 154 This PTM-only command saves this device’s the tuning setting of this device in non-volatile memory. The Bluetooth Low Energy Controller uses this setting when resetting and waking from sleep. HCI_VendorSpecifcCommandCompleteEvent Corresponding Events HCI Extension API SWRU271H – October 2010 – Revised April 2019 Submit Documentation Feedback Copyright © 2010–2019, Texas Instruments Incorporated...
  • Page 155 (slave latency + 1 × the connection interval). control – HCI_EXT_ENABLE_FAST_TX_RESP_TIME, Parameters HCI_EXT_DISABLE_FAST_TX_RESP_TIME HCI_VendorSpecifcCommandCompleteEvent Corresponding Events SWRU271H – October 2010 – Revised April 2019 HCI Extension API Submit Documentation Feedback Copyright © 2010–2019, Texas Instruments Incorporated...
  • Page 156 0: feature shall not be used 0: Feature shall not be used 1: Feature can be used HCI_VendorSpecifcCommandCompleteEvent Corresponding Events HCI Extension API SWRU271H – October 2010 – Revised April 2019 Submit Documentation Feedback Copyright © 2010–2019, Texas Instruments Incorporated...
  • Page 157 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 HCI_VendorSpecifcCommandCompleteEvent Corresponding Events SWRU271H – October 2010 – Revised April 2019 HCI Extension API Submit Documentation Feedback Copyright © 2010–2019, Texas Instruments Incorporated...
  • Page 158 – HCI_EXT_ENABLE_SL_OVERRIDE, HCI_EXT_DISABLE_SL_OVERRIDE Parameters HCI_VendorSpecifcCommandCompleteEvent Corresponding Events HCI Extension API SWRU271H – October 2010 – Revised April 2019 Submit Documentation Feedback Copyright © 2010–2019, Texas Instruments Incorporated...
  • Page 159 • 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 SWRU271H – October 2010 – Revised April 2019 HCI Extension API Submit Documentation Feedback Copyright © 2010–2019, Texas Instruments Incorporated...
  • Page 160: Host Error Codes

    0x19 bleLinkEncrypted 0x1A bleProcedureComplete 0x30 bleGAPUserCanceled 0x31 bleGAPConnNotAcceptable 0x32 bleGAPBondRejected 0x40 bleInvalidPDU 0x41 bleInsufficientAuthen 0x42 bleInsufficientEncrypt 0x43 bleInsufficientKeySize 0xFF INVALID_TASK_ID HCI Extension API SWRU271H – October 2010 – Revised April 2019 Submit Documentation Feedback Copyright © 2010–2019, Texas Instruments Incorporated...
  • Page 161: Revision History

    2.4....................• Updates were made in Section 8.2........................• Added new Section 9.2........................• Added new Section 9.3. SWRU271H – October 2010 – Revised April 2019 Revision History Submit Documentation Feedback Copyright © 2010–2019, Texas Instruments Incorporated...
  • Page 162 TI products. TI’s provision of these resources does not expand or otherwise alter TI’s applicable warranties or warranty disclaimers for TI products. Mailing Address: Texas Instruments, Post Office Box 655303, Dallas, Texas 75265 Copyright © 2019, Texas Instruments Incorporated...

This manual is also suitable for:

Cc2541

Table of Contents