From ed3ac0eb11a04630f7f08124a484a854eea13569 Mon Sep 17 00:00:00 2001 From: Jonas Smedegaard Date: Sun, 13 Apr 2025 13:03:53 +0200 Subject: rename and describe bluetooth examples --- .../voting_from_EddystoneTLM/Beacon_Scanner.md | 9 ---- Mussel/examples/voting_from_EddystoneTLM/ci.json | 6 --- .../voting_from_EddystoneTLM.ino | 55 ---------------------- .../voting_from_EddystoneTLM.puml | 28 ----------- 4 files changed, 98 deletions(-) delete mode 100644 Mussel/examples/voting_from_EddystoneTLM/Beacon_Scanner.md delete mode 100644 Mussel/examples/voting_from_EddystoneTLM/ci.json delete mode 100644 Mussel/examples/voting_from_EddystoneTLM/voting_from_EddystoneTLM.ino delete mode 100644 Mussel/examples/voting_from_EddystoneTLM/voting_from_EddystoneTLM.puml (limited to 'Mussel/examples/voting_from_EddystoneTLM') diff --git a/Mussel/examples/voting_from_EddystoneTLM/Beacon_Scanner.md b/Mussel/examples/voting_from_EddystoneTLM/Beacon_Scanner.md deleted file mode 100644 index 34101fe..0000000 --- a/Mussel/examples/voting_from_EddystoneTLM/Beacon_Scanner.md +++ /dev/null @@ -1,9 +0,0 @@ -## BLE Beacon Scanner - -Initiates a BLE device scan. -Checks if the discovered devices are -- an iBeacon -- an Eddystone TLM beacon -- an Eddystone URL beacon - -and sends the decoded beacon information over Serial log diff --git a/Mussel/examples/voting_from_EddystoneTLM/ci.json b/Mussel/examples/voting_from_EddystoneTLM/ci.json deleted file mode 100644 index abe13a7..0000000 --- a/Mussel/examples/voting_from_EddystoneTLM/ci.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "fqbn_append": "PartitionScheme=huge_app", - "requires": [ - "CONFIG_SOC_BLE_SUPPORTED=y" - ] -} diff --git a/Mussel/examples/voting_from_EddystoneTLM/voting_from_EddystoneTLM.ino b/Mussel/examples/voting_from_EddystoneTLM/voting_from_EddystoneTLM.ino deleted file mode 100644 index 25c4720..0000000 --- a/Mussel/examples/voting_from_EddystoneTLM/voting_from_EddystoneTLM.ino +++ /dev/null @@ -1,55 +0,0 @@ -/* - Based on Neil Kolban example for IDF: https://github.com/nkolban/esp32-snippets/blob/master/cpp_utils/tests/BLE%20Tests/SampleScan.cpp - Ported to Arduino ESP32 by Evandro Copercini - Changed to a beacon scanner to report iBeacon, EddystoneURL and EddystoneTLM beacons by beegee-tokyo - Upgraded Eddystone part by Tomas Pilny on Feb 20, 2023 -*/ - -#include -#include - -#include -#include -#include -#include -#include - -Mussel mussel(10); - -int scanTime = 1; //In seconds -BLEScan *pBLEScan; - -class MyAdvertisedDeviceCallbacks : public BLEAdvertisedDeviceCallbacks { - void onResult(BLEAdvertisedDevice advertisedDevice) { - if (advertisedDevice.haveName() - && advertisedDevice.getFrameType() == BLE_EDDYSTONE_TLM_FRAME - ) { - BLEEddystoneTLM EddystoneTLM(&advertisedDevice); - mussel.push( - advertisedDevice.getName(), - millis(), - EddystoneTLM.getTemp() - ); - } - } -}; - -void setup() { - Serial.begin(115200); - mussel.begin(); - - BLEDevice::init(""); - pBLEScan = BLEDevice::getScan(); //create new scan - pBLEScan->setAdvertisedDeviceCallbacks(new MyAdvertisedDeviceCallbacks()); - pBLEScan->setActiveScan(true); //active scan uses more power, but get results faster - pBLEScan->setInterval(100); - pBLEScan->setWindow(99); // less or equal setInterval value -} - -void loop() { - // put your main code here, to run repeatedly: - BLEScanResults *foundDevices = pBLEScan->start(scanTime, false); - pBLEScan->clearResults(); // delete results fromBLEScan buffer to release memory - mussel.printStack(); - delay(500); -} diff --git a/Mussel/examples/voting_from_EddystoneTLM/voting_from_EddystoneTLM.puml b/Mussel/examples/voting_from_EddystoneTLM/voting_from_EddystoneTLM.puml deleted file mode 100644 index caafc05..0000000 --- a/Mussel/examples/voting_from_EddystoneTLM/voting_from_EddystoneTLM.puml +++ /dev/null @@ -1,28 +0,0 @@ -@startuml -'start -:instantiate mussel object; -:instantiate bluetooth object; -group init -:setup mussel voting; -:setup bluetooth scanner; -end group -split -while (each beacon detected) -group "bluetooth callback" { -:collect beacon data; -end group -endwhile --[hidden]-> -kill -split again -while (each 500ms) -group loop { -:allign beacon data as ballots; -:qualify ballots for a vote; -:conclude vote result; -:act on vote result; -end group -endwhile --[hidden]-> -kill -@enduml -- cgit v1.2.3