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

Unable to print BLE devices Complete local Name?

Hi, I am trying to print ble device names around my board by scanning and i am able to print some devices and i am unable to print other device names even though they are advertising but by printing through device address i am able to print all the devices addresses,even though it has complete local name available i am unable to print it's name.

please tell me why if i print addresses i am able to see that device but why not by printing device name?? Thank you

  • yes i am able to find device addresses but not device names.In nRF-Connect i can see device name also of those devices.

  • Did you enter a m_target_periph_name (line 143 in main.c)? If not, the example will by default not look for the name.

  • yes i entered m_target_periph_name if not how can i enter into find_adv_name function and able to print other device names.i am able to print device names of some devices and not other devices like prontos and remotes even though it advertises it's complete local name these devices i am able to see their device names in nRF-Connect but not through board.

  • Hi,

    The device name can be located in either the regular advertising packet, or the scan response packet. If it’s located in the scan response packet, you must turn on active scanning in order to find the name.

    In the function scan_start() in main.c, change

    m_scan_param.active   = 0;
    

    to

    m_scan_param.active   = 1;
    
  • Hi Sigurd,

    When i enabled m_scan_param.active = 1 i was getting data(i.e device name and address )2 times.

    <info> app: Starting scan.
    <info> app: ADDRESS=D0:5F:B8:22:6:14
    <info> app: DEVICE NAME:Pronto
    <info> app: ADDRESS=D0:5F:B8:22:6:14
    <info> app: DEVICE NAME:Pronto
    <info> app: ADDRESS=D0:5F:B8:21:FA:C4
    

    app: ADDRESS=63:F8:3C:FE:CA:B9 app: DEVICE NAME:Sankeerthan app: ADDRESS=48:3:D:C8:A7:EE app: DEVICE NAME:Sankeerthan app: ADDRESS=48:3:D:C8:A7:EE

    And when i disabled m_scan_param.active = 0 i was getting data only once i.e advertising packet but some devices are not advertising their name through advertising packet.

    <info> app: Starting scan.
    <info> app: ADDRESS=D0:5F:B8:21:FA:C4
    <info> app: ADDRESS=D0:5F:B8:22:6:14
    <info> app: DEVICE NAME:Sankeerthan
    <info> app: ADDRESS=6D:63:15:58:38:5A
    

    You can see above only address are being printed but not names but in 1st picture names are also being printed but 2 times.

    I think i should disable advertising packet data and active scan response packet either one should be active.

    Please suggest me how can i correct it??

    Thank you.

Related