This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

CC2652R: Set BLE Address via HCI

Part Number: CC2652R

Hello,

I have a customer trying to set their own BLE address via the HCI_EXT_SetBDADDRCmd API.

Before GAP initialization, the customer is issuing the HCI_EXT_SetBDADDRCmd and getting a HCI_EXT_SetBDADDRDone event.

GAP device init is called with GAP_PROFILE_BROADCASTER | GAP_PROFILE_CENTRAL, and ADDRMODE_PUBLIC.

The received GAP_DeviceInitDone event though shows an address different from what was set via the HCI_EXT_SetBDADDRCmd.

Is there a recommended sequence to set the BLE address via HCI? Or is this feature not supported in the stack today?

Regards,
Munan

  • Also, is there an alternate way to check the BLE address outside of the GAP Device Init?

    Munan

  • Hi Munan,

    I believe previous code examples on this had invoked the HCI_EXT_SetBDADDRCmd after the Icall_registerApp function in the initialization function. Here is a code snippet where I have tested this out in the simple_peripheral example, and had no issues changing the public device address:

    static void SimplePeripheral_init(void)
    {
      BLE_LOG_INT_TIME(0, BLE_LOG_MODULE_APP, "APP : ---- init ", SP_TASK_PRIORITY);
      // Create the menu
      SimplePeripheral_buildMenu();
    
      // ******************************************************************
      // N0 STACK API CALLS CAN OCCUR BEFORE THIS CALL TO ICall_registerApp
      // ******************************************************************
      // Register the current thread as an ICall dispatcher application
      // so that the application can send and receive messages.
      ICall_registerApp(&selfEntity, &syncEvent);
    
      uint8 bdAddress[B_ADDR_LEN] = { 0x11, 0x11, 0x11, 0x11, 0x11, 0x11 };
      HCI_EXT_SetBDADDRCmd(bdAddress);
    
    #ifdef USE_RCOSC
      // Set device's Sleep Clock Accuracy
    #if ( HOST_CONFIG & ( CENTRAL_CFG | PERIPHERAL_CFG ) )
      HCI_EXT_SetSCACmd(500);
    #endif // (CENTRAL_CFG | PERIPHERAL_CFG)
      RCOSC_enableCalibration();
    #endif // USE_RCOSC
    
      // Create an RTOS queue for message from profile to be sent to app.
      appMsgQueueHandle = Util_constructQueue(&appMsgQueue);
    
      // Create one-shot clock for internal periodic events.
      Util_constructClock(&clkPeriodic, SimplePeripheral_clockHandler,
                          SP_PERIODIC_EVT_PERIOD, 0, false, (UArg)&argPeriodic);
    
    ...

    Highlighted lines show added code.

    Are there any BLE Stack initialization function calls (e.g. GATT, GAP bond manager, etc..) the customer is performing before changing the device address? 

    In regards to checking the BLE address, you can issue call the HCI_ReadBDADDRCmd function and it will return the BLE address of the device.

    Regards,
    Michael