acid-drop

- Unnamed repository; edit this file 'description' to name the repository.
git clone git://git.acid.vegas/-c.git
Log | Files | Refs | Archive | README | LICENSE

commit 4aa62e998268bb78e3a6a44018addd322e3c4de3
parent 847963c2ab346e69b63512a478850497f5d05080
Author: acidvegas <acid.vegas@acid.vegas>
Date: Thu, 6 Jun 2024 00:17:47 -0400

Lora recv loop added

Diffstat:
MREADME.md | 5+++--
Msrc/apps/lora.cpp | 35+++++++++++++++++++++++++++++++++++

2 files changed, 38 insertions(+), 2 deletions(-)

diff --git a/README.md b/README.md
@@ -57,6 +57,7 @@ The device will scan for WiFi networks on boot. Once the list is displayed, you 
 - [ ] GPS support
 - [ ] Lora support
 - [ ] BLE support
+- [ ] SD card support
 
 ###### Features
 - [X] Wifi scanning & selection menu
@@ -85,8 +86,8 @@ The device will scan for WiFi networks on boot. Once the list is displayed, you 
 - [ ] Wardriving
 - [ ] Evil Portal AP
 - [ ] Local Network Probe *(Scans for devices on the wifi network you are connected to, add port scanning)*
-- [ ] Gotify
-- [ ] Meshtastic
+- [ ] Gotify *(in progress)*
+- [ ] Meshtastic *(in progress)*
 - [ ] Spotify/Music player *(can we play audio throuigh Bluetoth headphones or the on-board speaker?)*
 - [ ] Syslog *(All serial logs will be displayed here for on-device debugging)*
 
diff --git a/src/apps/lora.cpp b/src/apps/lora.cpp
@@ -99,4 +99,39 @@ bool transmit() {
         Serial.println(state);
         return false;
     }
+}
+
+
+void recvLoop() {
+    String recv;
+
+    while (true) {
+        if (radio.available()) {
+            int state = radio.readData(recv);
+
+            if (state == RADIOLIB_ERR_NONE) {
+                Serial.print(F("[RADIO] Received packet!"));
+
+                Serial.print(F(" Data:"));
+                Serial.print(recv);
+
+                Serial.print(F(" RSSI:"));
+                Serial.print(radio.getRSSI());
+                Serial.print(F(" dBm"));
+                // snprintf(dispRecvicerBuff[1], sizeof(dispRecvicerBuff[1]), "RSSI:%.2f dBm", radio.getRSSI());
+
+                Serial.print(F("  SNR:"));
+                Serial.print(radio.getSNR());
+                Serial.println(F(" dB"));
+            } else if (state ==  RADIOLIB_ERR_CRC_MISMATCH) {
+                Serial.println(F("CRC error!"));
+            } else {
+                Serial.print(F("failed, code "));
+                Serial.println(state);
+            }
+        } else {
+            Serial.println(F("Radio became unavailable!"));
+            break;
+        }
+    }
 }
 \ No newline at end of file