diff options
author | Harald Welte <laforge@gnumonks.org> | 2015-04-01 23:17:18 +0200 |
---|---|---|
committer | Harald Welte <laforge@gnumonks.org> | 2015-04-01 23:17:18 +0200 |
commit | dac8eb2ccf59c992d9829e6f1cc4ded9d7b5178f (patch) | |
tree | 79bbd4eb89f2fbf9a91bd2574f7a8e2dd511f547 /gr-adsbtx | |
parent | 90d7f7b0450f10bb963b3398da6391779c5fdd27 (diff) |
use 200 symbols for both lead-in and lead-out
it appears that the lead-out might even be more important?
Diffstat (limited to 'gr-adsbtx')
-rw-r--r-- | gr-adsbtx/lib/AdsbEncoder_impl.cc | 17 | ||||
-rw-r--r-- | gr-adsbtx/lib/AdsbEncoder_impl.h | 1 |
2 files changed, 4 insertions, 14 deletions
diff --git a/gr-adsbtx/lib/AdsbEncoder_impl.cc b/gr-adsbtx/lib/AdsbEncoder_impl.cc index 9af8415..ffa3ea0 100644 --- a/gr-adsbtx/lib/AdsbEncoder_impl.cc +++ b/gr-adsbtx/lib/AdsbEncoder_impl.cc @@ -69,13 +69,6 @@ namespace gr { message_port_register_in(pmt::mp("pdus")); set_msg_handler(pmt::mp("pdus"), boost::bind(&AdsbEncoder_impl::handle_msg, this, _1)); - if (d_num_lead_in_syms) { - /* round up to the next byte boundary */ - if (d_num_lead_in_syms % 8) - d_num_lead_in_syms += d_num_lead_in_syms % 8; - /* empty vector for lead-in */ - d_lead_in_bytes = pmt::make_u8vector(d_num_lead_in_syms, 0); - } } @@ -224,17 +217,15 @@ AdsbEncoder_impl::handle_msg(pmt::pmt_t pdu) size_t io(0); const char *sentence = (const char *) uniform_vector_elements(inpdu_bytes, io); - ubit_t outbuf[OUTBUF_SIZE]; + ubit_t outbuf[2*d_num_lead_in_syms+OUTBUF_SIZE]; int rc; - rc = modes_encode_from_ascii(outbuf, sentence, pmt::length(inpdu_bytes)); + memset(outbuf, 0, sizeof(outbuf)); + rc = modes_encode_from_ascii(outbuf+d_num_lead_in_syms, sentence, pmt::length(inpdu_bytes)); if (rc < 0) return; - if (d_lead_in_bytes) - message_port_pub(pmt::mp("pdus"), pmt::cons(meta, d_lead_in_bytes)); - - pmt::pmt_t outpdu_bytes = make_pdu_vector(blocks::pdu::byte_t, outbuf, rc); + pmt::pmt_t outpdu_bytes = make_pdu_vector(blocks::pdu::byte_t, outbuf, 2*d_num_lead_in_syms+rc); message_port_pub(pmt::mp("pdus"), pmt::cons(meta, outpdu_bytes)); } diff --git a/gr-adsbtx/lib/AdsbEncoder_impl.h b/gr-adsbtx/lib/AdsbEncoder_impl.h index 0e841a9..b9f6e7f 100644 --- a/gr-adsbtx/lib/AdsbEncoder_impl.h +++ b/gr-adsbtx/lib/AdsbEncoder_impl.h @@ -33,7 +33,6 @@ namespace gr { { private: unsigned int d_num_lead_in_syms; - pmt::pmt_t d_lead_in_bytes; public: AdsbEncoder_impl(unsigned int num_lead_in_syms); |