44 memset(
m_group, 0, 4*
sizeof(
int));
53 bool group_ready =
false;
54 unsigned int reg_syndrome;
55 unsigned long bit_distance, block_distance;
56 unsigned int block_calculated_crc, block_received_crc, checkword, dataword;
65 for (
int j = 0; j < 5; j++)
88 if ((block_distance*26)!=bit_distance)
113 dataword = (
m_reg>>10) & 0xffff;
115 checkword =
m_reg & 0x3ff;
122 if (block_received_crc==block_calculated_crc)
128 block_received_crc=checkword^offset_word[4];
130 if (block_received_crc==block_calculated_crc)
145 if (block_received_crc==block_calculated_crc)
242 unsigned long reg = 0;
244 const unsigned long poly = 0x5B9;
245 const unsigned char plen = 10;
247 for (i = mlen; i > 0; i--)
249 reg = (reg << 1) | ((message >> (i-1)) & 0x01);
250 if (reg & (1 << plen)) reg = reg ^ poly;
253 for (i = plen; i > 0; i--)
256 if (reg & (1<<plen)) {
261 return (reg & ((1<<plen)-1));
static const unsigned int offset_word[5]
bool m_groupAssemblyStarted
enum RDSDecoder::@0 m_sync
unsigned long m_bitCounter
unsigned long m_lastseenOffsetCounter
unsigned int m_blockBitCounter
static const unsigned int offset_pos[5]
unsigned int m_blocksCounter
unsigned char m_blockNumber
unsigned int m_groupGoodBlocksCounter
void enter_sync(unsigned int sync_block_number)
static const unsigned int syndrome[5]
unsigned int m_wrongBlocksCounter
unsigned int calc_syndrome(unsigned long message, unsigned char mlen)
unsigned char m_lastseenOffset