NRF9160 DK sending "MAC address" while advertising

Hii 

I have  a problem pass the address  while advertising

I should pass the adress using 9160_dk

However, in main.c there is this line:

#define DEVICE_NAME "Nordic_UART" /*

but i should pass mac address like

#define DEVICE_NAME NRF_FICR->DEVICEADDR1

but they can  not  take  the NRF_FICR->DEVICEADDR1 so what should do 

  • How advertising the mac address
  • How should   NRF_FICR->DEVICEADDR1 will used   from  CONFIG_BT_DEVICE_NAME..
  • They should not take NRF_FICR in 
  • #define NRF_FICR->DEVICEADDR1
    • I will used 
    • char strDeviceNAME[20];
    • int demo = NRF_FICR->DEVICEADDR1;
           sprintf(strDeviceName,"%x",demo); 
      #define DEVICE_NAME strDeviceName so that is not taken  the device name  
      how should do that 
                 

Parents
  • Hi,

    May I ask why you want to send the Bluetooth address as the device name (The address is part of the advertising packet header after all)?

    That aside, you cannot do this statically in the configuration (CONFIG_BT_DEVICE_NAME sets the device name build time), as you need to read it runtime. What you could do is to read using bt_id_get(), and use it to set the device name as explained in this post, using bt_set_name(). Note that you must add CONFIG_BT_DEVICE_NAME_DYNAMIC=y to your prj.conf in order to do this.

Reply
  • Hi,

    May I ask why you want to send the Bluetooth address as the device name (The address is part of the advertising packet header after all)?

    That aside, you cannot do this statically in the configuration (CONFIG_BT_DEVICE_NAME sets the device name build time), as you need to read it runtime. What you could do is to read using bt_id_get(), and use it to set the device name as explained in this post, using bt_set_name(). Note that you must add CONFIG_BT_DEVICE_NAME_DYNAMIC=y to your prj.conf in order to do this.

Children
Related