Skip to content

Commit

Permalink
Fixed creation of APRS channel when decoding D878UV codeplugs.
Browse files Browse the repository at this point in the history
  • Loading branch information
hmatuschek committed Feb 28, 2022
1 parent 80f2721 commit 986d807
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
8 changes: 8 additions & 0 deletions lib/d878uv_codeplug.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1368,6 +1368,14 @@ D878UVCodeplug::AnalogAPRSSettingsElement::clear() {
setUInt8(0x003d, 0x01); setUInt8(0x003e, 0x03); setUInt8(0x003f, 0xff);
}

bool
D878UVCodeplug::AnalogAPRSSettingsElement::isValid() const {
if (! Codeplug::Element::isValid())
return false;
return (0 != frequency()) && (! destination().simplified().isEmpty())
&& (! source().simplified().isEmpty());
}

unsigned
D878UVCodeplug::AnalogAPRSSettingsElement::frequency() const {
return ((unsigned)getBCD8_be(0x0001))*10;
Expand Down
1 change: 1 addition & 0 deletions lib/d878uv_codeplug.hh
Original file line number Diff line number Diff line change
Expand Up @@ -879,6 +879,7 @@ public:

/** Resets the settings. */
void clear();
bool isValid() const;

/** Returns the transmit frequency in Hz. */
virtual unsigned frequency() const;
Expand Down

0 comments on commit 986d807

Please sign in to comment.