|
| 1 | +@@ -31,22 +31,19 @@ |
| 2 | + bool BluedroidGetChipDeviceInfo(esp_ble_gap_cb_param_t & scan_result, chip::Ble::ChipBLEDeviceIdentificationInfo & deviceInfo) |
| 3 | + { |
| 4 | + // Check for CHIP Service UUID |
| 5 | +- if (scan_result.scan_rst.ble_adv != NULL) |
| 6 | ++ if (scan_result.scan_rst.adv_data_len > 13 && scan_result.scan_rst.ble_adv[5] == 0xf6 && |
| 7 | ++ scan_result.scan_rst.ble_adv[6] == 0xff) |
| 8 | + { |
| 9 | +- if (scan_result.scan_rst.adv_data_len > 13 && scan_result.scan_rst.ble_adv[5] == 0xf6 && |
| 10 | +- scan_result.scan_rst.ble_adv[6] == 0xff) |
| 11 | +- { |
| 12 | +- deviceInfo.OpCode = scan_result.scan_rst.ble_adv[7]; |
| 13 | +- deviceInfo.DeviceDiscriminatorAndAdvVersion[0] = scan_result.scan_rst.ble_adv[8]; |
| 14 | +- deviceInfo.DeviceDiscriminatorAndAdvVersion[1] = scan_result.scan_rst.ble_adv[9]; |
| 15 | +- // vendor and product Id from adv |
| 16 | +- deviceInfo.DeviceVendorId[0] = scan_result.scan_rst.ble_adv[10]; |
| 17 | +- deviceInfo.DeviceVendorId[1] = scan_result.scan_rst.ble_adv[11]; |
| 18 | +- deviceInfo.DeviceProductId[0] = scan_result.scan_rst.ble_adv[12]; |
| 19 | +- deviceInfo.DeviceProductId[1] = scan_result.scan_rst.ble_adv[13]; |
| 20 | +- deviceInfo.AdditionalDataFlag = scan_result.scan_rst.ble_adv[14]; |
| 21 | +- return true; |
| 22 | +- } |
| 23 | ++ deviceInfo.OpCode = scan_result.scan_rst.ble_adv[7]; |
| 24 | ++ deviceInfo.DeviceDiscriminatorAndAdvVersion[0] = scan_result.scan_rst.ble_adv[8]; |
| 25 | ++ deviceInfo.DeviceDiscriminatorAndAdvVersion[1] = scan_result.scan_rst.ble_adv[9]; |
| 26 | ++ // vendor and product Id from adv |
| 27 | ++ deviceInfo.DeviceVendorId[0] = scan_result.scan_rst.ble_adv[10]; |
| 28 | ++ deviceInfo.DeviceVendorId[1] = scan_result.scan_rst.ble_adv[11]; |
| 29 | ++ deviceInfo.DeviceProductId[0] = scan_result.scan_rst.ble_adv[12]; |
| 30 | ++ deviceInfo.DeviceProductId[1] = scan_result.scan_rst.ble_adv[13]; |
| 31 | ++ deviceInfo.AdditionalDataFlag = scan_result.scan_rst.ble_adv[14]; |
| 32 | ++ return true; |
| 33 | + } |
| 34 | + return false; |
| 35 | + } |
0 commit comments