Use lora-aprs 3 byte prefix only if specified in config

platformio
sh123 2022-12-11 18:21:45 +02:00
rodzic 7046309fa6
commit 8d872510b0
6 zmienionych plików z 12 dodań i 4 usunięć

Wyświetl plik

@ -93,6 +93,7 @@
#define CFG_IS_TO_RF false // forward packets from internet to radio based on CFG_APRS_FILTER
#define CFG_BEACON false // enable perdiodic beacon from CFG_APRS_RAW_BKN
#define CFG_TEXT_PACKETS false // enable aprs text packets instead of binary for interoperability with other projects (disables KISS + AX.25!)
#define CFG_TEXT_PACKETS_PREFIX false // // true - enable aprs-lora 3 byte prefix '<', 0xff, 0x01
// Frequency correction for narrow band bandwidths
#define CFG_FREQ_CORR false // true - correct own frequency based on received packet

Wyświetl plik

@ -83,6 +83,7 @@ void initializeConfig(LoraPrs::Config &cfg) {
cfg.EnableRepeater = CFG_DIGIREPEAT; // digirepeat incoming packets
cfg.EnableBeacon = CFG_BEACON; // enable periodic AprsRawBeacon beacon to rf and aprsis if rf to aprsis is enabled
cfg.EnableTextPackets = CFG_TEXT_PACKETS; // enables text packets and disables KISS+AX25 binary frames for interoperability
cfg.EnableTextPacketsPrefix = CFG_TEXT_PACKETS_PREFIX; // enable aprs-lora 3 byte prefix '<', 0xff, 0x01
// kiss
cfg.KissEnableExtensions = CFG_KISS_EXTENSIONS; // radio control and signal reports

Wyświetl plik

@ -4,6 +4,7 @@ namespace Kiss {
Processor::Processor()
: disableKiss_(false)
, usePrefix_(false)
, isRawIdle_(true)
, state_(State::GetStart)
{
@ -65,9 +66,11 @@ void Processor::queueSerialToRig(Cmd cmd, const byte *packet, int packetLength)
bool result = 1;
if (disableKiss_) {
// inject proprietary identifier
result &= serialToRigQueue_.unshift('<');
result &= serialToRigQueue_.unshift(0xff);
result &= serialToRigQueue_.unshift(0x01);
if (usePrefix_) {
result &= serialToRigQueue_.unshift('<');
result &= serialToRigQueue_.unshift(0xff);
result &= serialToRigQueue_.unshift(0x01);
}
// TNC2, send as is, receiveByteRaw will deal with it
for (int i = 0; i < packetLength; i++) {
byte rxByte = packet[i];
@ -118,7 +121,7 @@ bool Processor::processRigToSerial()
int readCnt = rxPacketSize;
for (int i = 0, j = 0; i < readCnt; i++) {
byte rxByte = rigToSerialQueue_.pop();
if (disableKiss_) {
if (disableKiss_ && usePrefix_) {
// filter out properietary identifier
if ((i == 0 && rxByte == '<') ||
(i == 1 && rxByte == 0xff) ||

Wyświetl plik

@ -85,6 +85,7 @@ private:
protected:
bool disableKiss_;
bool usePrefix_;
private:
bool isRawIdle_;

Wyświetl plik

@ -68,6 +68,7 @@ struct Config
bool EnableRepeater; // true - digirepeat incoming packets based on WIDEn-n paths
bool EnableBeacon; // true - send AprsRawBeacon to RF and APRS-IS if EnableRfToIs is true
bool EnableTextPackets; // true - use text plain messages insead of AX25 binary frames for interoperability with other projects
bool EnableTextPacketsPrefix; // true - enable aprs-lora 3 byte prefix '<', 0xff, 0x01
// external ptt tx control
bool PttEnable; // true - enable external ptt control

Wyświetl plik

@ -27,6 +27,7 @@ void Service::setup(const Config &conf)
config_ = conf;
beaconLastTimestampMs_ = 0;
disableKiss_ = conf.EnableTextPackets;
usePrefix_ = conf.EnableTextPacketsPrefix;
LOG_SET_OPTION(false, false, true); // disable file, line, enable func