Cosmetics

This commit is contained in:
Nick Foster 2010-11-28 17:07:09 -08:00
parent f8966f0d10
commit 00bcc041b2
2 changed files with 5 additions and 18 deletions

View File

@ -125,10 +125,10 @@ int air_modes_preamble::work(int noutput_items,
bool early, late; bool early, late;
do { do {
early = late = false; early = late = false;
gate_sum_early= bit_energy(&inraw[i+pulse_offsets[0]-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[1]-1], d_samples_per_chip)
+ bit_energy(&inraw[i+pulse_offsets[2]-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); // + 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) 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) + bit_energy(&inraw[i+pulse_offsets[1]], d_samples_per_chip)

View File

@ -230,38 +230,25 @@ int air_modes_slicer::work(int noutput_items,
rx_packet.parity = modes_check_parity(rx_packet.data, packet_length); rx_packet.parity = modes_check_parity(rx_packet.data, packet_length);
if(rx_packet.parity && rx_packet.type == Long_Packet) { if(rx_packet.parity && rx_packet.type == Long_Packet) {
// long before = rx_packet.parity;
bruteResultTypeDef bruteResult = modes_ec_brute(rx_packet); bruteResultTypeDef bruteResult = modes_ec_brute(rx_packet);
if(bruteResult == No_Solution) { if(bruteResult == No_Solution) {
//printf("No solution!\n");
continue; continue;
} else if(bruteResult == Multiple_Solutions) { } else if(bruteResult == Multiple_Solutions) {
// printf("Multiple solutions!\n");
continue; continue;
} else if(bruteResult == Too_Many_LCBs) { } else if(bruteResult == Too_Many_LCBs) {
//printf("Too many LCBs (%i)!\n", rx_packet.numlowconf);
continue; continue;
} else if(bruteResult == No_Error) { } else if(bruteResult == No_Error) {
// printf("No error!\n");
} else if(bruteResult == Solution_Found) { } else if(bruteResult == Solution_Found) {
// printf("Solution found for %i LCBs!\n", rx_packet.numlowconf); // 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 //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 //56 long packet data bits if applicable (zero-padded if not), followed by parity
d_payload.str(""); d_payload.str("");
d_payload << std::dec << std::setw(2) << std::setfill('0') << rx_packet.message_type << std::hex << " "; d_payload << std::dec << std::setw(2) << std::setfill('0') << rx_packet.message_type << std::hex << " ";
for(int m = 0; m < 4; m++) { for(int m = 0; m < 4; m++) {
d_payload << std::setw(2) << std::setfill('0') << unsigned(rx_packet.data[m]); d_payload << std::setw(2) << std::setfill('0') << unsigned(rx_packet.data[m]);
} }