aboutsummaryrefslogtreecommitdiff
path: root/vote
diff options
context:
space:
mode:
authorTanishka Suwalka <tanishkas@ruc.dk>2025-04-16 19:49:23 +0200
committerJonas Smedegaard <dr@jones.dk>2025-04-16 19:53:49 +0200
commit8a34f5c4359e074bc895dc5ed69c394748b44757 (patch)
treeb102e722b40c417bd0a69430109702008a7b5dd0 /vote
parent40910f9bac151bfd4ffbf06f1e80fdc7660dd827 (diff)
formally define BLE scan timing values
Diffstat (limited to 'vote')
-rw-r--r--vote/vote.ino11
1 files changed, 6 insertions, 5 deletions
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 <BLEAdvertisedDevice.h>
#include <BLEEddystoneTLM.h>
#include <BLEBeacon.h>
+#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);