Handle control data escape

master
sh123 2023-11-16 23:26:34 +02:00
rodzic 0a43429b1c
commit b89a13680e
3 zmienionych plików z 13 dodań i 5 usunięć

Wyświetl plik

@ -109,7 +109,7 @@ private:
uint32_t freqRx;
uint32_t freqTx;
uint8_t modType;
uint16_t pwr;
int16_t pwr;
uint32_t bw;
uint16_t sf;
uint16_t cr;

Wyświetl plik

@ -280,11 +280,19 @@ bool Processor::receiveByteKiss(byte rxByte)
break;
case State::Escape:
if (rxByte == Marker::Tfend) {
onRigTx((byte)Marker::Fend);
if (dataType_ == DataType::Raw) {
onRigTx((byte)Marker::Fend);
} else if (dataType_ == DataType::Control) {
cmdBuffer_.push_back((byte)Marker::Fend);
}
state_ = State::GetData;
}
else if (rxByte == Marker::Tfesc) {
onRigTx((byte)Marker::Fesc);
if (dataType_ == DataType::Raw) {
onRigTx((byte)Marker::Fesc);
} else if (dataType_ == DataType::Control) {
cmdBuffer_.push_back((byte)Marker::Fesc);
}
state_ = State::GetData;
}
else if (rxByte != Marker::Fend) {

Wyświetl plik

@ -788,7 +788,7 @@ void Service::onRadioControlCommand(const std::vector<byte> &rawCommand) {
config_.LoraBw = be32toh(setHardware->bw);
config_.LoraSf = be16toh(setHardware->sf);
config_.LoraCodingRate = be16toh(setHardware->cr);
config_.LoraPower = be16toh(setHardware->pwr);
config_.LoraPower = (int16_t)be16toh(setHardware->pwr);
config_.LoraSync = be16toh(setHardware->sync);
config_.FskBitRate = (float)be32toh(setHardware->fskBitRate) / 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);
}
} else {
LOG_ERROR("Radio control command of wrong size");
LOG_ERROR("Radio control command of wrong size", rawCommand.size());
}
}