pull/42/head
sh123 2021-10-26 16:36:16 +03:00
rodzic 6a3cc32613
commit 73d172df0c
3 zmienionych plików z 20 dodań i 6 usunięć

Wyświetl plik

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

Wyświetl plik

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

Wyświetl plik

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