From 6c8fb1529fe78c62938d02b2d11be3325ae94495 Mon Sep 17 00:00:00 2001 From: Hannes Matuschek Date: Mon, 28 Feb 2022 09:39:31 +0100 Subject: [PATCH] Fixed encoding/decoding of DCS settings for all AnyTone devices. Addresses #205. --- lib/anytone_codeplug.cc | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/lib/anytone_codeplug.cc b/lib/anytone_codeplug.cc index 75bbdf24..a0389e7e 100644 --- a/lib/anytone_codeplug.cc +++ b/lib/anytone_codeplug.cc @@ -300,24 +300,24 @@ AnytoneCodeplug::ChannelElement::setRXCTCSS(Code tone) { Signaling::Code AnytoneCodeplug::ChannelElement::txDCS() const { uint16_t code = getUInt16_le(0x000c); - if (512 < code) + if (512 > code) return Signaling::fromDCSNumber(dec_to_oct(code), false); return Signaling::fromDCSNumber(dec_to_oct(code-512), true); } void AnytoneCodeplug::ChannelElement::setTXDCS(Code code) { if (Signaling::isDCSNormal(code)) - setUInt8(0x000c, oct_to_dec(Signaling::toDCSNumber(code))); + setUInt16_le(0x000c, oct_to_dec(Signaling::toDCSNumber(code))); else if (Signaling::isDCSInverted(code)) - setUInt8(0x000c, oct_to_dec(Signaling::toDCSNumber(code))+512); + setUInt16_le(0x000c, oct_to_dec(Signaling::toDCSNumber(code))+512); else - setUInt8(0x000c, 0); + setUInt16_le(0x000c, 0); } Signaling::Code AnytoneCodeplug::ChannelElement::rxDCS() const { uint16_t code = getUInt16_le(0x000e); - if (512 < code) + if (512 > code) return Signaling::fromDCSNumber(dec_to_oct(code), false); return Signaling::fromDCSNumber(dec_to_oct(code-512), true); }