From 0b21a0b19c285da1905263c78dfde4378846ae9f Mon Sep 17 00:00:00 2001 From: "Matthias P. Braendli" Date: Mon, 21 Mar 2016 20:08:22 +0100 Subject: Big cleanup --- rdsparse/decoder_impl.cc | 21 ++++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) (limited to 'rdsparse') 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 */ -- cgit v1.2.3