BLE5-Stack 1.02.00 to BLE5-Stack 1.02.01

This section will describe a way to migrate a project from BLE5-Stack 1.02.00 to a BLE5-Stack 1.02.01 project.

For this migration guide, simple_peripheral from BLE5-Stack 1.02.00 will be ported over to BLE5-Stack 1.02.01. Because the directory structure is nearly identical between the two releases, the recommended approach is to start with a BLE5-Stack 1.02.01 project that contains the same base functionality as the porting target project and merge in any custom functionality.

  1. Choose a BLE5-Stack 1.02.01 example project that contains your target project’s base functionality.

    For reference, see available sample projects that start with simple_

    In this example, we’re going to use simple_peripheral as the starting BLE5-Stack 1.02.01 sample project.

  2. Transfer all modified application files from BLE5-Stack 1.02.00 into the BLE5-Stack 1.02.01 example project.

    In this example, the following files from BLE5-Stack 1.02.00 were moved into simple_peripheral BLE5-Stack 1.02.01 example:

    • simple_peripheral.c
    • simple_peripheral.h
    • simple_gatt_profile.c
    • simple_gatt_profile.h
  3. Modify main.c in the BLE5-Stack 1.02.01 example if additional tasks were added in the BLE5-Stack 1.02.00 project.

  4. Addition of privacy features to sample applications

    The sample applications included in the SDK now have Privacy enabled by default. The following changes have been introduced in BLE5-Stack 1.02.01 to the simple_peripheral project in simple_peripheral.c.

    The address mode has been modified to always use Resolvable Private Address with Public Identity Address shown below.

    #define DEFAULT_ADDRESS_MODE                  ADDRMODE_RP_WITH_PUBLIC_ID
    

    Attention

    The following instructions influence multi_role and simple_central or projects in which there is a central device.

    A few of the other sample applications such as multi_role and simple_central have other changes that can influence the behavior of the application. For example, in simple_central.c there is now a Pair State Data struct to handle an additional callback in the GapBondMgr.

    // Container to store paring state info when passing from gapbondmgr callback
    // to app event. See the pfnPairStateCB_t documentation from the gapbondmgr.h
    // header file for more information on each parameter.
    typedef struct
    {
      uint16_t connHandle;
      uint8_t  status;
    } scPairStateData_t;
    

    Also, when pairing the device now needs to determine if the peer device was using a private address and update the connection list with the Public ID address.

    static void SimpleCentral_processPairState(uint8_t state,
                                       scPairStateData_t* pPairData)
    {
      uint8_t status = pPairData->status;
    
      if (state == GAPBOND_PAIRING_STATE_STARTED)
      {
        Display_printf(dispHandle, SC_ROW_CUR_CONN, 0, "Pairing started");
      }
      else if (state == GAPBOND_PAIRING_STATE_COMPLETE)
      {
        if (status == SUCCESS)
        {
          linkDBInfo_t linkInfo;
    
          Display_printf(dispHandle, SC_ROW_CUR_CONN, 0, "Pairing success");
    
          if (linkDB_GetInfo(pPairData->connHandle, &linkInfo) == SUCCESS)
          {
            // If the peer was using private address, update with ID address
            if ((linkInfo.addrType == ADDRTYPE_PUBLIC_ID ||
                 linkInfo.addrType == ADDRTYPE_RANDOM_ID) &&
                 !Util_isBufSet(linkInfo.addrPriv, 0, B_ADDR_LEN))
            {
              // Update the address of the peer to the ID address
              Display_printf(dispHandle, SC_ROW_NON_CONN, 0, "Addr updated: %s",
                             Util_convertBdAddr2Str(linkInfo.addr));
    
              // Update the connection list with the ID address
              uint8_t i = SimpleCentral_getConnIndex(pPairData->connHandle);
    
              SIMPLECENTRAL_ASSERT(i < MAX_NUM_BLE_CONNS);
              memcpy(connList[i].addr, linkInfo.addr, B_ADDR_LEN);
            }
          }
        }
    
  5. If necessary, update the project to use the newer TI-RTOS drivers that are supplied with the SimpleLink CC13x2 / 26x2 SDK.

    The following drivers have changed from BLE5-Stack 1.02.00. Please see the changes to these drivers by comparing the supplied headers between those in the SimpleLink CC26x2 SDK v2.10.00.44 and those in the latest SimpleLink CC26x2S SDK.

    • Power: The Power Policy Manager has had minor changes to #defines provided.
  6. Refer to the Core SDK release notes for additional information and the TI-RTOS examples included with SimpleLink CC13x2 / 26x2 SDK.

    For additional information on how BLE5-Stack 1.02.01 uses TI-RTOS see TI-RTOS (RTOS Kernel) Overview

    For any utilized TI Drivers, review TI-RTOS Kernel Users Guide and Driver APIs.

  7. Other porting concerns

    For other porting concerns, we recommend that the developer do a diff between an example that most closely resembles the functionality of your application from the latest SimpleLink CC26x2 SDK and the same example from the SimpleLink CC26x2 SDK v2.10.00.44 to see all potential changes.