This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

Mesh Mac Address

 How to change the Bluetooth Mesh broadcast address?

Use the sd_ble_gap_addr_set function to change the broadcast address of PB-GATTBut PB-ADV still hasn't changed.

Thanks!

  • nRF52840

    nRF5-SDK-for-Mesh V3.1.0:examples | light_switch | clien

    code (main.c):

    static void initialize(void)
    {
        __LOG_INIT(LOG_SRC_APP | LOG_SRC_ACCESS | LOG_SRC_BEARER, LOG_LEVEL_INFO, LOG_CALLBACK_DEFAULT);
        __LOG(LOG_SRC_APP, LOG_LEVEL_INFO, "----- BLE Mesh Light Switch Client Demo -----\n");

        ERROR_CHECK(app_timer_init());
        hal_leds_init();

    #if BUTTON_BOARD
        ERROR_CHECK(hal_buttons_init(button_event_handler));
    #endif

        ble_stack_init();

        ble_gap_addr_t  my_addr;  
        uint32_t        err_code;

        err_code = sd_ble_gap_addr_get(&my_addr);
        APP_ERROR_CHECK(err_code);

        my_addr.addr[5]   = 0x00;
        my_addr.addr[4]   = 0xEE;
        my_addr.addr[3]   = 0xDD;
        my_addr.addr[2]   = 0xCC;
        my_addr.addr[1]   = 0xBB;
        my_addr.addr[0]   = 0xAA;

        my_addr.addr_type = BLE_GAP_ADDR_TYPE_PUBLIC;

        err_code = sd_ble_gap_addr_set(&my_addr);
        APP_ERROR_CHECK(err_code);

    #if MESH_FEATURE_GATT_ENABLED
        gap_params_init();
        conn_params_init();
    #endif    

        mesh_init();
    }
  • Hi WindJ, 

    The mesh stack doesn't use the softdevice for advertising bearer. To set the address for Bluetooth Mesh adv packet you should use advertiser_address_set() . It's the function inside advertiser.c 

  • Hi Hung,

    Is there a function that can be called to set the device's bluetooth address across all roles and PDUs?

    I would like to set the MAC addresses on my devices to an IEEE-registered public device address. Right now the new MAC address is placed in the UICR->CUSTOMER registers (as suggested here: https://devzone.nordicsemi.com/f/nordic-q-a/20310/public-static-ble-address/79125#79125). And I want all BLE packets sent from the device to use this MAC address.

    Thanks,

    -Thomas

  • Hi Thomas, 
    Please open a new case for your request. We would need to have more information about your application, if you doing mesh and/or BLE (proxy). 

Related