From 8a34f5c4359e074bc895dc5ed69c394748b44757 Mon Sep 17 00:00:00 2001 From: Tanishka Suwalka Date: Wed, 16 Apr 2025 19:49:23 +0200 Subject: formally define BLE scan timing values --- vote/vote.ino | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'vote') diff --git a/vote/vote.ino b/vote/vote.ino index 6cfca11..8036408 100644 --- a/vote/vote.ino +++ b/vote/vote.ino @@ -28,6 +28,9 @@ #include #include #include +#define SCAN_INTERVAL 100 +#define SCAN_WINDOW 99 +#define SCAN_TIME_SEC 1 // Validity timing thresholds const unsigned long VOTE_TIME_AHEAD = 1 * 60 * 1000; // 1 minute @@ -45,8 +48,6 @@ struct Vote { // Index of the top element in the stack, -1 means stack is empty int top = -1; -int scanTime = 1; //In seconds - // pointer to control Bluetooth networking BLEScan *pBLEScan; @@ -130,13 +131,13 @@ void setup() { pBLEScan->setAdvertisedDeviceCallbacks( new MyAdvertisedDeviceCallbacks()); pBLEScan->setActiveScan(true); - pBLEScan->setInterval(100); - pBLEScan->setWindow(99); + pBLEScan->setInterval(SCAN_INTERVAL); + pBLEScan->setWindow(SCAN_WINDOW); } void loop() { - BLEScanResults *foundDevices = pBLEScan->start(scanTime, false); + pBLEScan->start(SCAN_TIME_SEC, false); pBLEScan->clearResults(); delay(500); -- cgit v1.2.3