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 | |
parent | 90d7f7b0450f10bb963b3398da6391779c5fdd27 (diff) |
use 200 symbols for both lead-in and lead-out
it appears that the lead-out might even be more important?
-rw-r--r-- | adsb_gen.grc | 76 | ||||
-rw-r--r-- | gr-adsbtx/lib/AdsbEncoder_impl.cc | 17 | ||||
-rw-r--r-- | gr-adsbtx/lib/AdsbEncoder_impl.h | 1 |
3 files changed, 44 insertions, 50 deletions
diff --git a/adsb_gen.grc b/adsb_gen.grc index 8751c14..8f9382b 100644 --- a/adsb_gen.grc +++ b/adsb_gen.grc @@ -1,7 +1,7 @@ <?xml version='1.0' encoding='ASCII'?> <?grc format='1' created='3.7.5'?> <flow_graph> - <timestamp>Wed Apr 1 23:05:01 2015</timestamp> + <timestamp>Wed Apr 1 23:16:45 2015</timestamp> <block> <key>options</key> <param> @@ -184,41 +184,6 @@ </param> </block> <block> - <key>AdsbEncoder</key> - <param> - <key>id</key> - <value>AdsbEncoder_0</value> - </param> - <param> - <key>_enabled</key> - <value>True</value> - </param> - <param> - <key>alias</key> - <value></value> - </param> - <param> - <key>affinity</key> - <value></value> - </param> - <param> - <key>minoutbuf</key> - <value>0</value> - </param> - <param> - <key>maxoutbuf</key> - <value>0</value> - </param> - <param> - <key>_coordinate</key> - <value>(56, 391)</value> - </param> - <param> - <key>_rotation</key> - <value>0</value> - </param> - </block> - <block> <key>blocks_socket_pdu</key> <param> <key>id</key> @@ -1262,6 +1227,45 @@ <value>0</value> </param> </block> + <block> + <key>AdsbEncoder</key> + <param> + <key>id</key> + <value>AdsbEncoder_0</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>num_lead_in_syms</key> + <value>200</value> + </param> + <param> + <key>alias</key> + <value></value> + </param> + <param> + <key>affinity</key> + <value></value> + </param> + <param> + <key>minoutbuf</key> + <value>0</value> + </param> + <param> + <key>maxoutbuf</key> + <value>0</value> + </param> + <param> + <key>_coordinate</key> + <value>(56, 391)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + </block> <connection> <source_block_id>blocks_char_to_float_0</source_block_id> <sink_block_id>blocks_float_to_complex_0</sink_block_id> 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); |