Extract Device name from Reflector in CS

Hi,

I am struggling a bit on how to correctly extract the device name of the reflector, which is present in the Advertisement Data.

The code that i have down below shows this result:    

Kind regards,

Nick De Leenheer



Parents
  • Hi,

    The implementation assumes that the device name is null terminated ('\0'), so the logger continues printing from memory until it reaches the first zero byte. You can consider copying the name to another buffer:

    uint8_t device_name[BT_GAP_ADV_MAX_ADV_DATA_LEN] = {0};
    
    ...
    
    memcpy(device_name, reflector_name, MIN(len, (BT_GAP_ADV_MAX_ADV_DATA_LEN - 1)))
    
    

    Maybe you've seen it already, but just want to add that there is already a helper function named bt_data_parse() that can be used to find the device name from the advertisement packet.

    Best regards,

    Vidar

  • Hi,

    Thank you very much! Using the bt_data_parse() made it work cleanly. :)


    I have only 2 more question for this topic left:

    1. I have seen that the Public "sdk-nrf" GitHub repository has update its Channel sounding sample. I wanted to try this out, because they now have implemented the IFFT algorithm asswell it seems, appart from the Phase slope. But when i wanted to test this, i got some errors. So I was curious if this still needs to be worked on and debugged, or if its a problem just for me.

    2. I think i now fully understand how the filters work... But when i try this code, they won't connect:


    Kind regards,

    Nick De Leenheer

Reply
  • Hi,

    Thank you very much! Using the bt_data_parse() made it work cleanly. :)


    I have only 2 more question for this topic left:

    1. I have seen that the Public "sdk-nrf" GitHub repository has update its Channel sounding sample. I wanted to try this out, because they now have implemented the IFFT algorithm asswell it seems, appart from the Phase slope. But when i wanted to test this, i got some errors. So I was curious if this still needs to be worked on and debugged, or if its a problem just for me.

    2. I think i now fully understand how the filters work... But when i try this code, they won't connect:


    Kind regards,

    Nick De Leenheer

Children
No Data
Related