Porting BLE-Stack to BLE5-Stack

This section will describe how to port from a BLEStack project to a BLE5Stack project.

Note

This example is specifically for CC2640R2 BLE-Stack 3.01.01/BLE5-Stack to to CC26x2 BLE5-Stack 1.02.00 but the steps are similar for all cases. Individual differences can be found in the relevant :ref:’Porting Guides’

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 2.10 (BLE5-Stack 1.02.00) BLE5-Stack 1.02.00 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.02.00.

See the following tables for API replacements:

Porting Steps

To minimize project configuration differences, start with an example project in the CC26x2 SDK 2.10 (BLE5-Stack 1.02.00). For example, if your base project was simple_peripheral in BLE-Stack 3.01.01, use simple_peripheral in BLE5-Stack 1.02.00 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.02.00 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.02.00 example project and open it in the preferred supported IDE

    We’re going to use simple_peripheral as the starting BLE5-Stack 1.02.00 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.02.00 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.02.00 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.02.00. 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.02.00 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_ble_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_ble_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_ble_api.h see ICall Translation and Include.

      Warning

      All Stack/ICall APIs are listed in icall_ble_api.h. If any APIs are used without icall_ble_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.02.00 in the snippets below:

    Listing 110. 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 111. 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.

    Prepend LINKDB_ to all constants starting with CONNHANDLE_, for example in simple_gatt_profile.c:

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

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

  8. Note that additional return parameters have been added to HCI_EXT_ConnEventNoticeCmd():

    /**
     * Report describing connection event Returned via a @ref pfnGapConnEvtCB_t.
     */
    typedef struct
    {
      GAP_ConnEvtStat_t     status;   //!< status of connection event
      uint16_t              handle;   //!< connection handle
      uint8_t               channel;  //!< BLE RF channel index (0-39)
      GAP_ConnEvtPhy_t      phy;      //!< PHY of connection event
      int8_t                lastRssi; //!< RSSI of last packet received
      /// Number of packets received for this connection event
      uint16_t              packets;
      /// Total number of CRC errors for the entire connection
      uint16_t              errors;
      /// Type of next BLE task
      GAP_ConnEvtTaskType_t nextTaskType;
      /// Time to next BLE task (in us). 0xFFFFFFFF if there is no next task.
      uint32_t              nextTaskTime;
    } Gap_ConnEventRpt_t;
    
    /** @} End GAP_Structs */
    
  9. Note that additional parameter (signalIdentifier) has been added to GAP_UpdateLinkParamReq:

    /**
     * Establish Link Request parameters
     *
     * This is used by @ref GAP_UpdateLinkParamReq
     */
    typedef struct
    {
      uint16_t connectionHandle; //!< Connection handle of the update
      uint16_t intervalMin;      //!< Minimum Connection Interval
      uint16_t intervalMax;      //!< Maximum Connection Interval
      uint16_t connLatency;      //!< Connection Latency
      uint16_t connTimeout;      //!< Connection Timeout
      uint8_t  signalIdentifier; //!< L2CAP Signal Identifier. Must be 0 for LL Update
    } gapUpdateLinkParamReq_t;
    
  10. HCI_EXT_ConnEventNoticeCmd() has been replaced with Gap_RegisterConnEventCb(). See gap.h for the API description.

API Translation Tables

These tables describe BLE5Stack API replacements for BLEStack API’s.

Table 22. 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 Filter Accept List
GAP API GAP_TerminateLinkReq, GAPRole_TerminateConnection, GAPCentralRole_TerminateLink GapInit_cancelConnect() for connection request, GAP_TerminateLinkReq() otherwise
GAP API GAP_ConfigDeviceAddr Obsolete - Only way to configure the device address is as parameters in GAP_DeviceInit()
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 23. 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 Centrals and Peripherals 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 24. 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 25. 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 26. Sample Simple Peripheral App Changes
Previous Implementation BLE5-Stack 1.02.00 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