From 00bcc041b2c0937a449c82eb5f29fdbb5a7efe7f Mon Sep 17 00:00:00 2001 From: Nick Foster Date: Sun, 28 Nov 2010 17:07:09 -0800 Subject: [PATCH] Cosmetics --- src/lib/air_modes_preamble.cc | 10 +++++----- src/lib/air_modes_slicer.cc | 13 ------------- 2 files changed, 5 insertions(+), 18 deletions(-) diff --git a/src/lib/air_modes_preamble.cc b/src/lib/air_modes_preamble.cc index b7593b9..05a969e 100644 --- a/src/lib/air_modes_preamble.cc +++ b/src/lib/air_modes_preamble.cc @@ -125,10 +125,10 @@ int air_modes_preamble::work(int noutput_items, bool early, late; do { early = late = false; - gate_sum_early= bit_energy(&inraw[i+pulse_offsets[0]-1], d_samples_per_chip) - + bit_energy(&inraw[i+pulse_offsets[1]-1], d_samples_per_chip) - + bit_energy(&inraw[i+pulse_offsets[2]-1], d_samples_per_chip) - + bit_energy(&inraw[i+pulse_offsets[3]-1], d_samples_per_chip); + //gate_sum_early= bit_energy(&inraw[i+pulse_offsets[0]-1], d_samples_per_chip) + // + bit_energy(&inraw[i+pulse_offsets[1]-1], d_samples_per_chip) + // + bit_energy(&inraw[i+pulse_offsets[2]-1], d_samples_per_chip) + // + bit_energy(&inraw[i+pulse_offsets[3]-1], d_samples_per_chip); gate_sum_now = bit_energy(&inraw[i+pulse_offsets[0]], d_samples_per_chip) + bit_energy(&inraw[i+pulse_offsets[1]], d_samples_per_chip) @@ -146,7 +146,7 @@ int air_modes_preamble::work(int noutput_items, //else if(early) i--; //if(early && late) early = late = false; } while(late); - + //finally after all this, let's post the preamble! add_item_tag(0, //stream ID nitems_written(0)+i, //sample diff --git a/src/lib/air_modes_slicer.cc b/src/lib/air_modes_slicer.cc index 7913414..21a79e8 100644 --- a/src/lib/air_modes_slicer.cc +++ b/src/lib/air_modes_slicer.cc @@ -230,38 +230,25 @@ int air_modes_slicer::work(int noutput_items, rx_packet.parity = modes_check_parity(rx_packet.data, packet_length); if(rx_packet.parity && rx_packet.type == Long_Packet) { -// long before = rx_packet.parity; bruteResultTypeDef bruteResult = modes_ec_brute(rx_packet); if(bruteResult == No_Solution) { - //printf("No solution!\n"); continue; } else if(bruteResult == Multiple_Solutions) { -// printf("Multiple solutions!\n"); continue; } else if(bruteResult == Too_Many_LCBs) { - //printf("Too many LCBs (%i)!\n", rx_packet.numlowconf); continue; } else if(bruteResult == No_Error) { -// printf("No error!\n"); } else if(bruteResult == Solution_Found) { // printf("Solution found for %i LCBs!\n", rx_packet.numlowconf); } -// rx_packet.parity = modes_check_parity(rx_packet.data, packet_length); -// if(rx_packet.parity) printf("Error: packet fails parity check after correction, was %x, now %x\n", before, rx_packet.parity); } -// if(rx_packet.parity && rx_packet.type == Long_Packet) printf("Error! Bad packet forwarded to the queue.\n"); - //now we have a complete packet with confidence data, let's print it to the message queue - //here, rather than send the entire packet, since we've already done parity checking and ECC in C++, we'll - //send just the data (no confidence bits), separated into fields for easier parsing. //we'll replicate some data by sending the message type as the first field, followed by the first 8+24=32 bits of the packet, followed by //56 long packet data bits if applicable (zero-padded if not), followed by parity d_payload.str(""); - d_payload << std::dec << std::setw(2) << std::setfill('0') << rx_packet.message_type << std::hex << " "; - for(int m = 0; m < 4; m++) { d_payload << std::setw(2) << std::setfill('0') << unsigned(rx_packet.data[m]); }