Skip to content

Commit

Permalink
Reverted workaround for h2zero/NimBLE-Arduino#826 (#127)
Browse files Browse the repository at this point in the history
  • Loading branch information
matthias-bs authored Jan 28, 2025
1 parent a6885e7 commit 817e4f2
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 17 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -83,12 +83,12 @@ jobs:
"[email protected]"
"[email protected]"
"[email protected]"
"[email protected].0"
"[email protected].1"
"[email protected]"
"[email protected]"
"[email protected]"
"[email protected]"
"[email protected].2"
"[email protected].3"
"[email protected]"
"[email protected]")
for i in "${required_libs[@]}"
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
"ESP32Time": "fbiego/ESP32Time#semver:^2.0.6",
"OneWireNg": "https://github.com/pstolarz/OneWireNg#semver:^0.13.3",
"Arduino-Temperature-Control-Library": "milesburton/Arduino-Temperature-Control-Library#semver:^4.0.2",
"NimBLE-Arduino": "h2zero/NimBLE-Arduino#semver:^2.2.0",
"NimBLE-Arduino": "h2zero/NimBLE-Arduino#semver:^2.2.1",
"ATC_MiThermometer": "matthias-bs/ATC_MiThermometer#semver:^0.4.2",
"TheengsDecoder": "theengs/decoder#semver:^1.8.4",
"Preferences": "vshymanskyy/Preferences#semver:^2.1.0",
Expand Down
15 changes: 2 additions & 13 deletions src/BleSensors/BleSensors.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -80,15 +80,7 @@ class ScanCallbacks : public NimBLEScanCallbacks
{
log_v("BLE device found at index %d", idx);
device_found = true;

// Only count the device as found once
// Workaround for
// https://github.com/h2zero/NimBLE-Arduino/issues/826
if (!(*m_sensorData)[idx].found)
{
(*m_sensorData)[idx].found = true;
m_devices_found++;
}
m_devices_found++;
break;
}
}
Expand Down Expand Up @@ -166,7 +158,6 @@ void BleSensors::resetData(void)
for (int i = 0; i < _known_sensors.size(); i++)
{
data[i].valid = false;
data[i].found = false;
}
}

Expand All @@ -175,9 +166,7 @@ void BleSensors::resetData(void)
*/
unsigned BleSensors::getData(uint32_t scanTime, bool activeScan)
{
// setScanFilterMode() is not available for ESP32-S3
// see https://github.com/h2zero/NimBLE-Arduino/issues/826
//NimBLEDevice::setScanFilterMode(CONFIG_BTDM_SCAN_DUPL_TYPE_DATA_DEVICE);
NimBLEDevice::setScanFilterMode(CONFIG_BTDM_SCAN_DUPL_TYPE_DATA_DEVICE);

NimBLEDevice::init("ble-scan");
_pBLEScan = NimBLEDevice::getScan();
Expand Down
1 change: 0 additions & 1 deletion src/BleSensors/BleSensors.h
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,6 @@
* \brief BLE sensor data
*/
struct BleDataS {
bool found; //!< device found
bool valid; //!< data valid
float temperature; //!< temperature in degC
float humidity; //!< humidity in %
Expand Down

0 comments on commit 817e4f2

Please sign in to comment.