Handle the net ack parameter.

This commit is contained in:
Jonathan Naylor 2020-04-14 12:23:26 +01:00
parent c84d81d91c
commit 7a549e96ba
3 changed files with 13 additions and 7 deletions

4
FM.cpp
View File

@ -40,10 +40,10 @@ void CFM::setCallsign(const char* callsign, uint8_t speed, uint16_t frequency, u
{ {
} }
void CFM::setAck(const char* ack, uint8_t speed, uint16_t frequency, uint8_t minTime, uint16_t delay, uint8_t level) void CFM::setAck(const char* rfAck, uint8_t speed, uint16_t frequency, uint8_t minTime, uint16_t delay, uint8_t level)
{ {
} }
void CFM::setMisc(uint16_t timeout, uint8_t timeoutLevel, uint8_t ctcssFrequency, uint8_t ctcssThreshold, uint8_t ctcssLevel, uint8_t kerchunkTime, uint8_t hangTime) void CFM::setMisc(const char* netAck, uint16_t timeout, uint8_t timeoutLevel, uint8_t ctcssFrequency, uint8_t ctcssThreshold, uint8_t ctcssLevel, uint8_t kerchunkTime, uint8_t hangTime)
{ {
} }

4
FM.h
View File

@ -32,8 +32,8 @@ public:
void reset(); void reset();
void setCallsign(const char* callsign, uint8_t speed, uint16_t frequency, uint8_t time, uint8_t holdoff, uint8_t highLevel, uint8_t lowLevel, bool callAtStart, bool callAtEnd); void setCallsign(const char* callsign, uint8_t speed, uint16_t frequency, uint8_t time, uint8_t holdoff, uint8_t highLevel, uint8_t lowLevel, bool callAtStart, bool callAtEnd);
void setAck(const char* ack, uint8_t speed, uint16_t frequency, uint8_t minTime, uint16_t delay, uint8_t level); void setAck(const char* rfAck, uint8_t speed, uint16_t frequency, uint8_t minTime, uint16_t delay, uint8_t level);
void setMisc(uint16_t timeout, uint8_t timeoutLevel, uint8_t ctcssFrequency, uint8_t ctcssThreshold, uint8_t ctcssLevel, uint8_t kerchunkTime, uint8_t hangTime); void setMisc(const char* netAck, uint16_t timeout, uint8_t timeoutLevel, uint8_t ctcssFrequency, uint8_t ctcssThreshold, uint8_t ctcssLevel, uint8_t kerchunkTime, uint8_t hangTime);
private: private:
}; };

View File

@ -391,7 +391,7 @@ uint8_t CSerialPort::setFMParams1(const uint8_t* data, uint8_t length)
uint8_t CSerialPort::setFMParams2(const uint8_t* data, uint8_t length) uint8_t CSerialPort::setFMParams2(const uint8_t* data, uint8_t length)
{ {
if (length < 5U) if (length < 6U)
return 4U; return 4U;
uint8_t speed = data[0U]; uint8_t speed = data[0U];
@ -413,7 +413,7 @@ uint8_t CSerialPort::setFMParams2(const uint8_t* data, uint8_t length)
uint8_t CSerialPort::setFMParams3(const uint8_t* data, uint8_t length) uint8_t CSerialPort::setFMParams3(const uint8_t* data, uint8_t length)
{ {
if (length < 7U) if (length < 8U)
return 4U; return 4U;
uint16_t timeout = data[0U] * 5U; uint16_t timeout = data[0U] * 5U;
@ -426,7 +426,13 @@ uint8_t CSerialPort::setFMParams3(const uint8_t* data, uint8_t length)
uint8_t kerchunkTime = data[5U]; uint8_t kerchunkTime = data[5U];
uint8_t hangTime = data[6U]; uint8_t hangTime = data[6U];
fm.setMisc(timeout, timeoutLevel, ctcssFrequency, ctcssThreshold, ctcssLevel, kerchunkTime, hangTime); char ack[50U];
uint8_t n = 0U;
for (uint8_t i = 7U; i < length; i++, n++)
ack[n] = data[i];
ack[n] = '\0';
fm.setMisc(ack, timeout, timeoutLevel, ctcssFrequency, ctcssThreshold, ctcssLevel, kerchunkTime, hangTime);
return 0U; return 0U;
} }