82670b96f8
This is a fix for missing scan responses after a first successfull scan. While running the BLE_scan.ino sketch with wantDuplicates=false, i got only one result with correct advertising and scan response length (31,26): pBLEScan->setAdvertisedDeviceCallbacks(new MyAdvertisedDeviceCallbacks(), false); pBLEScan->start(scanTime, false); ... [W][BLEScan.cpp:109] handleGAPEvent(): bytes length: 31 + 26, addr type: 1 All following calls to start() just returned the advertising data without scan response data: pBLEScan->start(scanTime, false); [W][BLEScan.cpp:109] handleGAPEvent(): bytes length: 31 + 0, addr type: 1 With "wantDuplicates=true" i got: pBLEScan->setAdvertisedDeviceCallbacks(new MyAdvertisedDeviceCallbacks(), true); pBLEScan->start(scanTime, false); [W][BLEScan.cpp:109] handleGAPEvent(): bytes length: 31 + 26, addr type: 1 [W][BLEScan.cpp:109] handleGAPEvent(): bytes length: 31 + 26, addr type: 1 [W][BLEScan.cpp:73] handleGAPEvent(): ESP_GAP_SEARCH_INQ_CMPL_EVT Devices found: 1 Scan done! pBLEScan->start(scanTime, false); [W][BLEScan.cpp:109] handleGAPEvent(): bytes length: 31 + 0, addr type: 1 [W][BLEScan.cpp:109] handleGAPEvent(): bytes length: 0 + 26, addr type: 1 [W][BLEScan.cpp:109] handleGAPEvent(): bytes length: 31 + 0, addr type: 1 [W][BLEScan.cpp:109] handleGAPEvent(): bytes length: 0 + 26, addr type: 1 Explicitly initializing m_scan_params.scan_duplicate of BLEScan solves this issue (In my case the un-initialized value was m_scan_params.scan_duplicate == 1073599044). Co-authored-by: Me No Dev <me-no-dev@users.noreply.github.com> |
||
---|---|---|
.. | ||
BLE2902.cpp | ||
BLE2902.h | ||
BLE2904.cpp | ||
BLE2904.h | ||
BLEAddress.cpp | ||
BLEAddress.h | ||
BLEAdvertisedDevice.cpp | ||
BLEAdvertisedDevice.h | ||
BLEAdvertising.cpp | ||
BLEAdvertising.h | ||
BLEBeacon.cpp | ||
BLEBeacon.h | ||
BLECharacteristic.cpp | ||
BLECharacteristic.h | ||
BLECharacteristicMap.cpp | ||
BLEClient.cpp | ||
BLEClient.h | ||
BLEDescriptor.cpp | ||
BLEDescriptor.h | ||
BLEDescriptorMap.cpp | ||
BLEDevice.cpp | ||
BLEDevice.h | ||
BLEEddystoneTLM.cpp | ||
BLEEddystoneTLM.h | ||
BLEEddystoneURL.cpp | ||
BLEEddystoneURL.h | ||
BLEExceptions.cpp | ||
BLEExceptions.h | ||
BLEHIDDevice.cpp | ||
BLEHIDDevice.h | ||
BLERemoteCharacteristic.cpp | ||
BLERemoteCharacteristic.h | ||
BLERemoteDescriptor.cpp | ||
BLERemoteDescriptor.h | ||
BLERemoteService.cpp | ||
BLERemoteService.h | ||
BLEScan.cpp | ||
BLEScan.h | ||
BLESecurity.cpp | ||
BLESecurity.h | ||
BLEServer.cpp | ||
BLEServer.h | ||
BLEService.cpp | ||
BLEService.h | ||
BLEServiceMap.cpp | ||
BLEUtils.cpp | ||
BLEUtils.h | ||
BLEUUID.cpp | ||
BLEUUID.h | ||
BLEValue.cpp | ||
BLEValue.h | ||
FreeRTOS.cpp | ||
FreeRTOS.h | ||
GeneralUtils.cpp | ||
GeneralUtils.h | ||
HIDKeyboardTypes.h | ||
HIDTypes.h |