kopia lustrzana https://github.com/sh123/esp32_loraprs
Use lora-aprs 3 byte prefix only if specified in config
rodzic
7046309fa6
commit
8d872510b0
1
config.h
1
config.h
|
@ -93,6 +93,7 @@
|
||||||
#define CFG_IS_TO_RF false // forward packets from internet to radio based on CFG_APRS_FILTER
|
#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_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 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
|
// Frequency correction for narrow band bandwidths
|
||||||
#define CFG_FREQ_CORR false // true - correct own frequency based on received packet
|
#define CFG_FREQ_CORR false // true - correct own frequency based on received packet
|
||||||
|
|
|
@ -83,6 +83,7 @@ void initializeConfig(LoraPrs::Config &cfg) {
|
||||||
cfg.EnableRepeater = CFG_DIGIREPEAT; // digirepeat incoming packets
|
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.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.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
|
// kiss
|
||||||
cfg.KissEnableExtensions = CFG_KISS_EXTENSIONS; // radio control and signal reports
|
cfg.KissEnableExtensions = CFG_KISS_EXTENSIONS; // radio control and signal reports
|
||||||
|
|
|
@ -4,6 +4,7 @@ namespace Kiss {
|
||||||
|
|
||||||
Processor::Processor()
|
Processor::Processor()
|
||||||
: disableKiss_(false)
|
: disableKiss_(false)
|
||||||
|
, usePrefix_(false)
|
||||||
, isRawIdle_(true)
|
, isRawIdle_(true)
|
||||||
, state_(State::GetStart)
|
, state_(State::GetStart)
|
||||||
{
|
{
|
||||||
|
@ -65,9 +66,11 @@ void Processor::queueSerialToRig(Cmd cmd, const byte *packet, int packetLength)
|
||||||
bool result = 1;
|
bool result = 1;
|
||||||
if (disableKiss_) {
|
if (disableKiss_) {
|
||||||
// inject proprietary identifier
|
// inject proprietary identifier
|
||||||
|
if (usePrefix_) {
|
||||||
result &= serialToRigQueue_.unshift('<');
|
result &= serialToRigQueue_.unshift('<');
|
||||||
result &= serialToRigQueue_.unshift(0xff);
|
result &= serialToRigQueue_.unshift(0xff);
|
||||||
result &= serialToRigQueue_.unshift(0x01);
|
result &= serialToRigQueue_.unshift(0x01);
|
||||||
|
}
|
||||||
// TNC2, send as is, receiveByteRaw will deal with it
|
// TNC2, send as is, receiveByteRaw will deal with it
|
||||||
for (int i = 0; i < packetLength; i++) {
|
for (int i = 0; i < packetLength; i++) {
|
||||||
byte rxByte = packet[i];
|
byte rxByte = packet[i];
|
||||||
|
@ -118,7 +121,7 @@ bool Processor::processRigToSerial()
|
||||||
int readCnt = rxPacketSize;
|
int readCnt = rxPacketSize;
|
||||||
for (int i = 0, j = 0; i < readCnt; i++) {
|
for (int i = 0, j = 0; i < readCnt; i++) {
|
||||||
byte rxByte = rigToSerialQueue_.pop();
|
byte rxByte = rigToSerialQueue_.pop();
|
||||||
if (disableKiss_) {
|
if (disableKiss_ && usePrefix_) {
|
||||||
// filter out properietary identifier
|
// filter out properietary identifier
|
||||||
if ((i == 0 && rxByte == '<') ||
|
if ((i == 0 && rxByte == '<') ||
|
||||||
(i == 1 && rxByte == 0xff) ||
|
(i == 1 && rxByte == 0xff) ||
|
||||||
|
|
|
@ -85,6 +85,7 @@ private:
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
bool disableKiss_;
|
bool disableKiss_;
|
||||||
|
bool usePrefix_;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
bool isRawIdle_;
|
bool isRawIdle_;
|
||||||
|
|
|
@ -68,6 +68,7 @@ struct Config
|
||||||
bool EnableRepeater; // true - digirepeat incoming packets based on WIDEn-n paths
|
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 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 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
|
// external ptt tx control
|
||||||
bool PttEnable; // true - enable external ptt control
|
bool PttEnable; // true - enable external ptt control
|
||||||
|
|
|
@ -27,6 +27,7 @@ void Service::setup(const Config &conf)
|
||||||
config_ = conf;
|
config_ = conf;
|
||||||
beaconLastTimestampMs_ = 0;
|
beaconLastTimestampMs_ = 0;
|
||||||
disableKiss_ = conf.EnableTextPackets;
|
disableKiss_ = conf.EnableTextPackets;
|
||||||
|
usePrefix_ = conf.EnableTextPacketsPrefix;
|
||||||
|
|
||||||
LOG_SET_OPTION(false, false, true); // disable file, line, enable func
|
LOG_SET_OPTION(false, false, true); // disable file, line, enable func
|
||||||
|
|
||||||
|
|
Ładowanie…
Reference in New Issue