From 44bf24ae0602d9f04f2f1dd0fe1d12224f0e78fa Mon Sep 17 00:00:00 2001 From: Matthias Prinke <83612361+matthias-bs@users.noreply.github.com> Date: Sun, 29 Dec 2024 17:41:04 +0100 Subject: [PATCH] Create BLETest.ino --- extras/BLETest/BLETest.ino | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 extras/BLETest/BLETest.ino diff --git a/extras/BLETest/BLETest.ino b/extras/BLETest/BLETest.ino new file mode 100644 index 0000000..cb56a84 --- /dev/null +++ b/extras/BLETest/BLETest.ino @@ -0,0 +1,35 @@ +#include +#include "BleSensors.h" + +// List of known sensors' BLE addresses +#define KNOWN_BLE_ADDRESSES \ + { \ + "a4:c1:38:b8:1f:7f" \ + } + +std::vector knownBLEAddresses; + +void setup() +{ + Serial.begin(115200); + Serial.setDebugOutput(true); + Serial.println("BLETest"); + + knownBLEAddresses = KNOWN_BLE_ADDRESSES; + BleSensors bleSensors = BleSensors(knownBLEAddresses); + unsigned ble_scantime = 31; + bool ble_active = false; + + for (const std::string &s : knownBLEAddresses) + { + (void)s; + log_d("%s", s.c_str()); + } + + bleSensors.getData(ble_scantime, ble_active); +} + +void loop() +{ + delay(100); +}