Lora recv loop added

This commit is contained in:
Dionysus 2024-06-06 00:17:47 -04:00
parent 847963c2ab
commit 4aa62e9982
Signed by: acidvegas
GPG Key ID: EF4B922DB85DC9DE
2 changed files with 38 additions and 2 deletions

View File

@ -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)*

View File

@ -100,3 +100,38 @@ bool transmit() {
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;
}
}
}