diff --git a/kiss_processor.cpp b/kiss_processor.cpp index 111b911..78f3cbc 100644 --- a/kiss_processor.cpp +++ b/kiss_processor.cpp @@ -73,6 +73,7 @@ void Processor::queueSerialToRig(Cmd cmd, const byte *packet, int packetLength) byte rxByte = packet[i]; result &= serialToRigQueue_.unshift(rxByte); } + result &= serialToRigQueue_.unshift('\n'); } else { result &= serialToRigQueue_.unshift(Marker::Fend); result &= serialToRigQueue_.unshift(cmd); diff --git a/loraprs_service.cpp b/loraprs_service.cpp index 0452ded..b74e50d 100644 --- a/loraprs_service.cpp +++ b/loraprs_service.cpp @@ -39,13 +39,9 @@ void Service::setup(const Config &conf) if (config_.UsbSerialEnable) { LOG_SET_LEVEL(DebugLogLevel::LVL_NONE); } -#ifdef USE_RADIOLIB - LOG_INFO("Built with RadioLib library"); -#else - LOG_INFO("Built with arduino-LoRa library"); -#endif - LOG_INFO(disableKiss_ ? "Using TNC2 text mode" : "Using TNC KISS and AX.25 mode"); + printConfig(); + // KISS extensions are disabled in TNC2 mode if (disableKiss_) { LOG_INFO("KISS extensions are disabled in TNC2 mode"); @@ -82,6 +78,7 @@ void Service::setup(const Config &conf) // APRS-IS if (needsAprsis() && config_.EnablePersistentAprsConnection) { + LOG_INFO("Using persistent APRS-IS connection"); reconnectAprsis(); } @@ -92,6 +89,16 @@ void Service::setup(const Config &conf) } } +void Service::printConfig() { + LOG_INFO("Current mode:", config_.IsClientMode ? "NORMAL" : "APRS-IS iGate"); +#ifdef USE_RADIOLIB + LOG_INFO("Built with RadioLib library"); +#else + LOG_INFO("Built with arduino-LoRa library"); +#endif + LOG_INFO(disableKiss_ ? "Using TNC2 text mode" : "Using TNC KISS and AX.25 mode"); +} + void Service::setupWifi(const String &wifiName, const String &wifiKey) { WiFi.setHostname("loraprs"); @@ -427,6 +434,8 @@ bool Service::sendAX25ToLora(const AX25::Payload &payload) { int bytesWritten; byte buf[CfgMaxAX25PayloadSize]; + + // TNC2 text mode if (config_.EnableTextPackets) { String textPayload = payload.ToString(); bytesWritten = textPayload.length(); @@ -435,6 +444,8 @@ bool Service::sendAX25ToLora(const AX25::Payload &payload) } textPayload.getBytes(buf, bytesWritten); buf[bytesWritten-1] = '\0'; + + // KISS TNC } else { bytesWritten = payload.ToBinary(buf, sizeof(buf)); if (bytesWritten <= 0) { diff --git a/loraprs_service.h b/loraprs_service.h index e234685..6c43f24 100644 --- a/loraprs_service.h +++ b/loraprs_service.h @@ -38,6 +38,8 @@ public: void loop(); private: + void printConfig(); + void setupWifi(const String &wifiName, const String &wifiKey); void setupLora(long loraFreq, long bw, int sf, int cr, int pwr, int sync, bool enableCrc); void setupBt(const String &btName);