From f95b7543c8c47a4c4d80608f28fa9e6dc09f6cd9 Mon Sep 17 00:00:00 2001 From: Harald Welte Date: Sun, 29 Mar 2015 16:29:09 +0200 Subject: [PATCH] Add gr-adsbtx as a proper packaged gnuradio block Using that block you can feed ascii-encoded ADS-B messages via TCP into gnuradio, which will then take care of encoding/transmitting the respective bursts. --- README | 15 +- adsb_gen.grc | 1429 +++++++++++++++++++++++ gr-adsbtx/CMakeLists.txt | 2 +- gr-adsbtx/grc/CMakeLists.txt | 1 + gr-adsbtx/include/adsbtx/AdsbEncoder.h | 50 + gr-adsbtx/include/adsbtx/CMakeLists.txt | 1 + gr-adsbtx/include/adsbtx/api.h | 4 +- gr-adsbtx/lib/AdsbEncoder_impl.cc | 242 ++++ gr-adsbtx/lib/AdsbEncoder_impl.h | 49 + gr-adsbtx/lib/CMakeLists.txt | 7 +- gr-adsbtx/swig/adsbtx_swig.i | 3 + 11 files changed, 1798 insertions(+), 5 deletions(-) create mode 100644 adsb_gen.grc create mode 100644 gr-adsbtx/include/adsbtx/AdsbEncoder.h create mode 100644 gr-adsbtx/lib/AdsbEncoder_impl.cc create mode 100644 gr-adsbtx/lib/AdsbEncoder_impl.h diff --git a/README b/README index 037b0c8..2d4fab8 100644 --- a/README +++ b/README @@ -1,5 +1,5 @@ Osmocom ADS-B generator/transmitter -(C) 2014 by Harald Welte +(C) 2014-2015 by Harald Welte ====================================================================== adsb_gen - ADS-B / Mode-S transmitter @@ -17,6 +17,10 @@ This is very early PoC code and can probably do with lots of improvements, particularly related to the modulation depth, transmit power, etc. +There are two ways of using the project: + +1) Old style (with gnuradio before it had PDU abstraction) + The idea is as follows: * provide a text file with ADS-B sentences in regular encoding like @@ -35,3 +39,12 @@ The idea is as follows: * the '-p' parameter can be used to configure the gap between subsequent ADS-B sentences (specified in microseconds). The default is 1s. + +2) New style (with gnuradio 3.7) + +* Build the gr-adsbtx module like usual using cmake/make + +* Run the adsb_gen.grc flow graph in gnuradio-companiion + +* Connect to localhost port 52002 and send ADS-B sentences + to it diff --git a/adsb_gen.grc b/adsb_gen.grc new file mode 100644 index 0000000..2a1d10b --- /dev/null +++ b/adsb_gen.grc @@ -0,0 +1,1429 @@ + + + + Sun Mar 29 16:24:46 2015 + + options + + id + top_block + + + _enabled + True + + + title + + + + author + + + + description + + + + window_size + 1280, 1024 + + + generate_options + wx_gui + + + category + Custom + + + run_options + prompt + + + run + True + + + max_nouts + 0 + + + realtime_scheduling + + + + alias + + + + _coordinate + (10, 10) + + + _rotation + 0 + + + + variable + + id + samp_rate + + + _enabled + True + + + value + 4000000 + + + alias + + + + _coordinate + (10, 170) + + + _rotation + 0 + + + + wxgui_waterfallsink2 + + id + wxgui_waterfallsink2_0 + + + _enabled + False + + + type + complex + + + title + Waterfall Plot + + + samp_rate + samp_rate + + + baseband_freq + 0 + + + dynamic_range + 1 + + + ref_level + 0 + + + ref_scale + 2.0 + + + fft_size + 512 + + + fft_rate + 15 + + + average + False + + + avg_alpha + 0 + + + win + None + + + win_size + + + + grid_pos + + + + notebook + + + + freqvar + None + + + alias + + + + affinity + + + + _coordinate + (1024, 12) + + + _rotation + 0 + + + + analog_sig_source_x + + id + analog_sig_source_x_0_0 + + + _enabled + True + + + type + complex + + + samp_rate + samp_rate + + + waveform + analog.GR_COS_WAVE + + + freq + 0 + + + amp + 1 + + + offset + 0 + + + alias + + + + affinity + + + + minoutbuf + 0 + + + maxoutbuf + 0 + + + _coordinate + (496, 72) + + + _rotation + 0 + + + + blocks_char_to_float + + id + blocks_char_to_float_0 + + + _enabled + True + + + vlen + 1 + + + scale + 1 + + + alias + + + + affinity + + + + minoutbuf + 0 + + + maxoutbuf + 0 + + + _coordinate + (328, 244) + + + _rotation + 0 + + + + blocks_repeat + + id + blocks_repeat_0 + + + _enabled + True + + + type + byte + + + interp + 2 + + + vlen + 1 + + + alias + + + + affinity + + + + minoutbuf + 0 + + + maxoutbuf + 0 + + + _coordinate + (280, 340) + + + _rotation + 0 + + + + analog_const_source_x + + id + analog_const_source_x_0 + + + _enabled + False + + + type + float + + + const + 0 + + + alias + + + + affinity + + + + minoutbuf + 0 + + + maxoutbuf + 0 + + + _coordinate + (424, 420) + + + _rotation + 0 + + + + blocks_pdu_to_tagged_stream + + id + blocks_pdu_to_tagged_stream_0 + + + _enabled + True + + + type + byte + + + tag + packet_len + + + alias + + + + affinity + + + + minoutbuf + 0 + + + maxoutbuf + 0 + + + _coordinate + (40, 460) + + + _rotation + 0 + + + + blocks_socket_pdu + + id + blocks_socket_pdu_0 + + + _enabled + True + + + type + "TCP_SERVER" + + + host + + + + port + 52002 + + + mtu + 10000 + + + tcp_no_delay + False + + + alias + + + + affinity + + + + minoutbuf + 0 + + + maxoutbuf + 0 + + + _coordinate + (32, 271) + + + _rotation + 0 + + + + AdsbEncoder + + id + AdsbEncoder_0 + + + _enabled + True + + + alias + + + + affinity + + + + minoutbuf + 0 + + + maxoutbuf + 0 + + + _coordinate + (56, 391) + + + _rotation + 0 + + + + blocks_float_to_complex + + id + blocks_float_to_complex_0 + + + _enabled + True + + + vlen + 1 + + + alias + + + + affinity + + + + minoutbuf + 0 + + + maxoutbuf + 0 + + + _coordinate + (496, 327) + + + _rotation + 0 + + + + blocks_multiply_xx + + id + blocks_multiply_xx_0 + + + _enabled + True + + + type + complex + + + num_inputs + 2 + + + vlen + 1 + + + alias + + + + affinity + + + + minoutbuf + 0 + + + maxoutbuf + 0 + + + _coordinate + (728, 271) + + + _rotation + 0 + + + + wxgui_scopesink2 + + id + wxgui_scopesink2_0 + + + _enabled + False + + + type + complex + + + title + Scope Plot + + + samp_rate + samp_rate + + + v_scale + 0 + + + v_offset + 0 + + + t_scale + 0.01 + + + ac_couple + False + + + xy_mode + False + + + num_inputs + 1 + + + win_size + + + + grid_pos + + + + notebook + + + + trig_mode + wxgui.TRIG_MODE_AUTO + + + y_axis_label + Counts + + + alias + + + + affinity + + + + _coordinate + (1040, 224) + + + _rotation + 0 + + + + uhd_usrp_sink + + id + uhd_usrp_sink_0 + + + _enabled + True + + + type + fc32 + + + otw + + + + stream_args + + + + stream_chans + [] + + + dev_addr + "" + + + dev_args + "" + + + sync + + + + clock_rate + 0.0 + + + num_mboards + 1 + + + clock_source0 + + + + time_source0 + + + + sd_spec0 + A:A + + + clock_source1 + + + + time_source1 + + + + sd_spec1 + + + + clock_source2 + + + + time_source2 + + + + sd_spec2 + + + + clock_source3 + + + + time_source3 + + + + sd_spec3 + + + + clock_source4 + + + + time_source4 + + + + sd_spec4 + + + + clock_source5 + + + + time_source5 + + + + sd_spec5 + + + + clock_source6 + + + + time_source6 + + + + sd_spec6 + + + + clock_source7 + + + + time_source7 + + + + sd_spec7 + + + + nchan + 1 + + + samp_rate + samp_rate + + + center_freq0 + 1090000000 + + + gain0 + 20 + + + ant0 + + + + bw0 + 0 + + + center_freq1 + 0 + + + gain1 + 0 + + + ant1 + + + + bw1 + 0 + + + center_freq2 + 0 + + + gain2 + 0 + + + ant2 + + + + bw2 + 0 + + + center_freq3 + 0 + + + gain3 + 0 + + + ant3 + + + + bw3 + 0 + + + center_freq4 + 0 + + + gain4 + 0 + + + ant4 + + + + bw4 + 0 + + + center_freq5 + 0 + + + gain5 + 0 + + + ant5 + + + + bw5 + 0 + + + center_freq6 + 0 + + + gain6 + 0 + + + ant6 + + + + bw6 + 0 + + + center_freq7 + 0 + + + gain7 + 0 + + + ant7 + + + + bw7 + 0 + + + center_freq8 + 0 + + + gain8 + 0 + + + ant8 + + + + bw8 + 0 + + + center_freq9 + 0 + + + gain9 + 0 + + + ant9 + + + + bw9 + 0 + + + center_freq10 + 0 + + + gain10 + 0 + + + ant10 + + + + bw10 + 0 + + + center_freq11 + 0 + + + gain11 + 0 + + + ant11 + + + + bw11 + 0 + + + center_freq12 + 0 + + + gain12 + 0 + + + ant12 + + + + bw12 + 0 + + + center_freq13 + 0 + + + gain13 + 0 + + + ant13 + + + + bw13 + 0 + + + center_freq14 + 0 + + + gain14 + 0 + + + ant14 + + + + bw14 + 0 + + + center_freq15 + 0 + + + gain15 + 0 + + + ant15 + + + + bw15 + 0 + + + center_freq16 + 0 + + + gain16 + 0 + + + ant16 + + + + bw16 + 0 + + + center_freq17 + 0 + + + gain17 + 0 + + + ant17 + + + + bw17 + 0 + + + center_freq18 + 0 + + + gain18 + 0 + + + ant18 + + + + bw18 + 0 + + + center_freq19 + 0 + + + gain19 + 0 + + + ant19 + + + + bw19 + 0 + + + center_freq20 + 0 + + + gain20 + 0 + + + ant20 + + + + bw20 + 0 + + + center_freq21 + 0 + + + gain21 + 0 + + + ant21 + + + + bw21 + 0 + + + center_freq22 + 0 + + + gain22 + 0 + + + ant22 + + + + bw22 + 0 + + + center_freq23 + 0 + + + gain23 + 0 + + + ant23 + + + + bw23 + 0 + + + center_freq24 + 0 + + + gain24 + 0 + + + ant24 + + + + bw24 + 0 + + + center_freq25 + 0 + + + gain25 + 0 + + + ant25 + + + + bw25 + 0 + + + center_freq26 + 0 + + + gain26 + 0 + + + ant26 + + + + bw26 + 0 + + + center_freq27 + 0 + + + gain27 + 0 + + + ant27 + + + + bw27 + 0 + + + center_freq28 + 0 + + + gain28 + 0 + + + ant28 + + + + bw28 + 0 + + + center_freq29 + 0 + + + gain29 + 0 + + + ant29 + + + + bw29 + 0 + + + center_freq30 + 0 + + + gain30 + 0 + + + ant30 + + + + bw30 + 0 + + + center_freq31 + 0 + + + gain31 + 0 + + + ant31 + + + + bw31 + 0 + + + len_tag_name + + + + alias + + + + affinity + + + + _coordinate + (984, 392) + + + _rotation + 0 + + + + blocks_multiply_xx_0 + uhd_usrp_sink_0 + 0 + 0 + + + analog_sig_source_x_0_0 + blocks_multiply_xx_0 + 0 + 0 + + + blocks_char_to_float_0 + blocks_float_to_complex_0 + 0 + 0 + + + analog_const_source_x_0 + blocks_float_to_complex_0 + 0 + 1 + + + blocks_multiply_xx_0 + wxgui_waterfallsink2_0 + 0 + 0 + + + blocks_multiply_xx_0 + wxgui_scopesink2_0 + 0 + 0 + + + blocks_repeat_0 + blocks_char_to_float_0 + 0 + 0 + + + blocks_pdu_to_tagged_stream_0 + blocks_repeat_0 + 0 + 0 + + + AdsbEncoder_0 + blocks_pdu_to_tagged_stream_0 + pdus + pdus + + + blocks_socket_pdu_0 + AdsbEncoder_0 + pdus + pdus + + + blocks_float_to_complex_0 + blocks_multiply_xx_0 + 0 + 1 + + diff --git a/gr-adsbtx/CMakeLists.txt b/gr-adsbtx/CMakeLists.txt index 45326e8..3ae8cc2 100644 --- a/gr-adsbtx/CMakeLists.txt +++ b/gr-adsbtx/CMakeLists.txt @@ -90,7 +90,7 @@ find_package(Doxygen) # components required to the list of GR_REQUIRED_COMPONENTS (in all # caps such as FILTER or FFT) and change the version to the minimum # API compatible version required. -set(GR_REQUIRED_COMPONENTS RUNTIME) +set(GR_REQUIRED_COMPONENTS RUNTIME PMT BLOCKS) find_package(Gnuradio "3.7.2" REQUIRED) if(NOT CPPUNIT_FOUND) diff --git a/gr-adsbtx/grc/CMakeLists.txt b/gr-adsbtx/grc/CMakeLists.txt index d776de7..4c98d0f 100644 --- a/gr-adsbtx/grc/CMakeLists.txt +++ b/gr-adsbtx/grc/CMakeLists.txt @@ -18,5 +18,6 @@ # Boston, MA 02110-1301, USA. install(FILES + adsbtx_AdsbEncoder.xml DESTINATION share/gnuradio/grc/blocks ) diff --git a/gr-adsbtx/include/adsbtx/AdsbEncoder.h b/gr-adsbtx/include/adsbtx/AdsbEncoder.h new file mode 100644 index 0000000..1136d7d --- /dev/null +++ b/gr-adsbtx/include/adsbtx/AdsbEncoder.h @@ -0,0 +1,50 @@ +/* -*- c++ -*- */ +/* + * Copyright 2013 <+YOU OR YOUR COMPANY+>. + * + * This is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3, or (at your option) + * any later version. + * + * This software is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this software; see the file COPYING. If not, write to + * the Free Software Foundation, Inc., 51 Franklin Street, + * Boston, MA 02110-1301, USA. + */ + + +#ifndef INCLUDED_ADSBTX_ADSBENCODER_H +#define INCLUDED_ADSBTX_ADSBENCODER_H + +#include +#include +#include +#include + +namespace gr { + namespace adsbtx { + + /*! + * \brief Builds ADSB Frame + * \ingroup adsbtx + * + */ + class ADSBTX_API AdsbEncoder : virtual public block + { + public: + typedef boost::shared_ptr sptr; + + static sptr make(void); + }; + + } // namespace adsbtx +} // namespace gr + +#endif /* INCLUDED_ADSBTX_BUILD_FRAME_H */ + diff --git a/gr-adsbtx/include/adsbtx/CMakeLists.txt b/gr-adsbtx/include/adsbtx/CMakeLists.txt index 3cbf09e..bf8428b 100644 --- a/gr-adsbtx/include/adsbtx/CMakeLists.txt +++ b/gr-adsbtx/include/adsbtx/CMakeLists.txt @@ -22,5 +22,6 @@ ######################################################################## install(FILES api.h + AdsbEncoder.h DESTINATION include/adsbtx ) diff --git a/gr-adsbtx/include/adsbtx/api.h b/gr-adsbtx/include/adsbtx/api.h index 081047a..b2eb8e6 100644 --- a/gr-adsbtx/include/adsbtx/api.h +++ b/gr-adsbtx/include/adsbtx/api.h @@ -22,9 +22,9 @@ #ifndef INCLUDED_ADSBTX_API_H #define INCLUDED_ADSBTX_API_H -#include +#include -#ifdef gnuradio_adsbtx_EXPORTS +#ifdef gnuradio_ADSBTX_EXPORTS # define ADSBTX_API __GR_ATTR_EXPORT #else # define ADSBTX_API __GR_ATTR_IMPORT diff --git a/gr-adsbtx/lib/AdsbEncoder_impl.cc b/gr-adsbtx/lib/AdsbEncoder_impl.cc new file mode 100644 index 0000000..63c4ac8 --- /dev/null +++ b/gr-adsbtx/lib/AdsbEncoder_impl.cc @@ -0,0 +1,242 @@ +/* -*- c++ -*- */ +/* + * Copyright 2015 Harald Welte . + * + * This is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3, or (at your option) + * any later version. + * + * This software is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this software; see the file COPYING. If not, write to + * the Free Software Foundation, Inc., 51 Franklin Street, + * Boston, MA 02110-1301, USA. + */ + +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +#include +#include +#include + +#include +#include +#include +#include "AdsbEncoder_impl.h" + +extern "C" { + +#include +#include + +#define PREAMBLE_LEN 8 +#define SHORT_LEN 56 +#define LONG_LEN 112 + +#define OUTBUF_SIZE ((LONG_LEN+PREAMBLE_LEN)*2) + +#define SPACE 0xff + +static const ubit_t preamble[PREAMBLE_LEN] = { 1, 1, SPACE, 0, 0, SPACE, SPACE, SPACE }; + +namespace gr { + namespace adsbtx { + + AdsbEncoder::sptr + AdsbEncoder::make() + { + return gnuradio::get_initial_sptr + (new AdsbEncoder_impl()); + } + + /* + * The private constructor + */ + AdsbEncoder_impl::AdsbEncoder_impl() + : block("ADS-B Payload to Symbols Encoder", + io_signature::make(0, 0, 0), + io_signature::make(0, 0, 0)) + { + message_port_register_out(pmt::mp("pdus")); + message_port_register_in(pmt::mp("pdus")); + set_msg_handler(pmt::mp("pdus"), boost::bind(&AdsbEncoder_impl::handle_msg, this, _1)); +#if 0 + 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/8, 0); + } +#endif + } + + + /* + * Our virtual destructor. + */ + AdsbEncoder_impl::~AdsbEncoder_impl() + { + } + +/* encode Pulse Position Modulation */ +static int ppm_encode(ubit_t *out, const ubit_t *in, unsigned int num_in) +{ + int i; + int j = 0; + + for (i = 0; i < num_in; i++) { + switch (in[i]) { + case 0: + out[j++] = 0; + out[j++] = 1; + break; + case 1: + out[j++] = 1; + out[j++] = 0; + break; + case SPACE: + out[j++] = 0; + out[j++] = 0; + break; + default: + return -1; + } + } + return 0; +} + +static int modes_encode_from_bin(ubit_t *out, const pbit_t *bin, unsigned int num_bits) +{ + ubit_t bitbuf[PREAMBLE_LEN+LONG_LEN]; + int rc, out_len; + + printf("from_bin(num_bits=%u)\n", num_bits); + + /* assemble the un-encoded bits of the entire message */ + memcpy(bitbuf, preamble, sizeof(preamble)); + rc = osmo_pbit2ubit(bitbuf+sizeof(preamble), bin, num_bits); + + printf("sym=%s\n", osmo_ubit_dump(bitbuf, num_bits+sizeof(preamble))); + + /* encode using pulse-position modulation */ + rc = ppm_encode(out, bitbuf, num_bits+sizeof(preamble)); + if (rc < 0) { + fprintf(stderr, "Error during ppm_encode\n"); + return rc; + } + + out_len = 2*(num_bits + sizeof(preamble)); + + printf("out=%s\n", osmo_ubit_dump(out, out_len)); + + return out_len; +} + +/* obtain last char of string */ +static char *lastch(char *line) +{ + int len = strlen(line); + if (len == 0) + return NULL; + return &line[len-1]; +} + +/* strip any trailing CR, LF or combinations thereof */ +static void chomp(char *line) +{ + char *ch; + + if (strlen(line) == 0) + return; + + for (ch = lastch(line); + ch != NULL && (*ch == '\n' || *ch == '\r'); + ch = lastch(line)) { + *ch = '\0'; + } +} + +static int modes_encode_from_ascii(ubit_t *out, const char *in, unsigned int length) +{ + char ascbuf[LONG_LEN*2]; + ubit_t binbuf[LONG_LEN]; + int num_bytes; + int rc; + + /* sanity checking */ + if (length > LONG_LEN*2 + 2) { + fprintf(stderr, "String too long!\n"); + return -1; + } + + memset(ascbuf, 0, sizeof(ascbuf)); + strncpy(ascbuf, in, length); + + /* remove any trailing line endings */ + chomp(ascbuf); + + if (ascbuf[0] != '*' || ascbuf[strlen(ascbuf)-1] != ';') { + fprintf(stderr, "string `%s' not in correct format\n", in); + return -2; + } + + /* remove trailing semicolon */ + ascbuf[strlen(ascbuf)-1] = '\0'; + + num_bytes = strlen(ascbuf) / 2; + + /* convert from hex to binary */ + rc = osmo_hexparse(ascbuf+1, binbuf, sizeof(binbuf)); + if (rc < 0) { + fprintf(stderr, "error during hexparse of `%s'\n", ascbuf); + return rc; + } + + /* encode the actual binary */ + return modes_encode_from_bin(out, binbuf, num_bytes*8); +} + + +void +AdsbEncoder_impl::handle_msg(pmt::pmt_t pdu) +{ + pmt::pmt_t meta = pmt::car(pdu); + pmt::pmt_t inpdu_bytes = pmt::cdr(pdu); + + if (pmt::is_null(meta)) { + meta = pmt::make_dict(); + } else if (!pmt::is_dict(meta)) { + throw std::runtime_error("received non PDU input"); + } + + /* FIXME */ + + if (!pmt::is_u8vector(inpdu_bytes)) + throw std::runtime_error("This block requires u8 vector as input"); + + size_t io(0); + const char *sentence = (const char *) uniform_vector_elements(inpdu_bytes, io); + ubit_t outbuf[OUTBUF_SIZE]; + int rc; + + rc = modes_encode_from_ascii(outbuf, sentence, pmt::length(inpdu_bytes)); + if (rc < 0) + return; + + pmt::pmt_t outpdu_bytes = make_pdu_vector(blocks::pdu::byte_t, outbuf, rc); + message_port_pub(pmt::mp("pdus"), pmt::cons(meta, outpdu_bytes)); + + } + + } /* namespace adsbtx */ +} /* namespace gr */ + +} diff --git a/gr-adsbtx/lib/AdsbEncoder_impl.h b/gr-adsbtx/lib/AdsbEncoder_impl.h new file mode 100644 index 0000000..e99835a --- /dev/null +++ b/gr-adsbtx/lib/AdsbEncoder_impl.h @@ -0,0 +1,49 @@ +/* -*- c++ -*- */ +/* + * Copyright 2013 <+YOU OR YOUR COMPANY+>. + * Copyright 2015 Harald Welte + * + * This is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3, or (at your option) + * any later version. + * + * This software is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this software; see the file COPYING. If not, write to + * the Free Software Foundation, Inc., 51 Franklin Street, + * Boston, MA 02110-1301, USA. + */ + +#ifndef INCLUDED_ADSBTX_BUILD_FRAME_IMPL_H +#define INCLUDED_ADSBTX_BUILD_FRAME_IMPL_H + +#include + +#define __VERSION 0.3 + +namespace gr { + namespace adsbtx { + + class AdsbEncoder_impl : public AdsbEncoder + { + private: + + + public: + AdsbEncoder_impl(void); + ~AdsbEncoder_impl(void); + + // Where all the action really happens + void handle_msg(pmt::pmt_t pdu); + }; + + } // namespace adsbtx +} // namespace gr + +#endif /* INCLUDED_ADSBTX_BUILD_FRAME_IMPL_H */ + diff --git a/gr-adsbtx/lib/CMakeLists.txt b/gr-adsbtx/lib/CMakeLists.txt index 92f39e2..bcaf2ca 100644 --- a/gr-adsbtx/lib/CMakeLists.txt +++ b/gr-adsbtx/lib/CMakeLists.txt @@ -26,6 +26,7 @@ include_directories(${Boost_INCLUDE_DIR}) link_directories(${Boost_LIBRARY_DIRS}) list(APPEND adsbtx_sources + AdsbEncoder_impl.cc ) set(adsbtx_sources "${adsbtx_sources}" PARENT_SCOPE) @@ -35,7 +36,10 @@ if(NOT adsbtx_sources) endif(NOT adsbtx_sources) add_library(gnuradio-adsbtx SHARED ${adsbtx_sources}) -target_link_libraries(gnuradio-adsbtx ${Boost_LIBRARIES} ${GNURADIO_ALL_LIBRARIES}) +target_link_libraries(gnuradio-adsbtx ${Boost_LIBRARIES} + ${GNURADIO_ALL_LIBRARIES} + -lvolk -losmocore + ) set_target_properties(gnuradio-adsbtx PROPERTIES DEFINE_SYMBOL "gnuradio_adsbtx_EXPORTS") if(APPLE) @@ -72,6 +76,7 @@ target_link_libraries( ${GNURADIO_RUNTIME_LIBRARIES} ${Boost_LIBRARIES} ${CPPUNIT_LIBRARIES} + -losmocore gnuradio-adsbtx ) diff --git a/gr-adsbtx/swig/adsbtx_swig.i b/gr-adsbtx/swig/adsbtx_swig.i index 88aa939..fb980a6 100644 --- a/gr-adsbtx/swig/adsbtx_swig.i +++ b/gr-adsbtx/swig/adsbtx_swig.i @@ -8,6 +8,9 @@ %include "adsbtx_swig_doc.i" %{ +#include "adsbtx/AdsbEncoder.h" %} +%include "adsbtx/AdsbEncoder.h" +GR_SWIG_BLOCK_MAGIC2(adsbtx, AdsbEncoder);