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.

How to Change the MAC address of my device ? is it possible ? cc254x

Other Parts Discussed in Thread: CC2541

I worked on nordic board nrf51 an i succeeded to change my Bluetooth mac @ and its type in the soft. 

Is that possible on TI boards too ?

(i work on the CC2541  , simpleBLECentral !,satck 1.4.2.2)

  • Hi ToTo,

    You should be able to change the GAPCENTRALROLE_BD_ADDR by using GAPCentralRole_SetParameter().

    Cheers,
    Marie H
  • #define GAPCENTRALROLE_BD_ADDR 0x403 //!< Device's Address. Read Only. Size is uint8[B_ADDR_LEN]. This item is read from the controller.
    It's used for getting the @ not to set. It's used for GAPCentralRole_GetParameter !!

    :/ I looked GAPCentralRole_SetParameter, there is no case that treats the @ changing
  • Hi ToTo,

    My bad, you're right. You should be able to use GAP_ConfigDeviceAddr() (see gap.h) or even HCI_EXT_SetBDADDRCmd().

    Cheers,
    Marie
  • Ok i used it , and first time it returned 0x10, i tried to change the place wher ei use it, it returned 0x00 but the @ didn't change to theone i have set.
    It's strange, but thanks for you help, it's the right API i'm looking for so i click verified answer
  • Hi ToTo,

    Using HCI_EXT_SetBDADDRCmd I have no problem setting the address. I simply declare my address under Local variables:

    static uint8 newCentralAddress[6] = {(0x12), (0x12), (0x12), (0x12), (0x12), (0x12)}; 

    then call the function in  init:

      // Setup Central Profile
      {
        uint8 scanRes = DEFAULT_MAX_SCAN_RES;
        GAPCentralRole_SetParameter ( GAPCENTRALROLE_MAX_SCAN_RES, sizeof( uint8 ), &scanRes );
        HCI_EXT_SetBDADDRCmd(newCentralAddress);
      }

  • For the other guys that they faced the same problem as me , i want to clarify that the first time i used GAP_ConfigDeviceAddr() which allows more than changing the @ to choosing it's type( public , random...) but it didn't work although it returns SUCCESS. That's strange. Now i used the API as Marie clarified here and it works well. I click verify then (y) . Marie i hope you can tell me just if you used the other API "GAP_ConfigDeviceAddr()" before and it worked so in case i want to change @ type i can then do use it me too.
  • Hi ToTo,

    How do you check the address after calling GAP_ConfigDeviceAddr()? ( The line

    LCD_WRITE_STRING( bdAddr2Str( pEvent->initDone.devAddr ),  HAL_LCD_LINE_2 );

    will write the initial address to the LCD screen even if you successfully changed it.)

  • What i did is : use the API GAP_ConfigDeviceAddr() and check what it returns (SUCCESS) . by doing a break point.
    Then i do use the device for establishing a connection , the @ didn't change (i have Packet sniffer and dongle). I used the other API HCI_... and it works (i saw that on the Packet Sniffer )

    i don't use LCD. i commented all stuff about it

  • Hi ToTo,

    I am able to change the central address with GAP_ConfigDeviceAddr(). To be specific, I am calling it in the GAP_DEVICE_INIT_DONE_EVENT of simpleBLECentralEventCB(), and I use the addresstype ADDRTYPE_STATIC.
  • Ok , understood. Then i'll try it and come back to you to give a feedback. (y)
    Thanks in advance
  • it's ok (y) thanks. Answer verified