kopia lustrzana https://github.com/sh123/esp32_loraprs
Rename control and signal even structures
rodzic
9009a0278b
commit
c18f6cb4ac
|
@ -234,12 +234,12 @@ void Service::onAprsisDataAvailable()
|
||||||
|
|
||||||
void Service::sendSignalReportEvent(int rssi, float snr)
|
void Service::sendSignalReportEvent(int rssi, float snr)
|
||||||
{
|
{
|
||||||
struct LoraSignalLevelEvent event;
|
struct SignalLevelEvent event;
|
||||||
|
|
||||||
event.rssi = htobe16(rssi);
|
event.rssi = htobe16(rssi);
|
||||||
event.snr = htobe16(snr * 100);
|
event.snr = htobe16(snr * 100);
|
||||||
|
|
||||||
serialSend(Cmd::RadioSignalLevel, (const byte *)&event, sizeof(LoraSignalLevelEvent));
|
serialSend(Cmd::RadioSignalLevel, (const byte *)&event, sizeof(SignalLevelEvent));
|
||||||
}
|
}
|
||||||
|
|
||||||
bool Service::sendAX25ToLora(const AX25::Payload &payload)
|
bool Service::sendAX25ToLora(const AX25::Payload &payload)
|
||||||
|
@ -372,8 +372,8 @@ void Service::onControlCommand(Cmd cmd, byte value)
|
||||||
|
|
||||||
void Service::onRadioControlCommand(const std::vector<byte> &rawCommand) {
|
void Service::onRadioControlCommand(const std::vector<byte> &rawCommand) {
|
||||||
|
|
||||||
if (config_.EnableKissExtensions && rawCommand.size() == sizeof(LoraControlCommand)) {
|
if (config_.EnableKissExtensions && rawCommand.size() == sizeof(ControlCommand)) {
|
||||||
const struct LoraControlCommand * controlCommand = reinterpret_cast<const struct LoraControlCommand*>(rawCommand.data());
|
const struct ControlCommand * controlCommand = reinterpret_cast<const struct ControlCommand*>(rawCommand.data());
|
||||||
|
|
||||||
config_.LoraFreq = be32toh(controlCommand->freq);
|
config_.LoraFreq = be32toh(controlCommand->freq);
|
||||||
config_.LoraBw = be32toh(controlCommand->bw);
|
config_.LoraBw = be32toh(controlCommand->bw);
|
||||||
|
|
|
@ -60,12 +60,12 @@ protected:
|
||||||
virtual void onRadioControlCommand(const std::vector<byte> &command);
|
virtual void onRadioControlCommand(const std::vector<byte> &command);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
struct LoraSignalLevelEvent {
|
struct SignalLevelEvent {
|
||||||
int16_t rssi;
|
int16_t rssi;
|
||||||
int16_t snr;
|
int16_t snr;
|
||||||
} __attribute__((packed));
|
} __attribute__((packed));
|
||||||
|
|
||||||
struct LoraControlCommand {
|
struct ControlCommand {
|
||||||
uint32_t freq;
|
uint32_t freq;
|
||||||
uint32_t bw;
|
uint32_t bw;
|
||||||
uint16_t sf;
|
uint16_t sf;
|
||||||
|
|
Ładowanie…
Reference in New Issue