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

BLE MAC address

Dear Team,
Can we change MAC address of nRF 5340 pdk/dk development board or it is fixed?

Parents
  • Hi,

    You can set the BT address using bt_id_create(). For instance, like this to set the address to DE:AD:BE:EF:BA:11:

    	int err;
    	bt_addr_le_t addr;
    
    	err = bt_addr_le_from_str("DE:AD:BE:EF:BA:11", "random", &addr);
    	if (err) {
    		printk("Invalid BT address (err %d)\n", err);
    	}
    
    	err = bt_id_create(&addr, NULL);
    	if (err < 0) {
    		printk("Creating new ID failed (err %d)\n", err);
    	}

    Note that this must be done before enabling bluetooth.

Reply
  • Hi,

    You can set the BT address using bt_id_create(). For instance, like this to set the address to DE:AD:BE:EF:BA:11:

    	int err;
    	bt_addr_le_t addr;
    
    	err = bt_addr_le_from_str("DE:AD:BE:EF:BA:11", "random", &addr);
    	if (err) {
    		printk("Invalid BT address (err %d)\n", err);
    	}
    
    	err = bt_id_create(&addr, NULL);
    	if (err < 0) {
    		printk("Creating new ID failed (err %d)\n", err);
    	}

    Note that this must be done before enabling bluetooth.

Children
Related