Skip to content

Commit

Permalink
Recalculate the CRC when getting the raw LICH data.
Browse files Browse the repository at this point in the history
  • Loading branch information
g4klx committed Mar 20, 2018
1 parent 5b45767 commit 528c0f3
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion NXDNLICH.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,16 @@ unsigned char CNXDNLICH::getDirection() const

unsigned char CNXDNLICH::getRaw() const
{
switch (m_lich[0U] & 0xF0U) {
case 0x80U:
case 0xB0U:
m_lich[0U] |= 0x01U;
break;
default:
m_lich[0U] &= 0xFEU;
break;
}

return m_lich[0U];
}

Expand All @@ -127,7 +137,7 @@ void CNXDNLICH::setFCT(unsigned char usc)
void CNXDNLICH::setOption(unsigned char option)
{
m_lich[0U] &= 0xF3U;
m_lich[0u] |= (option << 2) & 0x0CU;
m_lich[0U] |= (option << 2) & 0x0CU;
}

void CNXDNLICH::setDirection(unsigned char direction)
Expand Down

0 comments on commit 528c0f3

Please sign in to comment.