Beware that this post is related to an SDK in maintenance mode
More Info: Consider nRF Connect SDK for new designs
This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

Change Bluetooth identity address

Hi,

I use nRF5 SDK v15.0.0. In my application I need to change Bluetooth identity address. I can not use BLE_GAP_ADDR_TYPE_RANDOM_STATIC address type, because I need to change all the bytes and want to show our own MAC address. I use BLE_GAP_ADDR_TYPE_PUBLIC address type. After that I can connect to device using "nRF Connect" but I can not connect to device when I use our own mobile application. Using "nRF Connect" I see that my device type changed from "Le only" to "CLASSIC and  LE". Is the change to public also changes the advertising channel to Dual Mode?  Can please explain this part in detail?  And also can we use public address which will only advertise in "LE only" channel? 

Thanks.

Parents
  • Hi,

    I see that my device type changed from "Le only" to "CLASSIC and  LE"

    Did you change anything else? It's the advertisement Flag AD type that sets the device type. In many of the BLE examples in the SDK you will see that it's set to BLE_GAP_ADV_FLAGS_LE_ONLY_GENERAL_DISC_MODE.

    Snippet:

    static void advertising_init(void)
    {
        ret_code_t             err_code;
        ble_advertising_init_t init;
    
        memset(&init, 0, sizeof(init));
    
        init.advdata.name_type               = BLE_ADVDATA_FULL_NAME;
        init.advdata.include_appearance      = true;
        init.advdata.flags                   = BLE_GAP_ADV_FLAGS_LE_ONLY_GENERAL_DISC_MODE;

Reply
  • Hi,

    I see that my device type changed from "Le only" to "CLASSIC and  LE"

    Did you change anything else? It's the advertisement Flag AD type that sets the device type. In many of the BLE examples in the SDK you will see that it's set to BLE_GAP_ADV_FLAGS_LE_ONLY_GENERAL_DISC_MODE.

    Snippet:

    static void advertising_init(void)
    {
        ret_code_t             err_code;
        ble_advertising_init_t init;
    
        memset(&init, 0, sizeof(init));
    
        init.advdata.name_type               = BLE_ADVDATA_FULL_NAME;
        init.advdata.include_appearance      = true;
        init.advdata.flags                   = BLE_GAP_ADV_FLAGS_LE_ONLY_GENERAL_DISC_MODE;

Children
Related