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

S120/S130 scan, getting client device friendly name

Hi all,

I am using S130 in scanning mode and I would like to list the devices that are currently advertising by their friendly name. I have access to p_ble_evt via BLE_GAP_EVT_ADV_REPORT but I'm stuck trying to find out which field in the nested structure holds the BLE client friendly name.

Any help is appreciated! florin

Parents
  • Have you tried the adv_report_parse() function found in the ble_app_hrs_c S120 example in SDK 7.1.0?

    I haven't tested it myself, but hopefully you can use it with the appropriate BLE_GAP_AD_TYPE_DEFINITIONS, for example BLE_GAP_AD_TYPE_SHORT_LOCAL_NAME or BLE_GAP_AD_TYPE_COMPLETE_LOCAL_NAME.

    Please add a comment if you get into trouble.

  • Hi Petter, sorry for the late response. The scan doesn't receive any of the definitions you've listed. I'm getting the following:

    BLE_GAP_AD_TYPE_APPEARANCE
    BLE_GAP_AD_TYPE_FLAGS
    BLE_GAP_AD_TYPE_TX_POWER_LEVEL
    BLE_GAP_AD_TYPE_128BIT_SERVICE_UUID_COMPLETE (I'm broadcasting a 128bit uuid)
    

    I have access to the ble_evt_t data structure and I think the friendly name is buried there somewhere. The struct is quite nested and gdb freezes in its attempt to list it. I can give you more details if needed.

    florin

Reply
  • Hi Petter, sorry for the late response. The scan doesn't receive any of the definitions you've listed. I'm getting the following:

    BLE_GAP_AD_TYPE_APPEARANCE
    BLE_GAP_AD_TYPE_FLAGS
    BLE_GAP_AD_TYPE_TX_POWER_LEVEL
    BLE_GAP_AD_TYPE_128BIT_SERVICE_UUID_COMPLETE (I'm broadcasting a 128bit uuid)
    

    I have access to the ble_evt_t data structure and I think the friendly name is buried there somewhere. The struct is quite nested and gdb freezes in its attempt to list it. I can give you more details if needed.

    florin

Children
No Data
Related