use 200 symbols for both lead-in and lead-out
it appears that the lead-out might even be more important?
This commit is contained in:
parent
90d7f7b045
commit
dac8eb2ccf
76
adsb_gen.grc
76
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>
|
||||
|
@ -183,41 +183,6 @@
|
|||
<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>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>
|
||||
|
@ -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>
|
||||
|
|
|
@ -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));
|
||||
|
||||
}
|
||||
|
|
|
@ -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);
|
||||
|
|
Loading…
Reference in New Issue