CC2640R2 to CC26x2

Introduction

This section describes the main differences an Application Developer must be aware of between the CC2640R2 and the CC26x2 along with a porting guide to demonstrate the migration effort.

Features and Benefits

Increased Processing Power and Scalability

The CC26x2 is a wireless MCU with a dedicated ARM Cortex-M4F application processor that is pin-to-pin compatible to the CC2640R2 in the 7x7mm QFN package.

More memory is available with an increase of non-volatile memory from 275kB to 608kB. This breaks down into 352kB Flash memory + 256 KB ROM. RAM has also increased from 28 kB to 80kB. The availability of this increased memory provides support for Over-the-Air Downloads (OAD), larger applications, and more simultaneous connections.

Other improvements include an additional UART and a 70% reduction in current consumption in the Sensor Controller.

Bluetooth 5 qualified

If your project wasn’t already on a BLE5 platform, the CC26x2 will provide the ability to support all the new features of Bluetooth 5. This includes features such as higher throughput, longer range, advertising extensions, and improved coexistence with other wireless technology.

Enhanced security

With additional hardware security accelerators for AES-128/256, SHA-256, and ECC, CC26x2 saves five times the processing time and current consumption for implementing security algorithms. This is critical to enable strong network security.

CC26x2 LaunchPad Support

All example applications are compatible with the CC26x2 LaunchPad development kit. These features allow for a unified development experience and empowers developers to rapidly release to market.

CC26x2 LaunchPad Development Kit Product Page

Compatibility Notes

Application Build Configuration

Depending on the example project, the available application build configurations now are FlashROM_Release, FlashROM_Debug, and FlashROM_RCOSC_Release.

The FlashROM_Debug provides debug feature improvements and is user configurable in the ble_debug.cfg file found in the project’s Tools folder. In contrast, FlashROM_Release and FlashROM_RCOSC_Release have debug features turned off but they are still configurable in the ble_release.cfg file found in the project’s Tools folder.

By default, the project’s build configuration is FlashROM_Release. Refer to the application’s README file for additional application specific information.

Stack Build Configuration

All application configurations use the stack library configuration, FlashROM_Library. This build configuration will yield additional flash footprint optimizations by the linker since the application and stack can share contiguous flash pages. This configuration is further discussed in the Stack Library Configuration section of this User’s Guide.

The build_config.opt specifies which stack components will be utilized, and thus which library files should be used during the Stack Project build process. This file is located in the Tools folder of the stack project.

BLE5 features cannot be removed from the stack. BLE5-Stack 1.01.01 now comes with BLE 5.0 features always enabled.

Predefined Symbols

The predefined symbols have been moved from the project properties into the project’s Tools/defines folder. Select the .opt file that is relevant to the project’s current build configuration (Debug, Release, etc.).

Heap Configuration

Previously, the heap configuration was handled in the application’s app_ble.cfg file found in the project’s Tools folder. This is now part of the TI RTOS configuration file (ble_debug.cfg or ble_release.cfg) that is described earlier in the Application Build Configuration section.

GAP Role Removal

All GAP Roles source and header files (peripheral.c, peripheral.h, central.c, central.h, etc.) have been removed. Functionality relating to specific roles was moved into GAP Bond Manager. With the GAP Role changes, GAP events are being handled differently. GAP events are now returned to the application directly as RTOS events.

Further discussion of this is in the CC2640R2 BLE-Stack 3.01.01/BLE5-Stack 1.00.01 to CC26x2 BLE5-Stack 1.01.01.

Host Privacy

The design of the Host Privacy in BLE5 1.01.01 is a complete redesign of the existing one. In BLE5-Stack 1.01.01 the Host is responsible for the following tasks:

  • Configuring the privacy mode and own address type to conduct desired privacy operations on the controller
  • Performing pairing procedure to exchange device identity information including IRK, identity address, and address type
  • Updating peer device’s address information in the link DB after acquiring the identity information through pairing process
  • Managing resolving list by adding/removing resolving list entries or clearing
  • Storing resolving list to NV and restore it from, so that the privacy information is persistent across power cycles

CC2640R2 BLE-Stack 3.01.01/BLE5-Stack 1.00.01 to CC26x2 BLE5-Stack 1.01.01

API Translation Tables

