3 Replies Latest reply on Sep 22, 2020 1:50 AM by XinghaoZ_26

    CYBT-343026 : How can I get BLE Scan device name?

    Neeraj Dhekale

      Hello,

       

      I am able to scan all nearby devices with RSSI but I want to fetch their local name of BLE. How can I get the local name?

       

      Below is my code:

       

      void scanResult(wiced_bt_ble_scan_results_t *p_scan_result, uint8_t *p_adv_data)

      {

      //   uint8_t mfgLen;

         // uint8_t* mfgData = wiced_bt_ble_check_advertising_data( p_adv_data,0xFF,&mfgLen);

          WICED_BT_TRACE("Found device %d ",p_scan_result->rssi);

          if(p_scan_result->rssi>-80){

          uint8_t index=0;

          int fieldLength=p_adv_data[index];

          do {

              for(int i=0;i<=fieldLength;i++)

                  WICED_BT_TRACE("%02X ",p_adv_data[index+i]);

       

              index = index + fieldLength + 1;

              fieldLength = p_adv_data[index];

          } while(fieldLength);

          }

          WICED_BT_TRACE("\n");

      }

       

      Thanks in advance.

       

      Regards,

      Neeraj