kopia lustrzana https://gitlab.com/eliggett/wfview
Fix parsing of received tone
rodzic
4e8819becb
commit
7e3f4a8ac2
|
@ -513,20 +513,19 @@ toneInfo rigCommander::decodeTone(QByteArray eTone)
|
||||||
// D(T)CS: 1B 01 TR 01 23 = T/R Invert bits + DCS code 123
|
// D(T)CS: 1B 01 TR 01 23 = T/R Invert bits + DCS code 123
|
||||||
|
|
||||||
toneInfo t;
|
toneInfo t;
|
||||||
|
if (eTone.length() < 3) {
|
||||||
if (eTone.length() < 5) {
|
|
||||||
return t;
|
return t;
|
||||||
}
|
}
|
||||||
|
|
||||||
if((eTone.at(2) & 0x01) == 0x01)
|
if((eTone.at(0) & 0x01) == 0x01)
|
||||||
t.tinv = true;
|
t.tinv = true;
|
||||||
if((eTone.at(2) & 0x10) == 0x10)
|
if((eTone.at(0) & 0x10) == 0x10)
|
||||||
t.rinv = true;
|
t.rinv = true;
|
||||||
|
|
||||||
t.tone += (eTone.at(4) & 0x0f);
|
t.tone += (eTone.at(2) & 0x0f);
|
||||||
t.tone += ((eTone.at(4) & 0xf0) >> 4) * 10;
|
t.tone += ((eTone.at(2) & 0xf0) >> 4) * 10;
|
||||||
t.tone += (eTone.at(3) & 0x0f) * 100;
|
t.tone += (eTone.at(1) & 0x0f) * 100;
|
||||||
t.tone += ((eTone.at(3) & 0xf0) >> 4) * 1000;
|
t.tone += ((eTone.at(1) & 0xf0) >> 4) * 1000;
|
||||||
|
|
||||||
return t;
|
return t;
|
||||||
}
|
}
|
||||||
|
@ -717,7 +716,7 @@ void rigCommander::parseCommand()
|
||||||
if (rigCaps.hasCommand29 && payloadIn[0] == '\x29')
|
if (rigCaps.hasCommand29 && payloadIn[0] == '\x29')
|
||||||
{
|
{
|
||||||
vfo = static_cast<uchar>(payloadIn[1]);
|
vfo = static_cast<uchar>(payloadIn[1]);
|
||||||
payloadIn.remove(0,2);
|
payloadIn.remove(0,2);
|
||||||
}
|
}
|
||||||
|
|
||||||
// As some commands bave both single and multi-byte options, start at 4 characters and work down to 1.
|
// As some commands bave both single and multi-byte options, start at 4 characters and work down to 1.
|
||||||
|
|
Ładowanie…
Reference in New Issue