This guide will describe a way to port a project from CC2640R2 SDK 1.50 (BLE-Stack 3.01.01)/SDK 1.40 (BLE5-Stack 1.00.01) to a CC26x2 SDK 1.60 (BLE5-Stack 1.01.01) BLE5-Stack 1.01.01 project. If your project is from BLE-Stack 3.01.01, please note that this won’t show how to add BLE5 features. However porting your project will allow the use of BLE5 features that are contained in the BLE5-Stack 1.01.01.

Porting Steps

To minimize project configuration differences, start with an example project in the CC26x2 SDK 1.60 (BLE5-Stack 1.01.01). For example, if your base project was simple_peripheral in BLE-Stack 3.01.01, use simple_peripheral in BLE5-Stack 1.01.01 as the project base to implement application-level modifications on. In other words, no modifications will be made to the original project. All application specific code will be inserted into the BLE5-Stack 1.01.01 project.

Some of these application-level modifications are due to various API changes. To aid in this, the guide provides an API translation table: GAP Changes.

Be sure to utilize the IDE and Tools recommended by the SDK’s release notes. For API Descriptions see BLE Stack API Reference. Additional information on this process can be found in the CC26x2 Wiki Porting Page

  1. Choose a BLE5-Stack 1.01.01 example project and open it in the preferred supported IDE

    We’re going to use simple_peripheral as the starting BLE5-Stack 1.01.01 sample project to provide context.

  2. Transfer any additional app specific predefined symbols into the example project

    The predefined symbols have moved from the project properties into the project’s Tools/defines folder. Select the .opt file that is relevant to the project’s current build configuration (Debug, Release, etc.). The default build configuration selected is Release. Further information about these configurations can be found in the README of the example project.

  3. Transfer modified application files into the example project

    Modify main.c in the BLE5-Stack 1.01.01 example to create or rename any tasks that were added or modified in the original project. Note that GAPRole_createTask() should not be brought over to main.c.

    In this example, the following files from the original project were moved into simple_peripheral BLE5-Stack 1.01.01 example:

    • two_btn_menu.c and two_btn_menu.h
    • simple_peripheral.c and simple_peripheral.h
    • simple_peripheral_menu.c and simple_peripheral_menu.h
    • simple_gatt_profile.c and simple_gatt_profile.h
  4. Adjust the Application for the GAP Role Removal

    All GAP Roles source and header files (peripheral.c, peripheral.h, central.c, central.h, etc.) have been removed in BLE5-Stack 1.01.01. These files will produce build errors and should not be included in your app. This change will introduce a structure change in the application.

    The functionality of the roles have been broken into distinct GAP functions: Scanner, Advertiser, and Initiator.

    These functions of GAP can be independently controlled to allow the device to function as a desired GAP Role such as peripheral or central. For additional information about using these roles, it is suggested to refer to the GAP Roles section of the User Guide. If coming from BLE-Stack 3.01.01, this section provides information about the legacy features that exist in your current application.

    Utilize the GAP Changes table to port application GAP functionality. For example, in this table you’ll find information such as TGAP_LIM_DISC_ADV_INT_MIN is now replaced with GAP_ADV_PARAM_PRIMARY_INTERVAL_MIN, GAPROLE_ADVERT_ENABLED is now done with GapAdv_enable() or that GAPRole_StartDevice() is replaced by GAP_DeviceInit() to start the GAP module.

    It is suggested to look at an existing example in the SDK, such as simple_peripheral or simple_central, may need to be used to assist in the porting process of the application. For example, the initialization of GAP Advertiser can be found in simple_peripheral.

    After using the GAP Changes table and using a relevant BLE5-Stack 1.01.01 SDK example project as a guide, such as simple_peripheral, the structure and changes will become clearer.

    In the context of simple_peripheral and using the rest of the guide, the following table provides an example of changes to understand and implement when porting: Sample Simple Peripheral App Changes.

  5. Adjust the Application for the GAP Bond Manager Changes

    During the removal of GAP Roles source files, functionality relating to specific roles was moved into GAP Bond Manager. One particular change is the handling of passcodes. These are now handled via call back - see simple_peripheral or simple_central for implementation details (search for passcodeCb).

    See GAP Bond Manager Changes for additional changes.

    1. Include icall_api.h if Stack/ICall APIs are used. Add the following #include AFTER all other includes for source files using Stack/ICall APIs.

      In this example, add:

      #include "icall_api.h"
      

      into the following files AFTER all other includes. In for the simple_peripheral port, add this into these files:

      • simple_peripheral.c
      • simple_gatt_profile.c

      For more information regarding icall_api.h see Improved ICall Architecture (ICall Lite).

      Warning

      All Stack/ICall APIs are listed in icall_api.h. If any APIs are used without icall_api.h, build and or link errors may occur with erratic runtime behaviors!

  6. Replace GAP Event processing

    In addition to the GAP Role changes, GAP events are being handled differently. This used to be received by GAP Role (ie. SimpleBLEPeripheral_processStateChangeEvt), which would then call GAPBondMgr, and then translate the event to GAPRole specific events and pass it to the application through a callback (ie. SimpleBLEPeripheral_gapRoleCBs).

    GAP events are now returned to the application directly as RTOS events. If the GAPBondMgr is present, they will first be received by the GAPBondMgr to do some processing but it will still be received the same in the application. This is now configured with GAP_DeviceInit. GAP events are received by the application (when the bond manager exists) as stack messages of type GAP_MSG_EVENT.

    See the example for simple_peripheral from BLE5-Stack 1.01.01 in the snippets below:

    Listing 106. Register to receive GAP events
    // Address mode of the local device
    #define DEFAULT_ADDRESS_MODE                  ADDRMODE_PUBLIC
    //...
    
    // Entity ID globally used to check for source and/or destination of messages
    static ICall_EntityID selfEntity;
    //...
    
    // Event globally used to post local events and pend on system and
    // local events.
    static ICall_SyncHandle syncEvent;
    //...
    
    // Address mode
    static GAP_Addr_Modes_t addrMode = DEFAULT_ADDRESS_MODE;
    //...
    
    static void SimplePeripheral_init(void)
    {
        // Register the current thread as an ICall dispatcher application
        // so that the application can send and receive messages.
        ICall_registerApp(&selfEntity, &syncEvent);
    
        //...
    
        //Initialize GAP layer for Peripheral role, pass taskID and register to receive GAP events
        GAP_DeviceInit(GAP_PROFILE_PERIPHERAL, selfEntity, addrMode, NULL);
    }
    
    Listing 107. Receiving GAP Events
    static void SimplePeripheral_processGapMessage(gapEventHdr_t *pMsg); // function definition to handle GAP messages
    
    static uint8_t SimplePeripheral_processStackMsg(ICall_Hdr *pMsg)
    {
      // Always dealloc pMsg unless set otherwise
      uint8_t safeToDealloc = TRUE;
    
      switch (pMsg->event)
      {
        case GAP_MSG_EVENT:
          SimplePeripheral_processGapMessage((gapEventHdr_t*) pMsg);
          break;
        //...
      }
    }
    
    //...
    static void SimplePeripheral_processGapMessage(gapEventHdr_t *pMsg)
    {
        switch(pMsg->opcode)
        {
            case GAP_DEVICE_INIT_DONE_EVENT:
            {
            //... etc.
    
  7. Adjust the Application for the GATT Profile Changes

    Due to changes in LinkDB defines (linkdb.h), custom GATT profiles may need to be modified in order to account for the new definitions.

    For example, when calling GATTServApp_InitCharCfg with an invalid handle use the following:

    // Initialize Client Characteristic Configuration attributes
    GATTServApp_InitCharCfg( CONNHANDLE_INVALID, simpleProfileChar4Config );
    

    The previous define for invalid handle as defined in linkdb.h was INVALID_CONNHANDLE.

    See GAP GATT Server Changes and Link Database Changes for additional changes as required.

Appendix: Translation Tables

Table 16. GAP Changes
Previous Implementation New/Current implementation
Type Name Description / API / Parameter
GAP EVENT GAP_ADV_DATA_UPDATE_DONE_EVENT Check return status of GapAdv_loadByHandle() or GapAdv_loadByBuffer()
GAP EVENT GAP_DEVICE_DISCOVERY_EVENT
This depends on how the scanner is configured but one or more of the following events will be received:
GAP_EVT_SCAN_DISABLED GAP_EVT_SCAN_PRD_ENDED GAP_EVT_SCAN_REQ_RECEIVED GAP_EVT_SCAN_INT_ENDED
GAP EVENT GAP_DEVICE_INFO_EVENT GAP_EVT_ADV_REPORT or GAP_EVT_ADV_REPORT_FULL
GAP EVENT GAP_END_DISCOVERABLE_DONE_EVENT Check return status of GapAdv_disable() to see that advertising is successfully being cancelled. The GAP_EVT_ADV_END_AFTER_DISABLE will be sent after the last advertisement ends.
GAP EVENT GAP_MAKE_DISCOVERABLE_DONE_EVENT Check return status of GapAdv_enable() to see that advertising is successfully being started. The GAP_EVT_ADV_START_AFTER_ENABLE will be sent after the first advertisement starts.
GAP EVENT GAP_RANDOM_ADDR_CHANGED_EVENT Obsolete - Address Resolution is done controller
GAP PARAM TGAP_GEN_DISC_ADV_MIN Configured by durationOrMaxEvents parameter of GapAdv_enable()
GAP PARAM TGAP_LIM_ADV_TIMEOUT Configured by durationOrMaxEvents parameter of GapAdv_enable()
GAP PARAM TGAP_GEN_DISC_SCAN Configured by parameters of GapScan_enable()
GAP PARAM TGAP_LIM_DISC_SCAN Configured by parameters of GapScan_enable()
GAP PARAM TGAP_GEN_DISC_SCAN_INT Configured by interval parameter of GapScan_setPhyParams()
GAP PARAM TGAP_GEN_DISC_SCAN_WIND Configured by window parameter of GapScan_setPhyParams()
GAP PARAM TGAP_LIM_DISC_SCAN_INT Configured by interval parameter of GapScan_setPhyParams()
GAP PARAM TGAP_LIM_DISC_SCAN_WIND Configured by window parameter of GapScan_setPhyParams()
GAP PARAM TGAP_CONN_EST_ADV_TIMEOUT Configured by durationOrMaxEvents parameter of GapAdv_enable()
GAP PARAM TGAP_CONN_PARAM_TIMEOUT GAP_SetParamValue() with GAP_PARAM_CONN_PARAM_TIMEOUT
GAP PARAM TGAP_LIM_DISC_ADV_INT_MIN GapAdv_setParam() with GAP_ADV_PARAM_PRIMARY_INTERVAL_MIN
GAP PARAM TGAP_LIM_DISC_ADV_INT_MAX GapAdv_setParam() with GAP_ADV_PARAM_PRIMARY_INTERVAL_MAX
GAP PARAM TGAP_GEN_DISC_ADV_INT_MIN GapAdv_setParam() with GAP_ADV_PARAM_PRIMARY_INTERVAL_MIN
GAP PARAM TGAP_GEN_DISC_ADV_INT_MAX GapAdv_setParam() with GAP_ADV_PARAM_PRIMARY_INTERVAL_MAX
GAP PARAM TGAP_CONN_ADV_INT_MIN GapAdv_setParam() with GAP_ADV_PARAM_PRIMARY_INTERVAL_MIN
GAP PARAM TGAP_CONN_ADV_INT_MAX GapAdv_setParam() with GAP_ADV_PARAM_PRIMARY_INTERVAL_MAX
GAP PARAM TGAP_CONN_SCAN_INT Configured by interval parameter of GapScan_setPhyParams()
GAP PARAM TGAP_CONN_SCAN_WIND Configured by window parameter of GapScan_setPhyParams()
GAP PARAM TGAP_CONN_HIGH_SCAN_INT Configured by interval parameter of GapScan_setPhyParams()
GAP PARAM TGAP_CONN_HIGH_SCAN_WIND Configured by window parameter of GapScan_setPhyParams()
GAP PARAM TGAP_GEN_DISC_SCAN_INT Configured by interval parameter of GapScan_setPhyParams()
GAP PARAM TGAP_GEN_DISC_SCAN_WIND Configured by window parameter of GapScan_setPhyParams()
GAP PARAM TGAP_LIM_DISC_SCAN_INT Configured by interval parameter of GapScan_setPhyParams()
GAP PARAM TGAP_LIM_DISC_SCAN_WIND Configured by window parameter of GapScan_setPhyParams()
GAP PARAM TGAP_CONN_EST_INT_MIN GapInit_setPhyParam() with INIT_PHYPARAM_CONN_INT_MIN
GAP PARAM TGAP_CONN_EST_INT_MAX GapInit_setPhyParam() with INIT_PHYPARAM_CONN_INT_MAX
GAP PARAM TGAP_CONN_EST_SCAN_INT GapInit_setPhyParam() with INIT_PHYPARAM_SCAN_INTERVAL
GAP PARAM TGAP_CONN_EST_SCAN_WIND GapInit_setPhyParam() with INIT_PHYPARAM_SCAN_WINDOW
GAP PARAM TGAP_CONN_EST_SUPERV_TIMEOUT GapInit_setPhyParam() with INIT_PHYPARAM_SUP_TIMEOUT
GAP PARAM TGAP_CONN_EST_LATENCY GapInit_setPhyParam() with INIT_PHYPARAM_CONN_LATENCY
GAP PARAM TGAP_CONN_EST_MIN_CE_LEN Obsolete - Not Used by Controller
GAP PARAM TGAP_CONN_EST_MAX_CE_LEN Obsolete - Not Used by Controller
GAP PARAM TGAP_PRIVATE_ADDR_INT GAP_SetParamValue() with GAP_PARAM_PRIVATE_ADDR_INT
GAP PARAM TGAP_CONN_PAUSE_CENTRAL Obsolete - Not Used by Controller
GAP PARAM TGAP_CONN_PAUSE_PERIPHERAL GAP_UpdateLinkParamReq()
GAP PARAM TGAP_SM_TIMEOUT GAP_SetParamValue() with GAP_PARAM_SM_TIMEOUT
GAP PARAM TGAP_SM_MIN_KEY_LEN GAP_SetParamValue() with GAP_PARAM_SM_MIN_KEY_LEN
GAP PARAM TGAP_SM_MAX_KEY_LEN GAP_SetParamValue() with GAP_PARAM_SM_MAX_KEY_LEN
GAP PARAM TGAP_FILTER_ADV_REPORTS Obsolete - Duplicate Filtering done in Controller
GAP PARAM TGAP_SCAN_RSP_RSSI_MIN GapScan_setParam() with SCAN_PARAM_FLT_MIN_RSSI
GAP PARAM TGAP_REJECT_CONN_PARAMS GAP_SetParamValue() with GAP_PARAM_LINK_UPDATE_DECISION
GAP PARAM TGAP_AUTH_TASK_ID GAP_SetParamValue() with GAP_PARAM_AUTH_TASK_ID
GAP PARAM TGAP_VERIFY_CAR DEPRECATED
GAP PARAM TGAP_GGS_PARAMS GAP_SetParamValue() with GAP_PARAM_GGS_PARAMS
GAP PARAM GAPROLE_IRK, GAPCENTRALROLE_IRK GapConfig_SetParameter() with GAP_CONFIG_PARAM_IRK
GAP PARAM GAPROLE_SRK, GAPCENTRALROLE_SRK GapConfig_SetParameter() with GAP_CONFIG_PARAM_SRK
GAP PARAM GAPROLE_BD_ADDR, GAPCENTRALROLE_BD_ADDR HCI_ReadBDADDRCmd()
GAP PARAM GAPROLE_ADVERT_ENABLED, GAPROLE_ADV_NONCONN_ENABLED GapAdv_enable() and GapAdv_disable()
GAP PARAM GAPROLE_ADVERT_OFF_TIME Configured by durationOrMaxEvents parameter of GapAdv_enable()
GAP PARAM GAPROLE_ADVERT_DATA
Various API:
GapAdv_loadByBuffer() GapAdv_loadByHandle() GapAdv_prepareLoadByBuffer() GapAdv_prepareLoadByHandle() GapAdv_getBuffer()
GAP PARAM GAPROLE_SCAN_RSP_DATA
Various API:
GapAdv_loadByBuffer() GapAdv_loadByHandle() GapAdv_prepareLoadByBuffer() GapAdv_prepareLoadByHandle() GapAdv_getBuffer()
GAP PARAM GAPROLE_ADV_EVENT_TYPE GapAdv_setParam() or GapAdv_getParam() with GAP_ADV_PARAM_PROPS
GAP PARAM GAPROLE_ADV_DIRECT_TYPE GapAdv_setParam() or GapAdv_getParam() with GAP_ADV_PARAM_PEER_ADDRESS_TYPE
GAP PARAM GAPROLE_ADV_DIRECT_ADDR GapAdv_setParam() or GapAdv_getParam() with GAP_ADV_PARAM_PEER_ADDRESS
GAP PARAM GAPROLE_ADV_CHANNEL_MAP GapAdv_setParam() or GapAdv_getParam() with GAP_ADV_PARAM_PRIMARY_CHANNEL_MAP
GAP PARAM GAPROLE_ADV_FILTER_POLICY GapAdv_setParam() or GapAdv_getParam() with GAP_ADV_PARAM_FILTER_POLICY
GAP PARAM GAPROLE_CONNHANDLE Returned for each GAP event
GAP PARAM GAPROLE_RSSI_READ_RATE RSSI can be received by HCI_ReadRssiCmd()
GAP PARAM GAPROLE_PARAM_UPDATE_ENABLE GAP_UpdateLinkParamReq() can be called as desired
GAP PARAM GAPROLE_MIN_CONN_INTERVAL pParams.intervalMin parameter of GAP_UpdateLinkParamReq()
GAP PARAM GAPROLE_MAX_CONN_INTERVAL pParams.intervalMax parameter of GAP_UpdateLinkParamReq()
GAP PARAM GAPROLE_SLAVE_LATENCY pParams.connLatency parameter of GAP_UpdateLinkParamReq()
GAP PARAM GAPROLE_TIMEOUT_MULTIPLIER pParams.connTimeout parameter of GAP_UpdateLinkParamReq()
GAP PARAM GAPROLE_STATE Obsolete - GAP changes remove the need for this
GAP PARAM GAPROLE_CONN_BD_ADDR, GAPROLE_BD_ADDR_TYPE

Returned in GAP_LINK_ESTABLISHED_EVENT, contained in stack message, gapEstLinkReqEvent_t when the link is established

Or use linkDB_GetInfo() at any time during the connection

GAP PARAM GAPROLE_CONN_INTERVAL Returned from linkDB_GetInfo(), as linkDBInfo_t.connInterval
GAP PARAM GAPROLE_CONN_LATENCY Returned from linkDB_GetInfo(), as linkDBInfo_t.connLatency
GAP PARAM GAPROLE_CONN_TIMEOUT Returned from linkDB_GetInfo(), as linkDBInfo_t.connTimeout
GAP PARAM GAPCENTRALROLE_MAX_SCAN_RES Configured by maxNumReport parameter of GapScan_enable()
GAP PARAM GAPCENTRALROLE_LINK_PARAM_UPDATE_REQ_REPLY GAP_SetParamValue() with GAP_PARAM_LINK_UPDATE_DECISION
GAP API GAP_DeviceInit, GAPRole_StartDevice, GAPCentralRole_StartDevice
Declaration Change - Use GAP_DeviceInit() with parameter for roles desired
See GAP_PROFILE_BROADCASTER
GAP_PROFILE_OBSERVER GAP_PROFILE_PERIPHERAL GAP_PROFILE_CENTRAL
GAP API GAPRole_RegisterAppCBs Obsolete - Functionality moved to GAPBondMgr_Register()
GAP API GAP_SetAdvToken Obsolete - Advertisement Sets are Used
GAP API GAP_GetAdvToken Obsolete - Advertisement Sets are Used
GAP API GAP_RemoveAdvToken Obsolete - Advertisement Sets are Used
GAP API GAP_UpdateAdvTokens Obsolete - Advertisement Sets are Used
GAP API GAPRole_SendUpdateParam, GAPCentralRole_UpdateLink GAP_UpdateLinkParamReq()
GAP API GAP_MakeDiscoverable GapAdv_enable()
GAP API GAP_UpdateAdvertisingData
Various API:
GapAdv_loadByBuffer() GapAdv_loadByHandle() GapAdv_prepareLoadByBuffer() GapAdv_prepareLoadByHandle() GapAdv_getBuffer()
GAP API GAP_EndDiscoverable GapAdv_disable()
GAP API GAP_DeviceDiscoveryRequest, GAPCentralRole_StartDiscovery GapScan_enable()
GAP API GAP_DeviceDiscoveryCancel, GAPCentralRole_CancelDiscovery GapScan_disable()
GAP API GAP_ResolvePrivateAddr Obsolete - Address Resolution is done controller
GAP API GAP_EstablishLinkReq, GAPCentralRole_EstablishLink GapInit_connect(), or GapInit_connectWl() to use whitelist
GAP API GAP_TerminateLinkReq, GAPRole_TerminateConnection, GAPCentralRole_TerminateLink GapInit_cancelConnect() for connection request, GAP_TerminateLinkReq() otherwise
GAP API GAP_ConfigDeviceAddr No Changes; now the only way to set address and address type across modules
GAP CB gapRolesParamUpdateCB_t, paramUpdateAppDecision_t, passThroughToApp_t These are handled through GAP_UPDATE_LINK_PARAM_REQ_EVENT, applies to the L2CAP Parameter Update Procedure as well.
GAP CB gapRolesStateNotify_t, pfnGapCentralRoleEventCB_t Moved into GAP Bond Manager callbacks, gapBondCBs_t
Table 17. GAP Bond Manager Changes
Previous Implementation New/Current implementation
Type Name Description / API / Parameter
GAPBOND PARAM GAPBOND_DEFAULT_PASSCODE Use pfnPasscodeCB_t, shared default passcode defined in bcomdef.h B_APP_DEFAULT_PASSCODE
GAPBOND PARAM GAPBOND_REMOTE_OOB_SC_ENABLED Obsolete
GAPBOND PARAM GAPBOND_REMOTE_OOB_SC_DATA Obsolete
GAPBOND PARAM GAPBOND_LOCAL_OOB_SC_ENABLED Obsolete
GAPBOND PARAM GAPBOND_LOCAL_OOB_SC_DATA Obsolete
GAPBOND STATE GAPBOND_PAIRING_STATE_BONDED GAPBOND_PAIRING_STATE_ENCRYPTED
GAPBOND DEF GBM_QUEUE_PAIRINGS Removed, is now default behavior
GAPBOND DEF GBM_GATT_NO_CLIENT Configured by GATT_NO_CLIENT
GAPBOND DEF SNP_SECURITY Configured by GAPBONDMGR_NO_SIGNING
GAPBOND API GAPBondMgr_LinkEst Removed Application Access to API Handled Internally
GAPBOND API GAPBondMgr_LinkTerm Removed Application Access to API Handled Internally
GAPBOND API GAPBondMgr_SlaveReqSecurity GAPBondMgr_Pair(), allowing both masters and slaves to request pairing
GAPBOND API GAPBondMgr_UpdateCharCfg Removed Application Access to API Handled Internally
GAPBOND API GAPBondMgr_ReadGattChar Removed Application Access to API Handled Internally
GAPBOND API GAPBondMgr_SupportsEnhancedPriv Removed Application Access to API Handled Internally
GAPBOND API GAPBondMgr_CheckNVLen Removed Application Access to API Handled Internally
GAPBOND API GAPBondMgr_syncResolvingList Removed Application Access to API Handled Internally
Table 18. GAP GATT Server Changes
Previous Implementation New/Current implementation
Type Name Description / API / Parameter
GGS PARAM GGS_PERI_PRIVACY_FLAG_ATT Obsolete
GGS PARAM GGS_RECONNCT_ADDR_ATT Obsolete
GGS PARAM GGS_PERI_PRIVACY_FLAG_PROPS Obsolete
GGS PARAM GGS_W_PERMIT_PRIVACY_FLAG_ATT Obsolete
GGS PARAM GGS_TESTMODE_W_PERMIT_PRIVACY_FLAG Obsolete
Table 19. Link Database Changes
Previous Implementation New/Current implementation
Type Name Description / API / Parameter
LinkDB API linkDB_Remove API now accepts linkDBInfo_t in addition to connection handle
Table 20. Sample Simple Peripheral App Changes
Previous Implementation BLE5-Stack 1.01.01 Implementation
SimpleBLEPeripheral_processStateChangeEvt See SimplePeripheral_processGapMessage
SimpleBLEPeripheral_processAppMsg Different events are now being handled. See SimplePeripheral_processAppMsg
SimpleBLEPeripheral_processStackMsg
See the guide’s step to Replace GAP Event processing
This is modified to process GAP_MSG_EVENT
SimpleBLEPeripheral_stateChangeCB gapRolesCBs_t SimpleBLEPeripheral_gapRoleCBs
See the guide’s step to Replace GAP Event processing
This is no longer used. GAP events are now returned to the application directly as the RTOS event, GAP_MSG_EVENT
GAP_SetParamValue(TGAP_CONN_PAUSE_PERIPHERAL, DEFAULT_CONN_PAUSE_PERIPHERAL) GAP_UpdateLinkParamReq()
GAPRole_SetParameter(GAPROLE_ADVERT_ENABLED, sizeof(uint8_t),&initialAdvertEnable) In SimplePeripheral_processGapMessage by GapAdv_enable()
GAPRole_SetParameter(GAPROLE_ADVERT_OFF_TIME, sizeof(uint16_t),&advertOffTime) In SimplePeripheral_processGapMessage by GapAdv_enable(). Configured by the third parameter durationOrMaxEvents
GAPRole_SetParameter(GAPROLE_SCAN_RSP_DATA, sizeof(scanRspData),scanRspData) In SimplePeripheral_processGapMessage by GapAdv_loadByHandle(). with GAP_ADV_DATA_TYPE_SCAN_RSP set as the data type
GAPRole_SetParameter(GAPROLE_ADVERT_DATA, sizeof(advertData), advertData) In SimplePeripheral_processGapMessage by GapAdv_loadByHandle() with GAP_ADV_DATA_TYPE_ADV set as the data type
GAPRole_SetParameter(GAPROLE_PARAM_UPDATE_ENABLE, sizeof(uint8_t), &enableUpdateRequest) In SimplePeripheral_processGapMessage, parameter updates from a central device are handled in GAP_UPDATE_LINK_PARAM_REQ_EVENT and uses GAP_UpdateLinkParamReqReply()
GAPRole_SetParameter(GAPROLE_MIN_CONN_INTERVAL, sizeof(uint16_t), &desiredMinInterval) In SimplePeripheral_processParamUpdate, set as DEFAULT_DESIRED_MIN_CONN_INTERVAL and applied with GAP_UpdateLinkParamReq()
GAPRole_SetParameter(GAPROLE_MAX_CONN_INTERVAL, sizeof(uint16_t), &desiredMaxInterval) In SimplePeripheral_processParamUpdate, set as DEFAULT_DESIRED_MAX_CONN_INTERVAL and applied with GAP_UpdateLinkParamReq()
GAPRole_SetParameter(GAPROLE_SLAVE_LATENCY, sizeof(uint16_t), &desiredSlaveLatency) In SimplePeripheral_processParamUpdate, set as DEFAULT_DESIRED_SLAVE_LATENCY and applied with GAP_UpdateLinkParamReq()
GAPRole_SetParameter(GAPROLE_TIMEOUT_MULTIPLIER, sizeof(uint16_t), &desiredConnTimeout) In SimplePeripheral_processParamUpdate, set as DEFAULT_DESIRED_CONN_TIMEOUT and applied with GAP_UpdateLinkParamReq()
GAP_SetParamValue(TGAP_LIM_DISC_ADV_INT_MIN, advInt) GAP_SetParamValue(TGAP_GEN_DISC_ADV_INT_MIN, advInt) GapAdv_setParam() with GAP_ADV_PARAM_PRIMARY_INTERVAL_MIN
GAP_SetParamValue(TGAP_LIM_DISC_ADV_INT_MAX, advInt) GAP_SetParamValue(TGAP_GEN_DISC_ADV_INT_MAX, advInt) GapAdv_setParam() with GAP_ADV_PARAM_PRIMARY_INTERVAL_MAX
GAPBondMgr_SetParameter(GAPBOND_DEFAULT_PASSCODE, sizeof(uint32_t), &passkey) Use pfnPasscodeCB_t, shared default passcode defined in bcomdef.h B_APP_DEFAULT_PASSCODE
GAPROLE_STATE Obsolete - GAP changes remove the need for this
GAPROLE_CONNHANDLE Returned for each GAP event