kopia lustrzana https://github.com/sh123/esp32_loraprs
Handle control data escape
rodzic
0a43429b1c
commit
b89a13680e
|
@ -109,7 +109,7 @@ private:
|
||||||
uint32_t freqRx;
|
uint32_t freqRx;
|
||||||
uint32_t freqTx;
|
uint32_t freqTx;
|
||||||
uint8_t modType;
|
uint8_t modType;
|
||||||
uint16_t pwr;
|
int16_t pwr;
|
||||||
uint32_t bw;
|
uint32_t bw;
|
||||||
uint16_t sf;
|
uint16_t sf;
|
||||||
uint16_t cr;
|
uint16_t cr;
|
||||||
|
|
|
@ -280,11 +280,19 @@ bool Processor::receiveByteKiss(byte rxByte)
|
||||||
break;
|
break;
|
||||||
case State::Escape:
|
case State::Escape:
|
||||||
if (rxByte == Marker::Tfend) {
|
if (rxByte == Marker::Tfend) {
|
||||||
|
if (dataType_ == DataType::Raw) {
|
||||||
onRigTx((byte)Marker::Fend);
|
onRigTx((byte)Marker::Fend);
|
||||||
|
} else if (dataType_ == DataType::Control) {
|
||||||
|
cmdBuffer_.push_back((byte)Marker::Fend);
|
||||||
|
}
|
||||||
state_ = State::GetData;
|
state_ = State::GetData;
|
||||||
}
|
}
|
||||||
else if (rxByte == Marker::Tfesc) {
|
else if (rxByte == Marker::Tfesc) {
|
||||||
|
if (dataType_ == DataType::Raw) {
|
||||||
onRigTx((byte)Marker::Fesc);
|
onRigTx((byte)Marker::Fesc);
|
||||||
|
} else if (dataType_ == DataType::Control) {
|
||||||
|
cmdBuffer_.push_back((byte)Marker::Fesc);
|
||||||
|
}
|
||||||
state_ = State::GetData;
|
state_ = State::GetData;
|
||||||
}
|
}
|
||||||
else if (rxByte != Marker::Fend) {
|
else if (rxByte != Marker::Fend) {
|
||||||
|
|
|
@ -788,7 +788,7 @@ void Service::onRadioControlCommand(const std::vector<byte> &rawCommand) {
|
||||||
config_.LoraBw = be32toh(setHardware->bw);
|
config_.LoraBw = be32toh(setHardware->bw);
|
||||||
config_.LoraSf = be16toh(setHardware->sf);
|
config_.LoraSf = be16toh(setHardware->sf);
|
||||||
config_.LoraCodingRate = be16toh(setHardware->cr);
|
config_.LoraCodingRate = be16toh(setHardware->cr);
|
||||||
config_.LoraPower = be16toh(setHardware->pwr);
|
config_.LoraPower = (int16_t)be16toh(setHardware->pwr);
|
||||||
config_.LoraSync = be16toh(setHardware->sync);
|
config_.LoraSync = be16toh(setHardware->sync);
|
||||||
config_.FskBitRate = (float)be32toh(setHardware->fskBitRate) / 1e3;
|
config_.FskBitRate = (float)be32toh(setHardware->fskBitRate) / 1e3;
|
||||||
config_.FskFreqDev = (float)be32toh(setHardware->fskFreqDev) / 1e3;
|
config_.FskFreqDev = (float)be32toh(setHardware->fskFreqDev) / 1e3;
|
||||||
|
@ -803,7 +803,7 @@ void Service::onRadioControlCommand(const std::vector<byte> &rawCommand) {
|
||||||
config_.LoraCodingRate, config_.LoraPower, config_.LoraSync, crcType, config_.LoraExplicit);
|
config_.LoraCodingRate, config_.LoraPower, config_.LoraSync, crcType, config_.LoraExplicit);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
LOG_ERROR("Radio control command of wrong size");
|
LOG_ERROR("Radio control command of wrong size", rawCommand.size());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Ładowanie…
Reference in New Issue