update for better BLE
This commit is contained in:
parent
833dafda34
commit
dbb8976e31
|
|
@ -45,7 +45,7 @@ TinyGPSPlus gps;
|
|||
OneButton userButton = OneButton(BUTTON_PIN, true, true);
|
||||
#endif
|
||||
|
||||
String versionDate = "2024.07.11";
|
||||
String versionDate = "2024.07.13";
|
||||
|
||||
uint8_t myBeaconsIndex = 0;
|
||||
int myBeaconsSize = Config.beacons.size();
|
||||
|
|
|
|||
|
|
@ -38,6 +38,9 @@ class MyServerCallbacks : public NimBLEServerCallbacks {
|
|||
bluetoothConnected = false;
|
||||
logger.log(logging::LoggerLevel::LOGGER_LEVEL_INFO, "BLE", "%s", "BLE client Disconnected, Started Advertising");
|
||||
pServer->startAdvertising();
|
||||
LoRa_Utils::sleepRadio();
|
||||
delay(500);
|
||||
LoRa_Utils::wakeRadio();
|
||||
}
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -184,6 +184,7 @@ namespace LoRa_Utils {
|
|||
receivedLoraPacket.freqError = radio.getFrequencyError();
|
||||
}
|
||||
} else {
|
||||
//Serial.println(packet);
|
||||
Serial.print(F("failed, code ")); // 7 = CRC mismatch
|
||||
Serial.println(state);
|
||||
}
|
||||
|
|
@ -192,6 +193,10 @@ namespace LoRa_Utils {
|
|||
return receivedLoraPacket;
|
||||
}
|
||||
|
||||
void wakeRadio() {
|
||||
radio.startReceive();
|
||||
}
|
||||
|
||||
void sleepRadio() {
|
||||
radio.sleep();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -18,6 +18,7 @@ namespace LoRa_Utils {
|
|||
void setup();
|
||||
void sendNewPacket(const String& newPacket);
|
||||
ReceivedLoRaPacket receivePacket();
|
||||
void wakeRadio();
|
||||
void sleepRadio();
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -401,7 +401,7 @@ namespace MSG_Utils {
|
|||
if (packet.text.substring(0,3) == "\x3c\xff\x01") { // its an APRS packet
|
||||
//Serial.println(packet.text); // only for debug
|
||||
lastReceivedPacket = APRSPacketLib::processReceivedPacket(packet.text.substring(3),packet.rssi, packet.snr, packet.freqError);
|
||||
if (lastReceivedPacket.sender!=currentBeacon->callsign) {
|
||||
if (lastReceivedPacket.sender != currentBeacon->callsign) {
|
||||
|
||||
if (lastReceivedPacket.message.indexOf("\x3c\xff\x01") != -1) {
|
||||
lastReceivedPacket.message = lastReceivedPacket.message.substring(0, lastReceivedPacket.message.indexOf("\x3c\xff\x01"));
|
||||
|
|
|
|||
Loading…
Reference in New Issue