Skip to content

Commit

Permalink
Remobe AMBE regeneration on data packets.
Browse files Browse the repository at this point in the history
  • Loading branch information
g4klx committed Oct 5, 2016
1 parent cb07423 commit 51c742e
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 3 deletions.
12 changes: 9 additions & 3 deletions DStarControl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,9 @@ bool CDStarControl::writeModem(unsigned char *data, unsigned int len)

return false;
} else if (m_rfState == RS_RF_AUDIO) {
unsigned int errors = m_fec.regenerateDStar(data + 1U);
unsigned int errors = 0U;
if (!m_rfHeader.isDataPacket())
errors = m_fec.regenerateDStar(data + 1U);

m_rfErrs += errors;
m_rfBits += 48U;
Expand Down Expand Up @@ -354,7 +356,9 @@ bool CDStarControl::writeModem(unsigned char *data, unsigned int len)

delete header;

unsigned int errors = m_fec.regenerateDStar(data + 1U);
unsigned int errors = 0U;
if (!m_rfHeader.isDataPacket())
errors = m_fec.regenerateDStar(data + 1U);

m_rfErrs += errors;
m_rfBits += 48U;
Expand Down Expand Up @@ -529,7 +533,9 @@ void CDStarControl::writeNetwork()

unsigned char n = data[1U];

unsigned int errors = m_fec.regenerateDStar(data + 2U);
unsigned int errors = 0U;
if (!m_netHeader.isDataPacket())
errors = m_fec.regenerateDStar(data + 2U);

blankDTMF(data + 2U);

Expand Down
5 changes: 5 additions & 0 deletions DStarHeader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,11 @@ void CDStarHeader::setRepeater(bool on)
m_header[0U] &= ~DSTAR_REPEATER_MASK;
}

bool CDStarHeader::isDataPacket() const
{
return (m_header[0U] & DSTAR_DATA_MASK) == DSTAR_DATA_MASK;
}

void CDStarHeader::setUnavailable(bool on)
{
if (on)
Expand Down
2 changes: 2 additions & 0 deletions DStarHeader.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ class CDStarHeader {
bool isRepeater() const;
void setRepeater(bool on);

bool isDataPacket() const;

void setUnavailable(bool on);

void getMyCall1(unsigned char* call1) const;
Expand Down

0 comments on commit 51c742e

Please sign in to comment.