diff options
author | Matthias P. Braendli <matthias.braendli@mpb.li> | 2016-03-21 20:08:22 +0100 |
---|---|---|
committer | Matthias P. Braendli <matthias.braendli@mpb.li> | 2016-03-21 20:08:22 +0100 |
commit | 0b21a0b19c285da1905263c78dfde4378846ae9f (patch) | |
tree | 5561bc285ada8219fa1fe8967de6d14523aab9e0 /rdsparse | |
parent | 78a5d1945922e9d4b9932c9d39d61a9f192bcd56 (diff) | |
download | mmbtools-aux-0b21a0b19c285da1905263c78dfde4378846ae9f.tar.gz mmbtools-aux-0b21a0b19c285da1905263c78dfde4378846ae9f.tar.bz2 mmbtools-aux-0b21a0b19c285da1905263c78dfde4378846ae9f.zip |
Big cleanup
Diffstat (limited to 'rdsparse')
-rw-r--r-- | rdsparse/decoder_impl.cc | 21 |
1 files changed, 18 insertions, 3 deletions
diff --git a/rdsparse/decoder_impl.cc b/rdsparse/decoder_impl.cc index 2bfa5a4..625a520 100644 --- a/rdsparse/decoder_impl.cc +++ b/rdsparse/decoder_impl.cc @@ -101,14 +101,24 @@ int decoder_impl::work (int noutput_items, lastseen_offset=j; lastseen_offset_counter=bit_counter; presync=true; + lout << "@@@@@ presync" << std::endl; } else { bit_distance=bit_counter-lastseen_offset_counter; - if (offset_pos[lastseen_offset]>=offset_pos[j]) + if (offset_pos[lastseen_offset]>=offset_pos[j]) { block_distance=offset_pos[j]+4-offset_pos[lastseen_offset]; - else + } + else { block_distance=offset_pos[j]-offset_pos[lastseen_offset]; - if ((block_distance*26)!=bit_distance) presync=false; + } + + if ((block_distance*26)!=bit_distance) { + presync=false; + lout << "@@@@@ presync lost " << j << " " << + block_distance*26 << " " << + bit_distance << " " << + std::endl; + } else { lout << "@@@@@ Sync State Detected" << std::endl; enter_sync(j); @@ -148,6 +158,11 @@ int decoder_impl::work (int noutput_items, else { wrong_blocks_counter++; good_block=false; + lout << "@@@@@ CRC " << + std::hex << std::setfill('0') << std::setw(4) << + block_received_crc << " " << + std::hex << std::setfill('0') << std::setw(4) << + block_calculated_crc << std::dec << std::endl; } } /* done checking CRC */ |