From fd6ee2ce89fdad87926467f25958fefda97b735b Mon Sep 17 00:00:00 2001 From: Nick Foster Date: Mon, 10 Jun 2013 07:47:42 -0400 Subject: [PATCH] Change reference output so it now outputs SNR, which is much more useful. --- lib/air_modes_preamble.cc | 4 ++-- lib/air_modes_slicer.cc | 7 ++++--- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/lib/air_modes_preamble.cc b/lib/air_modes_preamble.cc index b575ff2..284d8c1 100644 --- a/lib/air_modes_preamble.cc +++ b/lib/air_modes_preamble.cc @@ -210,10 +210,10 @@ int air_modes_preamble::general_work(int noutput_items, add_item_tag(0, //stream ID nitems_written(0), //sample d_key, //frame_info - pmt::pmt_from_double(tstamp), + pmt::pmt_make_tuple(pmt::pmt_from_double(tstamp), pmt::pmt_from_double(inavg[i])), d_me //block src id ); - + //std::cout << "PREAMBLE" << std::endl; //produce only one output per work call -- TODO this should probably change diff --git a/lib/air_modes_slicer.cc b/lib/air_modes_slicer.cc index 34d916d..43d60dd 100644 --- a/lib/air_modes_slicer.cc +++ b/lib/air_modes_slicer.cc @@ -159,8 +159,9 @@ int air_modes_slicer::work(int noutput_items, if(rx_packet.numlowconf < 24) rx_packet.lowconfbits[rx_packet.numlowconf++] = j; } } - - rx_packet.timestamp = pmt_to_double(tag_iter->value); + + rx_packet.timestamp = pmt_to_double(pmt_tuple_ref(tag_iter->value, 0)); + double ref = pmt_to_double(pmt_tuple_ref(tag_iter->value, 1)); //traverse the whole packet and if you find all 0's, just toss it. don't know why these packets turn up, but they pass ECC. bool zeroes = 1; @@ -186,7 +187,7 @@ int air_modes_slicer::work(int noutput_items, d_payload << std::hex << std::setw(2) << std::setfill('0') << unsigned(rx_packet.data[m]); } - d_payload << " " << std::setw(6) << rx_packet.crc << " " << std::dec << rx_packet.reference_level + d_payload << " " << std::setw(6) << rx_packet.crc << " " << std::dec << rx_packet.reference_level / ref << " " << std::setprecision(10) << std::setw(10) << rx_packet.timestamp; gr_message_sptr msg = gr_make_message_from_string(std::string(d_payload.str())); d_queue->handle(msg);