├── .github └── ISSUE_TEMPLATE │ ├── bug_report.md │ ├── custom.md │ └── feature_request.md ├── .gitignore ├── CMakeLists.txt ├── README-gr3.10 ├── README-installation.md ├── README-rpi3-liquidsoap.md ├── README-update-rtlsdr.md ├── README.md ├── arch-install.sh ├── blacklist-rtl.conf ├── build_bindings.sh ├── cmake ├── Modules │ ├── CMakeParseArgumentsCopy.cmake │ ├── FindCppUnit.cmake │ ├── FindGnuradioRuntime.cmake │ ├── FindITPP.cmake │ ├── Findpcap.cmake │ ├── GrMiscUtils.cmake │ ├── GrPlatform.cmake │ └── GrTest.cmake └── cmake_uninstall.cmake.in ├── debug-build.sh ├── docs ├── CMakeLists.txt ├── README.op25 └── doxygen │ ├── CMakeLists.txt │ ├── Doxyfile.in │ ├── Doxyfile.swig_doc.in │ ├── doxyxml │ ├── __init__.py │ ├── base.py │ ├── doxyindex.py │ ├── generated │ │ ├── __init__.py │ │ ├── compound.py │ │ ├── compoundsuper.py │ │ ├── index.py │ │ └── indexsuper.py │ └── text.py │ ├── other │ ├── group_defs.dox │ └── main_page.dox │ ├── pydoc_macros.h │ ├── swig_doc.py │ └── update_pydoc.py ├── install.sh ├── op25-multi_rx.service ├── op25-multi_rx.sh ├── op25 ├── gr-op25 │ ├── CMakeLists.txt │ ├── apps │ │ └── CMakeLists.txt │ ├── cmake │ │ └── Modules │ │ │ ├── CMakeParseArgumentsCopy.cmake │ │ │ ├── gnuradio-op25Config.cmake │ │ │ └── targetConfig.cmake.in │ ├── docs │ │ ├── CMakeLists.txt │ │ ├── README.op25 │ │ └── doxygen │ │ │ ├── CMakeLists.txt │ │ │ ├── Doxyfile.in │ │ │ ├── Doxyfile.swig_doc.in │ │ │ ├── doxyxml │ │ │ ├── __init__.py │ │ │ ├── base.py │ │ │ ├── doxyindex.py │ │ │ ├── generated │ │ │ │ ├── __init__.py │ │ │ │ ├── compound.py │ │ │ │ ├── compoundsuper.py │ │ │ │ ├── index.py │ │ │ │ └── indexsuper.py │ │ │ └── text.py │ │ │ ├── other │ │ │ ├── group_defs.dox │ │ │ └── main_page.dox │ │ │ ├── pydoc_macros.h │ │ │ ├── swig_doc.py │ │ │ └── update_pydoc.py │ ├── grc │ │ ├── CMakeLists.txt │ │ ├── op25_decoder_bf.xml │ │ ├── op25_decoder_ff.xml │ │ ├── op25_fsk4_demod_ff.xml │ │ ├── op25_fsk4_slicer_fb.xml │ │ └── op25_pcap_source_b.xml │ ├── include │ │ └── gnuradio │ │ │ └── op25 │ │ │ ├── CMakeLists.txt │ │ │ ├── api.h │ │ │ ├── decoder_bf.h │ │ │ ├── decoder_ff.h │ │ │ ├── fsk4_demod_ff.h │ │ │ ├── fsk4_slicer_fb.h │ │ │ └── pcap_source_b.h │ ├── lib │ │ ├── CMakeLists.txt │ │ ├── abstract_data_unit.cc │ │ ├── abstract_data_unit.h │ │ ├── data_unit.cc │ │ ├── data_unit.h │ │ ├── data_unit_handler.cc │ │ ├── data_unit_handler.h │ │ ├── decoder_bf_impl.cc │ │ ├── decoder_bf_impl.h │ │ ├── decoder_ff_impl.cc │ │ ├── decoder_ff_impl.h │ │ ├── dummy_imbe_decoder.cc │ │ ├── dummy_imbe_decoder.h │ │ ├── fsk4_demod_ff_impl.cc │ │ ├── fsk4_demod_ff_impl.h │ │ ├── fsk4_slicer_fb_impl.cc │ │ ├── fsk4_slicer_fb_impl.h │ │ ├── hdu.cc │ │ ├── hdu.h │ │ ├── imbe_decoder.cc │ │ ├── imbe_decoder.h │ │ ├── imbe_decoder_factory.cc │ │ ├── ldu1.cc │ │ ├── ldu1.h │ │ ├── ldu2.cc │ │ ├── ldu2.h │ │ ├── logfile_du_handler.cc │ │ ├── logfile_du_handler.h │ │ ├── offline_imbe_decoder.cc │ │ ├── offline_imbe_decoder.h │ │ ├── op25.i │ │ ├── op25_golay.h │ │ ├── op25_hamming.h │ │ ├── op25_imbe_frame.h │ │ ├── op25_p25_frame.h │ │ ├── op25_yank.h │ │ ├── p25cai_du_handler.cc │ │ ├── p25cai_du_handler.h │ │ ├── pcap_source_b_impl.cc │ │ ├── pcap_source_b_impl.h │ │ ├── pdu.cc │ │ ├── pdu.h │ │ ├── pickle.cc │ │ ├── pickle.h │ │ ├── qa_op25.cc │ │ ├── qa_op25.h │ │ ├── snapshot_du_handler.cc │ │ ├── snapshot_du_handler.h │ │ ├── software_imbe_decoder.cc │ │ ├── software_imbe_decoder.h │ │ ├── tdu.cc │ │ ├── tdu.h │ │ ├── test_op25.cc │ │ ├── tsbk.cc │ │ ├── tsbk.h │ │ ├── value_string.cc │ │ ├── value_string.h │ │ ├── vc55_imbe_decoder.cc │ │ ├── vc55_imbe_decoder.h │ │ ├── voice_data_unit.cc │ │ ├── voice_data_unit.h │ │ ├── voice_du_handler.cc │ │ └── voice_du_handler.h │ └── python │ │ └── op25 │ │ ├── CMakeLists.txt │ │ ├── __init__.py │ │ ├── bindings │ │ ├── .gitignore │ │ ├── CMakeLists.txt │ │ ├── bind_oot_file.py │ │ ├── decoder_bf_python.cc │ │ ├── decoder_ff_python.cc │ │ ├── docstrings │ │ │ ├── decoder_bf_pydoc_template.h │ │ │ ├── decoder_ff_pydoc_template.h │ │ │ ├── fsk4_demod_ff_pydoc_template.h │ │ │ ├── fsk4_slicer_fb_pydoc_template.h │ │ │ └── pcap_source_b_pydoc_template.h │ │ ├── fsk4_demod_ff_python.cc │ │ ├── fsk4_slicer_fb_python.cc │ │ ├── header_utils.py │ │ ├── pcap_source_b_python.cc │ │ └── python_bindings.cc │ │ ├── qa_decoder_bf.py │ │ ├── qa_decoder_ff.py │ │ ├── qa_fsk4_demod_ff.py │ │ ├── qa_fsk4_slicer_fb.py │ │ └── qa_pcap_source_b.py └── gr-op25_repeater │ ├── CMakeLists.txt │ ├── apps │ ├── .gitignore │ ├── 5-sdr_hw.rules │ ├── CMakeLists.txt │ ├── README-analog.md │ ├── README-configuration.md │ ├── README-dmr.md │ ├── README-metadata.md │ ├── README-op25_stats.md │ ├── README-smartnet.md │ ├── README.md │ ├── audio.py │ ├── cfg.json │ ├── cfgtrunk.py │ ├── corr │ │ ├── 111113113311333313133333 │ │ ├── 11131131111333133333-6k │ │ ├── 113131333331313331113311 │ │ ├── 131111333113313313113313 │ │ ├── 13131333111311311133113311331133 │ │ ├── 131331111333333311111131 │ │ ├── 133313311131311113313331 │ │ ├── 311131133313133331131113 │ │ ├── 31131311331331111133131311311133 │ │ ├── 313113333111111133333313 │ │ ├── 313131313133131113313111 │ │ ├── 313133113131111313 │ │ ├── 313133113131111333 │ │ ├── 313133113131113113 │ │ ├── 313133113131113133 │ │ ├── 313333111331131131331131 │ │ └── 331313111113131113331133 │ ├── dmr_airspy_example.json │ ├── dmr_rtl_example.json │ ├── example_keys.json │ ├── example_liquidsoap.liq │ ├── gr_gnuplot.py │ ├── helper_funcs.py │ ├── http_server.py │ ├── icemeta.py │ ├── iq_example.json │ ├── log_ts.py │ ├── meta.json │ ├── multi_rx.py │ ├── nyseg.tsv │ ├── onondaga.tsv │ ├── ontario.tsv │ ├── op25-legacy.sh │ ├── op25-liq.service │ ├── op25-rx.service │ ├── op25.liq │ ├── op25.sh │ ├── op25_iqsrc.py │ ├── op25_nbfm.py │ ├── op25_stats.sh │ ├── op25_wavsrc.py │ ├── p25_airspy_example.json │ ├── p25_conventional_example.json │ ├── p25_decoder.py │ ├── p25_demodulator.py │ ├── p25_demodulator_dev.py │ ├── p25_rtl_example.json │ ├── p25_rtl_example.sh │ ├── p25_single_rtl_example.json │ ├── rms_agc.py │ ├── rx.py │ ├── sdrhw_removed.sh │ ├── setTrunkFreq.sh │ ├── smartnet_example.json │ ├── sockaudio.py │ ├── tdma │ │ ├── bit_utils.py │ │ ├── duid.py │ │ ├── isch.py │ │ ├── lfsr.py │ │ ├── rs.py │ │ ├── tdma-decode.py │ │ ├── tdma_audio.py │ │ └── vf.py │ ├── terminal.py │ ├── tk_p25.py │ ├── tk_smartnet.py │ ├── tk_trbo.py │ ├── tompkins.tsv │ ├── trunk.tsv │ ├── trunking.py │ ├── tx │ │ ├── dmr-cfg.dat │ │ ├── doc.html │ │ ├── dstar-cfg.dat │ │ ├── dv_tx.py │ │ ├── generate-tsbks.py │ │ ├── hackrf-tx.sh │ │ ├── multi_tx.py │ │ ├── op25_c4fm_mod.py │ │ ├── op25_tx.py │ │ ├── p25craft.py │ │ ├── test-data-1200-2.dat │ │ ├── test-data-1200-4.dat │ │ ├── unpack.py │ │ └── ysf-cfg.dat │ ├── util │ │ ├── arb-resample.py │ │ ├── convert_bin.py │ │ └── cqpsk-demod-file.py │ └── wav_example.json │ ├── cmake │ └── Modules │ │ ├── CMakeParseArgumentsCopy.cmake │ │ ├── gnuradio-op25_repeaterConfig.cmake │ │ └── targetConfig.cmake.in │ ├── docs │ ├── CMakeLists.txt │ ├── README.op25_repeater │ └── doxygen │ │ ├── CMakeLists.txt │ │ ├── Doxyfile.in │ │ ├── Doxyfile.swig_doc.in │ │ ├── doxyxml │ │ ├── __init__.py │ │ ├── base.py │ │ ├── doxyindex.py │ │ ├── generated │ │ │ ├── __init__.py │ │ │ ├── compound.py │ │ │ ├── compoundsuper.py │ │ │ ├── index.py │ │ │ └── indexsuper.py │ │ └── text.py │ │ ├── other │ │ ├── group_defs.dox │ │ └── main_page.dox │ │ ├── pydoc_macros.h │ │ ├── swig_doc.py │ │ └── update_pydoc.py │ ├── grc │ ├── CMakeLists.txt │ ├── op25_repeater_fsk4_slicer_fb.xml │ ├── op25_repeater_gardner_costas_cc.xml │ ├── op25_repeater_p25_frame_assembler.xml │ └── op25_repeater_vocoder.xml │ ├── include │ ├── gnuradio │ │ └── op25_repeater │ │ │ ├── CMakeLists.txt │ │ │ ├── ambe_encoder_sb.h │ │ │ ├── analog_udp.h │ │ │ ├── api.h │ │ │ ├── costas_loop_cc.h │ │ │ ├── dmr_bs_tx_bb.h │ │ │ ├── dstar_tx_sb.h │ │ │ ├── frame_assembler.h │ │ │ ├── fsk4_slicer_fb.h │ │ │ ├── gardner_cc.h │ │ │ ├── iqfile_source.h │ │ │ ├── p25_frame_assembler.h │ │ │ ├── rmsagc_ff.h │ │ │ ├── vocoder.h │ │ │ └── ysf_tx_sb.h │ └── nlohmann │ │ └── json.hpp │ ├── lib │ ├── BER.cc │ ├── CCITTChecksumReverse.cpp │ ├── CCITTChecksumReverse.h │ ├── CMakeLists.txt │ ├── ambe.c │ ├── ambe.h │ ├── ambe3600x2250_const.h │ ├── ambe3600x2400_const.h │ ├── ambe_encoder.cc │ ├── ambe_encoder.h │ ├── ambe_encoder_sb_impl.cc │ ├── ambe_encoder_sb_impl.h │ ├── analog_udp_impl.cc │ ├── analog_udp_impl.h │ ├── bch.cc │ ├── bch.h │ ├── ber1011.cc │ ├── bit_utils.h │ ├── bptc19696.cc │ ├── bptc19696.h │ ├── check_frame_sync.h │ ├── costas_loop_cc_impl.cc │ ├── costas_loop_cc_impl.h │ ├── crc16.h │ ├── d2460.cc │ ├── dmr_bs_tx_bb_impl.cc │ ├── dmr_bs_tx_bb_impl.h │ ├── dmr_cai.cc │ ├── dmr_cai.h │ ├── dmr_const.h │ ├── dmr_slot.cc │ ├── dmr_slot.h │ ├── dstar_header.h │ ├── dstar_tx_sb_impl.cc │ ├── dstar_tx_sb_impl.h │ ├── ezpwd │ │ ├── asserter │ │ ├── bch │ │ ├── bch_base │ │ ├── corrector │ │ ├── definitions │ │ ├── ezcod │ │ ├── output │ │ ├── rs │ │ ├── rs_base │ │ ├── serialize │ │ ├── serialize_definitions │ │ └── timeofday │ ├── frame_assembler_impl.cc │ ├── frame_assembler_impl.h │ ├── frame_sync_magics.h │ ├── fsk4_slicer_fb_impl.cc │ ├── fsk4_slicer_fb_impl.h │ ├── gardner_cc_impl.cc │ ├── gardner_cc_impl.h │ ├── golay2087.cc │ ├── golay2087.h │ ├── hamming.cc │ ├── hamming.h │ ├── imbe_decoder.cc │ ├── imbe_decoder.h │ ├── imbe_vocoder │ │ ├── CMakeLists.txt │ │ ├── aux_sub.cc │ │ ├── aux_sub.h │ │ ├── basic_op.h │ │ ├── basicop2.cc │ │ ├── ch_decode.cc │ │ ├── ch_decode.h │ │ ├── ch_encode.cc │ │ ├── ch_encode.h │ │ ├── dc_rmv.cc │ │ ├── dc_rmv.h │ │ ├── decode.cc │ │ ├── decode.h │ │ ├── dsp_sub.cc │ │ ├── dsp_sub.h │ │ ├── encode.cc │ │ ├── encode.h │ │ ├── globals.h │ │ ├── imbe.h │ │ ├── imbe_vocoder.cc │ │ ├── imbe_vocoder.h │ │ ├── math_sub.cc │ │ ├── math_sub.h │ │ ├── pe_lpf.cc │ │ ├── pe_lpf.h │ │ ├── pitch_est.cc │ │ ├── pitch_est.h │ │ ├── pitch_ref.cc │ │ ├── pitch_ref.h │ │ ├── qnt_sub.cc │ │ ├── qnt_sub.h │ │ ├── rand_gen.cc │ │ ├── rand_gen.h │ │ ├── sa_decode.cc │ │ ├── sa_decode.h │ │ ├── sa_encode.cc │ │ ├── sa_encode.h │ │ ├── sa_enh.cc │ │ ├── sa_enh.h │ │ ├── tbls.cc │ │ ├── tbls.h │ │ ├── typedef.h │ │ ├── typedefs.h │ │ ├── uv_synt.cc │ │ ├── uv_synt.h │ │ ├── v_synt.cc │ │ ├── v_synt.h │ │ ├── v_uv_det.cc │ │ └── v_uv_det.h │ ├── iqfile_source_impl.cc │ ├── iqfile_source_impl.h │ ├── log_ts.h │ ├── mbelib.c │ ├── mbelib.h │ ├── mbelib_const.h │ ├── op25_audio.cc │ ├── op25_audio.h │ ├── op25_crypt.h │ ├── op25_crypt_adp.cc │ ├── op25_crypt_adp.h │ ├── op25_crypt_aes.cc │ ├── op25_crypt_aes.h │ ├── op25_crypt_alg.h │ ├── op25_crypt_algs.cc │ ├── op25_crypt_algs.h │ ├── op25_crypt_des.cc │ ├── op25_crypt_des.h │ ├── op25_golay.h │ ├── op25_hamming.h │ ├── op25_imbe_frame.h │ ├── op25_msg_types.h │ ├── op25_p25_frame.h │ ├── op25_timer.cc │ ├── op25_timer.h │ ├── op25_yank.h │ ├── p25_dibit.h │ ├── p25_frame.h │ ├── p25_frame_assembler_impl.cc │ ├── p25_frame_assembler_impl.h │ ├── p25_framer.cc │ ├── p25_framer.h │ ├── p25p1_fdma.cc │ ├── p25p1_fdma.h │ ├── p25p1_voice_decode.cc │ ├── p25p1_voice_decode.h │ ├── p25p1_voice_encode.cc │ ├── p25p1_voice_encode.h │ ├── p25p2_duid.cc │ ├── p25p2_duid.h │ ├── p25p2_framer.cc │ ├── p25p2_framer.h │ ├── p25p2_isch.cc │ ├── p25p2_isch.h │ ├── p25p2_sync.cc │ ├── p25p2_sync.h │ ├── p25p2_tdma.cc │ ├── p25p2_tdma.h │ ├── p25p2_vf.cc │ ├── p25p2_vf.h │ ├── qa_op25_repeater.cc │ ├── qa_op25_repeater.h │ ├── rmsagc_ff_impl.cc │ ├── rmsagc_ff_impl.h │ ├── rs.cc │ ├── rs.h │ ├── rx_base.h │ ├── rx_smartnet.cc │ ├── rx_smartnet.h │ ├── rx_subchannel.cc │ ├── rx_subchannel.h │ ├── rx_sync.cc │ ├── rx_sync.h │ ├── scan4sync.cc │ ├── software_imbe_decoder.cc │ ├── software_imbe_decoder.h │ ├── test_op25_repeater.cc │ ├── trellis.cc │ ├── trellis.h │ ├── vocoder_impl.cc │ ├── vocoder_impl.h │ ├── ysf_const.h │ ├── ysf_tx_sb_impl.cc │ └── ysf_tx_sb_impl.h │ ├── python │ └── op25_repeater │ │ ├── CMakeLists.txt │ │ ├── __init__.py │ │ ├── bindings │ │ ├── .gitignore │ │ ├── CMakeLists.txt │ │ ├── ambe_encoder_sb_python.cc │ │ ├── analog_udp_python.cc │ │ ├── bind_oot_file.py │ │ ├── costas_loop_cc_python.cc │ │ ├── dmr_bs_tx_bb_python.cc │ │ ├── docstrings │ │ │ ├── ambe_encoder_sb_pydoc_template.h │ │ │ ├── analog_udp_pydoc_template.h │ │ │ ├── costas_loop_cc_pydoc_template.h │ │ │ ├── dmr_bs_tx_bb_pydoc_template.h │ │ │ ├── dstar_tx_sb_pydoc_template.h │ │ │ ├── frame_assembler_pydoc_template.h │ │ │ ├── fsk4_slicer_fb_pydoc_template.h │ │ │ ├── gardner_cc_pydoc_template.h │ │ │ ├── iqfile_source_pydoc_template.h │ │ │ ├── p25_frame_assembler_pydoc_template.h │ │ │ ├── rmsagc_ff_pydoc_template.h │ │ │ ├── vocoder_pydoc_template.h │ │ │ └── ysf_tx_sb_pydoc_template.h │ │ ├── dstar_tx_sb_python.cc │ │ ├── frame_assembler_python.cc │ │ ├── fsk4_slicer_fb_python.cc │ │ ├── gardner_cc_python.cc │ │ ├── header_utils.py │ │ ├── iqfile_source_python.cc │ │ ├── p25_frame_assembler_python.cc │ │ ├── python_bindings.cc │ │ ├── rmsagc_ff_python.cc │ │ ├── vocoder_python.cc │ │ └── ysf_tx_sb_python.cc │ │ ├── build_utils.py │ │ ├── build_utils_codes.py │ │ ├── qa_fsk4_slicer_fb.py │ │ ├── qa_gardner_costas_cc.py │ │ ├── qa_p25_frame_assembler.py │ │ └── qa_vocoder.py │ └── www │ ├── images │ ├── .gitignore │ └── 1x1.png │ └── www-static │ ├── config.js │ ├── favicon.ico │ ├── index.html │ ├── legacy-index.html │ ├── legacy-main.css │ ├── legacy-main.js │ ├── main.css │ └── main.js ├── parseheader_generic.py.patch ├── rebuild.sh └── update-rtlsdr.sh /.github/ISSUE_TEMPLATE/bug_report.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Bug report 3 | about: Create a report to help us improve 4 | title: '' 5 | labels: '' 6 | assignees: '' 7 | 8 | --- 9 | 10 | **Describe the bug** 11 | A clear and concise description of what the bug is. 12 | 13 | **To Reproduce** 14 | Steps to reproduce the behavior: 15 | 1. Go to '...' 16 | 2. Click on '....' 17 | 3. Scroll down to '....' 18 | 4. See error 19 | 20 | **Screenshots** 21 | If applicable, add screenshots to help explain your problem. 22 | 23 | **System Information (please complete the following information):** 24 | - OS: [e.g. Ununtu 22.04] 25 | - GNURadio version 26 | - GCC version 27 | 28 | **Additional context** 29 | Add any other context about the problem here. 30 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/custom.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Custom issue template 3 | about: Use this template for anything other than bugs or feature requests 4 | title: '' 5 | labels: '' 6 | assignees: '' 7 | 8 | --- 9 | 10 | **Describe issue 11 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/feature_request.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Feature request 3 | about: Suggest an idea for this project 4 | title: '' 5 | labels: '' 6 | assignees: '' 7 | 8 | --- 9 | 10 | **Is your feature request related to a problem? Please describe.** 11 | A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] 12 | 13 | **Describe the solution you'd like** 14 | A clear and concise description of what you want to happen. 15 | 16 | **Describe alternatives you've considered** 17 | A clear and concise description of any alternative solutions or features you've considered. 18 | 19 | **Additional context** 20 | Add any other context or screenshots about the feature request here. 21 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Untracked files in op25 hierachy 2 | build/ 3 | *.pyc 4 | -------------------------------------------------------------------------------- /README-gr3.10: -------------------------------------------------------------------------------- 1 | NOTE: As of 12/7/2024 origin/master is now gnuradio-3.10 based. gr310 branch will contain the most 2 | recent 'release' version. 3 | 4 | The git branch "gr310" is only designed for building on gnuradio-3.10 and above. If you are trying to 5 | build on a gnuradio-3.8 or prior system please "git checkout master" (head). Note that gnuradio-3.9 6 | was a transitional release and support is untested on this version of op25. 7 | 8 | If you are building op25 on a standard packaged Debian-derivative OS (e.g. Ubuntu 22, Linux Mint 21, 9 | Debian Bookworm) you should be able to git clone the repo, check out the gr310 branch and execute "install.sh" 10 | to build and install the app and libraries with minimal pain. 11 | 12 | If you plan on building op25 with a locally built & installed gnuradio (i.e. something other 13 | than an apt packaged version) you cannot run install.sh. Under these circumstances you have to make 14 | sure all dependencies are installed then perform the following steps: 15 | cd ~/op25 16 | mkdir build 17 | 18 | cd build 19 | cmake ../ 20 | 21 | make 22 | make install 23 | 24 | The git repo contains all op25 sources and python<->c++ binding code generated by pybind11. Unless you are 25 | changing interfaces, you should not need to recreate the bindings. 26 | NOTE that op25 and gnuradio MUST be compiled with the same version of compiler, which normally means the default 27 | supplied with your distro. Attempting to mix compilers will be an exercise in frustration... 28 | 29 | As of 2/14/2023 I have built and isuccessfully run op25 under the following gnuradio-3.10 distros: 30 | - Ubuntu 22.04, Mint 21.1, Debian Bookworm (using install.sh script) 31 | - Arch Linux (manual install) 32 | - Fedora 37 (manual install) 33 | 34 | /boatbod 35 | -------------------------------------------------------------------------------- /README-installation.md: -------------------------------------------------------------------------------- 1 | # How to Install OP25 2 | 3 | These high level instructions will lead you through installing op25 on Debian based Linux systems such as Ubuntu, Linux Mint and similar. 4 | 5 | **Note 1:** op25 is currently tested against gnuradio-3.7/python2 with Ubuntu 16.04 and gnuradio-3.8/python3 with Ubuntu 20.04. Build environment automatically figures out which version of gnuradio you have and therefore which version of python to use. 6 | 7 | **Note 2:** versions of cmake later than 3.10.3 have been known to cause dependency issues while building the swig libraries on pyhton2. At the current time if you experience build difficulties of this sort, try dropping back to cmake-3.10.3, delete the contents of `~/op25/build/` and start over. 8 | 9 | **Note 3:** There is also a `./rebuild.sh` script that will (optionally) update & rebuild op25, local changes must be committed or reverted for update to happen. 10 | 11 | 12 | ## 1. Install op25 13 | 14 | ``` 15 | sudo apt-get install git 16 | cd ~ 17 | git clone https://github.com/boatbod/op25 18 | cd op25 19 | ./install.sh 20 | ``` 21 | 22 | ## 2. Configure op25 23 | 24 | ``` 25 | cd ~/op25/op25/gr-op25_repeater/apps 26 | <<>> 27 | ``` 28 | 29 | See `~/op25/op25/gr-op25_repeater/apps/README-configuration` for more information. 30 | 31 | ## 3. Run op25 32 | 33 | ``` 34 | cd ~/op25/op25/gr-op25_repeater/apps 35 | ./op25.sh 36 | ``` 37 | -------------------------------------------------------------------------------- /README-update-rtlsdr.md: -------------------------------------------------------------------------------- 1 | The script "update-rtlsdr.sh" can be used to update the librtlsdr0 driver 2 | used by generic rtl-sdr dongles, including newer RTL-SDR Blog V4 hardware 3 | which may not be supported by the driver installed from your default 4 | package repository. 5 | 6 | Building the driver using this script has proven to be somewhat hit-or-miss, 7 | so I suggest you try running the default version first, and if it works, keep 8 | using it. Don't say I didn't warn you if things go wrong and you end up with 9 | no driver installed! 10 | 11 | If you are really sure you want to proceed, run this command: 12 | ./update-rtlsdr.sh 13 | -------------------------------------------------------------------------------- /arch-install.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # Arch Linux Boatbod OP25 Installer 3 | 4 | # Check for presence of yay and install if needed 5 | sudo pacman -S --needed base-devel git 6 | if ! [ -x "$(command -v yay)" ]; then 7 | (git clone https://aur.archlinux.org/yay yay_tmp; cd yay_tmp; makepkg -si; cd ..; rm -rf yay_tmp) 8 | fi 9 | 10 | # 11 | # Install required packages 12 | # 13 | sudo pacman -S --needed --noconfirm gnuradio gnuradio-osmosdr rtl-sdr libuhd cmake cppunit doxygen boost libpcap orc base-devel clang pkgconf python-thrift pybind11 python-numpy python-waitress python-setuptools gnuplot libsndfile spdlog hackrf 14 | yay -S --noconfirm itpp castxml python-pygccxml 15 | 16 | # 17 | # Check and fix missing libthrift-0.17.0.so (currently required for gnuradio modtool) 18 | # 19 | if ! [ -f /usr/lib/libthrift-0.17.0.so ]; then 20 | sudo ln /usr/lib/libthrift-0.18.0.so /usr/lib/libthrift-0.17.0.so 21 | fi 22 | 23 | # 24 | # Build the python/c++ bindings 25 | # 26 | ./build_bindings.sh 27 | 28 | # 29 | # Build op25 30 | # 31 | mkdir build 32 | cd build 33 | cmake -DCMAKE_INSTALL_PREFIX="/usr" ../ 34 | make 35 | sudo make install 36 | -------------------------------------------------------------------------------- /blacklist-rtl.conf: -------------------------------------------------------------------------------- 1 | blacklist dvb_usb_rtl28xxu 2 | blacklist rtl2832 3 | blacklist rtl2830 4 | blacklist rtl2838 5 | -------------------------------------------------------------------------------- /build_bindings.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | echo "Building bindings for gr-op25" 3 | (cd op25/gr-op25 4 | for module in include/gnuradio/op25/*.h; do 5 | module=$(basename $module .h) 6 | test "$module" = "api" && continue 7 | gr_modtool bind $module 8 | done) 9 | echo "Building bindings for gr-op25_repeater" 10 | (cd op25/gr-op25_repeater 11 | for module in include/gnuradio/op25_repeater/*.h; do 12 | module=$(basename $module .h) 13 | test "$module" = "api" && continue 14 | gr_modtool bind $module 15 | done) 16 | 17 | -------------------------------------------------------------------------------- /cmake/Modules/FindCppUnit.cmake: -------------------------------------------------------------------------------- 1 | # http://www.cmake.org/pipermail/cmake/2006-October/011446.html 2 | # Modified to use pkg config and use standard var names 3 | 4 | # 5 | # Find the CppUnit includes and library 6 | # 7 | # This module defines 8 | # CPPUNIT_INCLUDE_DIR, where to find tiff.h, etc. 9 | # CPPUNIT_LIBRARIES, the libraries to link against to use CppUnit. 10 | # CPPUNIT_FOUND, If false, do not try to use CppUnit. 11 | 12 | INCLUDE(FindPkgConfig) 13 | PKG_CHECK_MODULES(PC_CPPUNIT "cppunit") 14 | 15 | FIND_PATH(CPPUNIT_INCLUDE_DIRS 16 | NAMES cppunit/TestCase.h 17 | HINTS ${PC_CPPUNIT_INCLUDE_DIR} 18 | PATHS 19 | /usr/local/include 20 | /usr/include 21 | ) 22 | 23 | FIND_LIBRARY(CPPUNIT_LIBRARIES 24 | NAMES cppunit 25 | HINTS ${PC_CPPUNIT_LIBDIR} 26 | PATHS 27 | ${CPPUNIT_INCLUDE_DIRS}/../lib 28 | /usr/local/lib 29 | /usr/lib 30 | ) 31 | 32 | LIST(APPEND CPPUNIT_LIBRARIES ${CMAKE_DL_LIBS}) 33 | 34 | INCLUDE(FindPackageHandleStandardArgs) 35 | FIND_PACKAGE_HANDLE_STANDARD_ARGS(CPPUNIT DEFAULT_MSG CPPUNIT_LIBRARIES CPPUNIT_INCLUDE_DIRS) 36 | MARK_AS_ADVANCED(CPPUNIT_LIBRARIES CPPUNIT_INCLUDE_DIRS) 37 | -------------------------------------------------------------------------------- /cmake/Modules/FindGnuradioRuntime.cmake: -------------------------------------------------------------------------------- 1 | INCLUDE(FindPkgConfig) 2 | PKG_CHECK_MODULES(PC_GNURADIO_RUNTIME gnuradio-runtime) 3 | 4 | if(PC_GNURADIO_RUNTIME_FOUND) 5 | # look for include files 6 | FIND_PATH( 7 | GNURADIO_RUNTIME_INCLUDE_DIRS 8 | NAMES gnuradio/top_block.h 9 | HINTS $ENV{GNURADIO_RUNTIME_DIR}/include 10 | ${PC_GNURADIO_RUNTIME_INCLUDE_DIRS} 11 | ${CMAKE_INSTALL_PREFIX}/include 12 | PATHS /usr/local/include 13 | /usr/include 14 | ) 15 | 16 | # look for libs 17 | FIND_LIBRARY( 18 | GNURADIO_RUNTIME_LIBRARIES 19 | NAMES gnuradio-runtime 20 | HINTS $ENV{GNURADIO_RUNTIME_DIR}/lib 21 | ${PC_GNURADIO_RUNTIME_LIBDIR} 22 | ${CMAKE_INSTALL_PREFIX}/lib/ 23 | ${CMAKE_INSTALL_PREFIX}/lib64/ 24 | PATHS /usr/local/lib 25 | /usr/local/lib64 26 | /usr/lib 27 | /usr/lib64 28 | ) 29 | 30 | set(GNURADIO_RUNTIME_FOUND ${PC_GNURADIO_RUNTIME_FOUND}) 31 | endif(PC_GNURADIO_RUNTIME_FOUND) 32 | 33 | INCLUDE(FindPackageHandleStandardArgs) 34 | # do not check GNURADIO_RUNTIME_INCLUDE_DIRS, is not set when default include path us used. 35 | FIND_PACKAGE_HANDLE_STANDARD_ARGS(GNURADIO_RUNTIME DEFAULT_MSG GNURADIO_RUNTIME_LIBRARIES) 36 | MARK_AS_ADVANCED(GNURADIO_RUNTIME_LIBRARIES GNURADIO_RUNTIME_INCLUDE_DIRS) 37 | -------------------------------------------------------------------------------- /cmake/Modules/FindITPP.cmake: -------------------------------------------------------------------------------- 1 | # - Try to find ITPP 2 | # Once done this will define 3 | # 4 | # ITPP_FOUND - System has ITPP 5 | # ITPP_INCLUDE_DIR - The ITPP include directory 6 | # ITPP_LIBRARY - The library needed to use ITPP 7 | # 8 | 9 | find_path(ITPP_INCLUDE_DIR itpp/itcomm.h) 10 | 11 | set(ITPP_NAMES ${ITPP_NAMES} itpp libitpp libitpp.dll) 12 | FIND_LIBRARY(ITPP_LIBRARY NAMES ${ITPP_NAMES}) 13 | 14 | include(FindPackageHandleStandardArgs) 15 | find_package_handle_standard_args(ITPP DEFAULT_MSG ITPP_LIBRARY ITPP_INCLUDE_DIR) -------------------------------------------------------------------------------- /cmake/Modules/Findpcap.cmake: -------------------------------------------------------------------------------- 1 | FIND_PATH(PCAP_INCLUDE_DIR pcap.h ${_PCAP_PATHS} PATH_SUFFIXES include) 2 | 3 | IF (NOT PCAP_LIBRARIES) 4 | FIND_LIBRARY(PCAP_LIBRARIES NAMES pcap ${_PCAP_PATHS} PATH_SUFFIXES lib) 5 | ENDIF (NOT PCAP_LIBRARIES) 6 | 7 | # handle the QUIETLY and REQUIRED arguments and set PCAP_FOUND to TRUE if 8 | # all listed variables are TRUE 9 | INCLUDE(FindPackageHandleStandardArgs) 10 | FIND_PACKAGE_HANDLE_STANDARD_ARGS(PCAP REQUIRED_VARS PCAP_LIBRARIES PCAP_INCLUDE_DIR) 11 | 12 | MARK_AS_ADVANCED(PCAP_INCLUDE_DIR) 13 | -------------------------------------------------------------------------------- /cmake/cmake_uninstall.cmake.in: -------------------------------------------------------------------------------- 1 | # http://www.vtk.org/Wiki/CMake_FAQ#Can_I_do_.22make_uninstall.22_with_CMake.3F 2 | 3 | IF(NOT EXISTS "@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt") 4 | MESSAGE(FATAL_ERROR "Cannot find install manifest: \"@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt\"") 5 | ENDIF(NOT EXISTS "@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt") 6 | 7 | FILE(READ "@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt" files) 8 | STRING(REGEX REPLACE "\n" ";" files "${files}") 9 | FOREACH(file ${files}) 10 | MESSAGE(STATUS "Uninstalling \"$ENV{DESTDIR}${file}\"") 11 | IF(EXISTS "$ENV{DESTDIR}${file}") 12 | EXEC_PROGRAM( 13 | "@CMAKE_COMMAND@" ARGS "-E remove \"$ENV{DESTDIR}${file}\"" 14 | OUTPUT_VARIABLE rm_out 15 | RETURN_VALUE rm_retval 16 | ) 17 | IF(NOT "${rm_retval}" STREQUAL 0) 18 | MESSAGE(FATAL_ERROR "Problem when removing \"$ENV{DESTDIR}${file}\"") 19 | ENDIF(NOT "${rm_retval}" STREQUAL 0) 20 | ELSEIF(IS_SYMLINK "$ENV{DESTDIR}${file}") 21 | EXEC_PROGRAM( 22 | "@CMAKE_COMMAND@" ARGS "-E remove \"$ENV{DESTDIR}${file}\"" 23 | OUTPUT_VARIABLE rm_out 24 | RETURN_VALUE rm_retval 25 | ) 26 | IF(NOT "${rm_retval}" STREQUAL 0) 27 | MESSAGE(FATAL_ERROR "Problem when removing \"$ENV{DESTDIR}${file}\"") 28 | ENDIF(NOT "${rm_retval}" STREQUAL 0) 29 | ELSE(EXISTS "$ENV{DESTDIR}${file}") 30 | MESSAGE(STATUS "File \"$ENV{DESTDIR}${file}\" does not exist.") 31 | ENDIF(EXISTS "$ENV{DESTDIR}${file}") 32 | ENDFOREACH(file) 33 | -------------------------------------------------------------------------------- /debug-build.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | git pull 3 | cd build 4 | rm -rf * 5 | #cmake ../ -DCMAKE_BUILD_TYPE=Debug \ 6 | # -DCMAKE_CXX_FLAGS="-fsanitize=address -fno-omit-frame-pointer" \ 7 | # -DCMAKE_LINK_OPTIONS=-fsanitize=address 2>&1 | tee cmake.log 8 | cmake ../ -DCMAKE_BUILD_TYPE=Debug 2>&1 | tee cmake.log 9 | make -j4 VERBOSE=1 2>&1 | tee make.log 10 | sudo make install 2>&1 | tee install.log 11 | sudo ldconfig 12 | -------------------------------------------------------------------------------- /docs/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Copyright 2011 Free Software Foundation, Inc. 2 | # 3 | # This file is part of GNU Radio 4 | # 5 | # GNU Radio is free software; you can redistribute it and/or modify 6 | # it under the terms of the GNU General Public License as published by 7 | # the Free Software Foundation; either version 3, or (at your option) 8 | # any later version. 9 | # 10 | # GNU Radio is distributed in the hope that it will be useful, 11 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | # GNU General Public License for more details. 14 | # 15 | # You should have received a copy of the GNU General Public License 16 | # along with GNU Radio; see the file COPYING. If not, write to 17 | # the Free Software Foundation, Inc., 51 Franklin Street, 18 | # Boston, MA 02110-1301, USA. 19 | 20 | ######################################################################## 21 | # Setup dependencies 22 | ######################################################################## 23 | find_package(Doxygen) 24 | 25 | ######################################################################## 26 | # Begin conditional configuration 27 | ######################################################################## 28 | if(ENABLE_DOXYGEN) 29 | 30 | ######################################################################## 31 | # Add subdirectories 32 | ######################################################################## 33 | add_subdirectory(doxygen) 34 | 35 | endif(ENABLE_DOXYGEN) 36 | -------------------------------------------------------------------------------- /docs/README.op25: -------------------------------------------------------------------------------- 1 | This is the op25-write-a-block package meant as a guide to building 2 | out-of-tree packages. To use the op25 blocks, the Python namespaces 3 | is in 'op25', which is imported as: 4 | 5 | import op25 6 | 7 | See the Doxygen documentation for details about the blocks available 8 | in this package. A quick listing of the details can be found in Python 9 | after importing by using: 10 | 11 | help(op25) 12 | -------------------------------------------------------------------------------- /docs/doxygen/doxyxml/generated/__init__.py: -------------------------------------------------------------------------------- 1 | """ 2 | Contains generated files produced by generateDS.py. 3 | 4 | These do the real work of parsing the doxygen xml files but the 5 | resultant classes are not very friendly to navigate so the rest of the 6 | doxyxml module processes them further. 7 | """ 8 | -------------------------------------------------------------------------------- /docs/doxygen/other/group_defs.dox: -------------------------------------------------------------------------------- 1 | /*! 2 | * \defgroup block GNU Radio OP25 C++ Signal Processing Blocks 3 | * \brief All C++ blocks that can be used from the OP25 GNU Radio 4 | * module are listed here or in the subcategories below. 5 | * 6 | */ 7 | 8 | -------------------------------------------------------------------------------- /docs/doxygen/other/main_page.dox: -------------------------------------------------------------------------------- 1 | /*! \mainpage 2 | 3 | Welcome to the GNU Radio OP25 Block 4 | 5 | This is the intro page for the Doxygen manual generated for the OP25 6 | block (docs/doxygen/other/main_page.dox). Edit it to add more detailed 7 | documentation about the new GNU Radio modules contained in this 8 | project. 9 | 10 | */ 11 | -------------------------------------------------------------------------------- /docs/doxygen/pydoc_macros.h: -------------------------------------------------------------------------------- 1 | #ifndef PYDOC_MACROS_H 2 | #define PYDOC_MACROS_H 3 | 4 | #define __EXPAND(x) x 5 | #define __COUNT(_1, _2, _3, _4, _5, _6, _7, COUNT, ...) COUNT 6 | #define __VA_SIZE(...) __EXPAND(__COUNT(__VA_ARGS__, 7, 6, 5, 4, 3, 2, 1)) 7 | #define __CAT1(a, b) a##b 8 | #define __CAT2(a, b) __CAT1(a, b) 9 | #define __DOC1(n1) __doc_##n1 10 | #define __DOC2(n1, n2) __doc_##n1##_##n2 11 | #define __DOC3(n1, n2, n3) __doc_##n1##_##n2##_##n3 12 | #define __DOC4(n1, n2, n3, n4) __doc_##n1##_##n2##_##n3##_##n4 13 | #define __DOC5(n1, n2, n3, n4, n5) __doc_##n1##_##n2##_##n3##_##n4##_##n5 14 | #define __DOC6(n1, n2, n3, n4, n5, n6) __doc_##n1##_##n2##_##n3##_##n4##_##n5##_##n6 15 | #define __DOC7(n1, n2, n3, n4, n5, n6, n7) \ 16 | __doc_##n1##_##n2##_##n3##_##n4##_##n5##_##n6##_##n7 17 | #define DOC(...) __EXPAND(__EXPAND(__CAT2(__DOC, __VA_SIZE(__VA_ARGS__)))(__VA_ARGS__)) 18 | 19 | #endif // PYDOC_MACROS_H 20 | -------------------------------------------------------------------------------- /op25-multi_rx.service: -------------------------------------------------------------------------------- 1 | [Unit] 2 | Description=op25-multi_rx 3 | After=syslog.target network.target nss-lookup.target network-online.target 4 | Requires=network-online.target 5 | 6 | [Service] 7 | User=1000 8 | Group=1000 9 | WorkingDirectory=/home/pi/op25/op25/gr-op25_repeater/apps 10 | ExecStart=/bin/bash -- op25-multi_rx.sh 11 | RestartSec=5 12 | Restart=on-failure 13 | 14 | [Install] 15 | WantedBy=multi-user.target 16 | -------------------------------------------------------------------------------- /op25-multi_rx.sh: -------------------------------------------------------------------------------- 1 | ./multi_rx.py -v 1 -c p25_rtl_example.json 2> stderr.2 2 | -------------------------------------------------------------------------------- /op25/gr-op25/apps/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Copyright 2011 Free Software Foundation, Inc. 2 | # 3 | # This file is part of GNU Radio 4 | # 5 | # GNU Radio is free software; you can redistribute it and/or modify 6 | # it under the terms of the GNU General Public License as published by 7 | # the Free Software Foundation; either version 3, or (at your option) 8 | # any later version. 9 | # 10 | # GNU Radio is distributed in the hope that it will be useful, 11 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | # GNU General Public License for more details. 14 | # 15 | # You should have received a copy of the GNU General Public License 16 | # along with GNU Radio; see the file COPYING. If not, write to 17 | # the Free Software Foundation, Inc., 51 Franklin Street, 18 | # Boston, MA 02110-1301, USA. 19 | 20 | include(GrPython) 21 | 22 | GR_PYTHON_INSTALL( 23 | PROGRAMS 24 | DESTINATION bin 25 | ) 26 | -------------------------------------------------------------------------------- /op25/gr-op25/cmake/Modules/gnuradio-op25Config.cmake: -------------------------------------------------------------------------------- 1 | find_package(PkgConfig) 2 | 3 | PKG_CHECK_MODULES(PC_GR_OP25 gnuradio-op25) 4 | 5 | FIND_PATH( 6 | GR_OP25_INCLUDE_DIRS 7 | NAMES gnuradio/op25/api.h 8 | HINTS $ENV{OP25_DIR}/include 9 | ${PC_OP25_INCLUDEDIR} 10 | PATHS ${CMAKE_INSTALL_PREFIX}/include 11 | /usr/local/include 12 | /usr/include 13 | ) 14 | 15 | FIND_LIBRARY( 16 | GR_OP25_LIBRARIES 17 | NAMES gnuradio-op25 18 | HINTS $ENV{OP25_DIR}/lib 19 | ${PC_OP25_LIBDIR} 20 | PATHS ${CMAKE_INSTALL_PREFIX}/lib 21 | ${CMAKE_INSTALL_PREFIX}/lib64 22 | /usr/local/lib 23 | /usr/local/lib64 24 | /usr/lib 25 | /usr/lib64 26 | ) 27 | 28 | include("${CMAKE_CURRENT_LIST_DIR}/gnuradio-op25Target.cmake") 29 | 30 | INCLUDE(FindPackageHandleStandardArgs) 31 | FIND_PACKAGE_HANDLE_STANDARD_ARGS(GR_OP25 DEFAULT_MSG GR_OP25_LIBRARIES GR_OP25_INCLUDE_DIRS) 32 | MARK_AS_ADVANCED(GR_OP25_LIBRARIES GR_OP25_INCLUDE_DIRS) 33 | -------------------------------------------------------------------------------- /op25/gr-op25/cmake/Modules/targetConfig.cmake.in: -------------------------------------------------------------------------------- 1 | # Copyright 2018 Free Software Foundation, Inc. 2 | # 3 | # This file is part of GNU Radio 4 | # 5 | # SPDX-License-Identifier: GPL-3.0-or-later 6 | # 7 | 8 | include(CMakeFindDependencyMacro) 9 | 10 | set(target_deps "@TARGET_DEPENDENCIES@") 11 | foreach(dep IN LISTS target_deps) 12 | find_dependency(${dep}) 13 | endforeach() 14 | include("${CMAKE_CURRENT_LIST_DIR}/@TARGET@Targets.cmake") 15 | -------------------------------------------------------------------------------- /op25/gr-op25/docs/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Copyright 2011 Free Software Foundation, Inc. 2 | # 3 | # This file is part of GNU Radio 4 | # 5 | # GNU Radio is free software; you can redistribute it and/or modify 6 | # it under the terms of the GNU General Public License as published by 7 | # the Free Software Foundation; either version 3, or (at your option) 8 | # any later version. 9 | # 10 | # GNU Radio is distributed in the hope that it will be useful, 11 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | # GNU General Public License for more details. 14 | # 15 | # You should have received a copy of the GNU General Public License 16 | # along with GNU Radio; see the file COPYING. If not, write to 17 | # the Free Software Foundation, Inc., 51 Franklin Street, 18 | # Boston, MA 02110-1301, USA. 19 | 20 | ######################################################################## 21 | # Setup dependencies 22 | ######################################################################## 23 | find_package(Doxygen) 24 | 25 | ######################################################################## 26 | # Begin conditional configuration 27 | ######################################################################## 28 | if(ENABLE_DOXYGEN) 29 | 30 | ######################################################################## 31 | # Add subdirectories 32 | ######################################################################## 33 | add_subdirectory(doxygen) 34 | 35 | endif(ENABLE_DOXYGEN) 36 | -------------------------------------------------------------------------------- /op25/gr-op25/docs/README.op25: -------------------------------------------------------------------------------- 1 | This is the op25-write-a-block package meant as a guide to building 2 | out-of-tree packages. To use the op25 blocks, the Python namespaces 3 | is in 'op25', which is imported as: 4 | 5 | import op25 6 | 7 | See the Doxygen documentation for details about the blocks available 8 | in this package. A quick listing of the details can be found in Python 9 | after importing by using: 10 | 11 | help(op25) 12 | -------------------------------------------------------------------------------- /op25/gr-op25/docs/doxygen/doxyxml/generated/__init__.py: -------------------------------------------------------------------------------- 1 | """ 2 | Contains generated files produced by generateDS.py. 3 | 4 | These do the real work of parsing the doxygen xml files but the 5 | resultant classes are not very friendly to navigate so the rest of the 6 | doxyxml module processes them further. 7 | """ 8 | -------------------------------------------------------------------------------- /op25/gr-op25/docs/doxygen/other/group_defs.dox: -------------------------------------------------------------------------------- 1 | /*! 2 | * \defgroup block GNU Radio OP25 C++ Signal Processing Blocks 3 | * \brief All C++ blocks that can be used from the OP25 GNU Radio 4 | * module are listed here or in the subcategories below. 5 | * 6 | */ 7 | 8 | -------------------------------------------------------------------------------- /op25/gr-op25/docs/doxygen/other/main_page.dox: -------------------------------------------------------------------------------- 1 | /*! \mainpage 2 | 3 | Welcome to the GNU Radio OP25 Block 4 | 5 | This is the intro page for the Doxygen manual generated for the OP25 6 | block (docs/doxygen/other/main_page.dox). Edit it to add more detailed 7 | documentation about the new GNU Radio modules contained in this 8 | project. 9 | 10 | */ 11 | -------------------------------------------------------------------------------- /op25/gr-op25/docs/doxygen/pydoc_macros.h: -------------------------------------------------------------------------------- 1 | #ifndef PYDOC_MACROS_H 2 | #define PYDOC_MACROS_H 3 | 4 | #define __EXPAND(x) x 5 | #define __COUNT(_1, _2, _3, _4, _5, _6, _7, COUNT, ...) COUNT 6 | #define __VA_SIZE(...) __EXPAND(__COUNT(__VA_ARGS__, 7, 6, 5, 4, 3, 2, 1)) 7 | #define __CAT1(a, b) a##b 8 | #define __CAT2(a, b) __CAT1(a, b) 9 | #define __DOC1(n1) __doc_##n1 10 | #define __DOC2(n1, n2) __doc_##n1##_##n2 11 | #define __DOC3(n1, n2, n3) __doc_##n1##_##n2##_##n3 12 | #define __DOC4(n1, n2, n3, n4) __doc_##n1##_##n2##_##n3##_##n4 13 | #define __DOC5(n1, n2, n3, n4, n5) __doc_##n1##_##n2##_##n3##_##n4##_##n5 14 | #define __DOC6(n1, n2, n3, n4, n5, n6) __doc_##n1##_##n2##_##n3##_##n4##_##n5##_##n6 15 | #define __DOC7(n1, n2, n3, n4, n5, n6, n7) \ 16 | __doc_##n1##_##n2##_##n3##_##n4##_##n5##_##n6##_##n7 17 | #define DOC(...) __EXPAND(__EXPAND(__CAT2(__DOC, __VA_SIZE(__VA_ARGS__)))(__VA_ARGS__)) 18 | 19 | #endif // PYDOC_MACROS_H 20 | -------------------------------------------------------------------------------- /op25/gr-op25/grc/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Copyright 2011 Free Software Foundation, Inc. 2 | # 3 | # This file is part of GNU Radio 4 | # 5 | # GNU Radio is free software; you can redistribute it and/or modify 6 | # it under the terms of the GNU General Public License as published by 7 | # the Free Software Foundation; either version 3, or (at your option) 8 | # any later version. 9 | # 10 | # GNU Radio is distributed in the hope that it will be useful, 11 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | # GNU General Public License for more details. 14 | # 15 | # You should have received a copy of the GNU General Public License 16 | # along with GNU Radio; see the file COPYING. If not, write to 17 | # the Free Software Foundation, Inc., 51 Franklin Street, 18 | # Boston, MA 02110-1301, USA. 19 | install(FILES 20 | op25_fsk4_demod_ff.xml 21 | op25_fsk4_slicer_fb.xml 22 | op25_decoder_ff.xml 23 | op25_decoder_bf.xml 24 | op25_pcap_source_b.xml DESTINATION share/gnuradio/grc/blocks 25 | ) 26 | -------------------------------------------------------------------------------- /op25/gr-op25/grc/op25_decoder_bf.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | decoder_bf 4 | op25_decoder_bf 5 | op25 6 | import op25 7 | op25.decoder_bf() 8 | 19 | 20 | 25 | 26 | bits 27 | byte 28 | 29 | 30 | 35 | 36 | audio 37 | float 38 | 39 | 40 | -------------------------------------------------------------------------------- /op25/gr-op25/grc/op25_decoder_ff.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | decoder_ff 4 | op25_decoder_ff 5 | op25 6 | import op25 7 | op25.decoder_ff($) 8 | 13 | 14 | ... 15 | ... 16 | ... 17 | 18 | 19 | 24 | 25 | in 26 | 27 | 28 | 29 | 34 | 35 | out 36 | 37 | 38 | 39 | -------------------------------------------------------------------------------- /op25/gr-op25/grc/op25_fsk4_demod_ff.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | fsk4_demod_ff 4 | op25_fsk4_demod_ff 5 | op25 6 | import op25 7 | op25.fsk4_demod_ff(self.auto_tune_msgq, $sample_rate, $symbol_rate) 8 | 9 | 10 | Sample Rate 11 | sample_rate 12 | 28800 13 | real 14 | 15 | 16 | 17 | Symbol Rate 18 | symbol_rate 19 | 4800 20 | real 21 | 22 | 23 | 24 | Output Auto Tune 25 | tune_out 26 | True 27 | bool 28 | part 29 | 33 | 37 | 38 | 39 | 40 | in 41 | float 42 | 43 | 44 | 45 | dibits 46 | float 47 | 48 | 49 | -------------------------------------------------------------------------------- /op25/gr-op25/grc/op25_fsk4_slicer_fb.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | fsk4_slicer_fb 4 | op25_fsk4_slicer_fb 5 | op25 6 | import op25 7 | op25.fsk4_slicer_fb([-2.0,0.0,2.0,4.0]) 8 | 9 | 10 | in 11 | float 12 | 13 | 14 | 15 | out 16 | byte 17 | 18 | 19 | -------------------------------------------------------------------------------- /op25/gr-op25/grc/op25_pcap_source_b.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | pcap_source_b 4 | op25_pcap_source_b 5 | op25 6 | import op25 7 | op25.pcap_source_b($*path, $delay) 8 | 13 | 14 | filename 15 | filename 16 | string 17 | 18 | 19 | delay 20 | delay 21 | float 22 | 23 | 24 | 29 | 30 | out 31 | byte 32 | 33 | 34 | -------------------------------------------------------------------------------- /op25/gr-op25/include/gnuradio/op25/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Copyright 2011,2012 Free Software Foundation, Inc. 2 | # 3 | # This file is part of GNU Radio 4 | # 5 | # GNU Radio is free software; you can redistribute it and/or modify 6 | # it under the terms of the GNU General Public License as published by 7 | # the Free Software Foundation; either version 3, or (at your option) 8 | # any later version. 9 | # 10 | # GNU Radio is distributed in the hope that it will be useful, 11 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | # GNU General Public License for more details. 14 | # 15 | # You should have received a copy of the GNU General Public License 16 | # along with GNU Radio; see the file COPYING. If not, write to 17 | # the Free Software Foundation, Inc., 51 Franklin Street, 18 | # Boston, MA 02110-1301, USA. 19 | 20 | ######################################################################## 21 | # Install public header files 22 | ######################################################################## 23 | install(FILES 24 | api.h 25 | fsk4_demod_ff.h 26 | fsk4_slicer_fb.h 27 | decoder_ff.h 28 | decoder_bf.h 29 | pcap_source_b.h DESTINATION include/gnuradio/op25 30 | ) 31 | -------------------------------------------------------------------------------- /op25/gr-op25/include/gnuradio/op25/api.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2011 Free Software Foundation, Inc. 3 | * 4 | * This file is part of GNU Radio 5 | * 6 | * GNU Radio is free software; you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation; either version 3, or (at your option) 9 | * any later version. 10 | * 11 | * GNU Radio is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with GNU Radio; see the file COPYING. If not, write to 18 | * the Free Software Foundation, Inc., 51 Franklin Street, 19 | * Boston, MA 02110-1301, USA. 20 | */ 21 | 22 | #ifndef INCLUDED_OP25_API_H 23 | #define INCLUDED_OP25_API_H 24 | 25 | #include 26 | 27 | #ifdef gnuradio_op25_EXPORTS 28 | # define OP25_API __GR_ATTR_EXPORT 29 | #else 30 | # define OP25_API __GR_ATTR_IMPORT 31 | #endif 32 | 33 | #endif /* INCLUDED_OP25_API_H */ 34 | -------------------------------------------------------------------------------- /op25/gr-op25/lib/data_unit_handler.cc: -------------------------------------------------------------------------------- 1 | #include "data_unit_handler.h" 2 | 3 | data_unit_handler::~data_unit_handler() 4 | { 5 | } 6 | 7 | void 8 | data_unit_handler::handle(data_unit::data_unit_sptr du) 9 | { 10 | if(d_next) { 11 | d_next->handle(du); 12 | } 13 | } 14 | 15 | data_unit_handler::data_unit_handler(data_unit_handler::data_unit_handler_sptr next) : 16 | d_next(next) 17 | { 18 | } 19 | 20 | -------------------------------------------------------------------------------- /op25/gr-op25/lib/dummy_imbe_decoder.cc: -------------------------------------------------------------------------------- 1 | /* -*- C++ -*- */ 2 | 3 | /* 4 | * Copyright 2008 Steve Glass 5 | * 6 | * This file is part of OP25. 7 | * 8 | * OP25 is free software; you can redistribute it and/or modify it 9 | * under the terms of the GNU General Public License as published by 10 | * the Free Software Foundation; either version 3, or (at your option) 11 | * any later version. 12 | * 13 | * OP25 is distributed in the hope that it will be useful, but WITHOUT 14 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY 15 | * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public 16 | * License for more details. 17 | * 18 | * You should have received a copy of the GNU General Public License 19 | * along with OP25; see the file COPYING. If not, write to the Free 20 | * Software Foundation, Inc., 51 Franklin Street, Boston, MA 21 | * 02110-1301, USA. 22 | */ 23 | 24 | #include "dummy_imbe_decoder.h" 25 | 26 | dummy_imbe_decoder::dummy_imbe_decoder() 27 | { 28 | } 29 | 30 | dummy_imbe_decoder::~dummy_imbe_decoder() 31 | { 32 | } 33 | 34 | void 35 | dummy_imbe_decoder::decode(const voice_codeword& cw) 36 | { 37 | } 38 | -------------------------------------------------------------------------------- /op25/gr-op25/lib/dummy_imbe_decoder.h: -------------------------------------------------------------------------------- 1 | /* -*- C++ -*- */ 2 | 3 | /* 4 | * Copyright 2008 Steve Glass 5 | * 6 | * This file is part of OP25. 7 | * 8 | * OP25 is free software; you can redistribute it and/or modify it 9 | * under the terms of the GNU General Public License as published by 10 | * the Free Software Foundation; either version 3, or (at your option) 11 | * any later version. 12 | * 13 | * OP25 is distributed in the hope that it will be useful, but WITHOUT 14 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY 15 | * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public 16 | * License for more details. 17 | * 18 | * You should have received a copy of the GNU General Public License 19 | * along with OP25; see the file COPYING. If not, write to the Free 20 | * Software Foundation, Inc., 51 Franklin Street, Boston, MA 21 | * 02110-1301, USA. 22 | */ 23 | 24 | #ifndef INCLUDED_DUMMY_IMBE_DECODER_H 25 | #define INCLUDED_DUMMY_IMBE_DECODER_H 26 | 27 | #include "imbe_decoder.h" 28 | 29 | /** 30 | * dummy_imbe_decoder is the imbe_decoder of last resort. It consumes 31 | * the voice_codeeword and does nothing. 32 | */ 33 | class dummy_imbe_decoder : public imbe_decoder { 34 | public: 35 | 36 | /** 37 | * dummy_imbe_decoder default constructor. 38 | */ 39 | dummy_imbe_decoder(); 40 | 41 | /** 42 | * dummy_imbe_decoder (virtual) destructor. 43 | */ 44 | virtual ~dummy_imbe_decoder(); 45 | 46 | /** 47 | * Ignores in_out and generates no audio. 48 | * 49 | * \param cw IMBE codewords and parity. 50 | */ 51 | virtual void decode(const voice_codeword& cw); 52 | 53 | }; 54 | 55 | #endif /* INCLUDED_DUMMY_IMBE_DECODER_H */ 56 | -------------------------------------------------------------------------------- /op25/gr-op25/lib/fsk4_slicer_fb_impl.h: -------------------------------------------------------------------------------- 1 | /* -*- c++ -*- */ 2 | /* 3 | * Copyright 2010 KA1RBI 4 | * 5 | * This file is part of OP25. 6 | * 7 | * This is free software; you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published by 9 | * the Free Software Foundation; either version 3, or (at your option) 10 | * any later version. 11 | * 12 | * This software is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | * GNU General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU General Public License 18 | * along with this software; see the file COPYING. If not, write to 19 | * the Free Software Foundation, Inc., 51 Franklin Street, 20 | * Boston, MA 02110-1301, USA. 21 | */ 22 | 23 | #ifndef INCLUDED_OP25_FSK4_SLICER_FB_IMPL_H 24 | #define INCLUDED_OP25_FSK4_SLICER_FB_IMPL_H 25 | 26 | #include 27 | 28 | namespace gr { 29 | namespace op25 { 30 | 31 | class fsk4_slicer_fb_impl : public fsk4_slicer_fb 32 | { 33 | private: 34 | float d_slice_levels[4]; 35 | 36 | public: 37 | fsk4_slicer_fb_impl(const std::vector &slice_levels); 38 | ~fsk4_slicer_fb_impl(); 39 | 40 | // Where all the action really happens 41 | int work(int noutput_items, 42 | gr_vector_const_void_star &input_items, 43 | gr_vector_void_star &output_items); 44 | }; 45 | 46 | } // namespace op25 47 | } // namespace gr 48 | 49 | #endif /* INCLUDED_OP25_FSK4_SLICER_FB_IMPL_H */ 50 | 51 | -------------------------------------------------------------------------------- /op25/gr-op25/lib/imbe_decoder.cc: -------------------------------------------------------------------------------- 1 | #include "imbe_decoder.h" 2 | 3 | imbe_decoder::~imbe_decoder() 4 | { 5 | } 6 | 7 | imbe_decoder::imbe_decoder() : 8 | d_audio() 9 | { 10 | } 11 | 12 | audio_samples* 13 | imbe_decoder::audio() 14 | { 15 | return &d_audio; 16 | } 17 | -------------------------------------------------------------------------------- /op25/gr-op25/lib/imbe_decoder_factory.cc: -------------------------------------------------------------------------------- 1 | #include "dummy_imbe_decoder.h" 2 | #include "imbe_decoder.h" 3 | #include "offline_imbe_decoder.h" 4 | #include "software_imbe_decoder.h" 5 | #include "vc55_imbe_decoder.h" 6 | 7 | #include 8 | #include 9 | 10 | imbe_decoder::imbe_decoder_sptr 11 | imbe_decoder::make() 12 | { 13 | imbe_decoder_sptr imbe; 14 | const char *imbe_type = getenv("IMBE"); 15 | if(imbe_type) { 16 | if(strcasecmp(imbe_type, "offline") == 0) { 17 | imbe = imbe_decoder_sptr(new offline_imbe_decoder()); 18 | } else if(strcasecmp(imbe_type, "soft") == 0) { 19 | imbe = imbe_decoder_sptr(new software_imbe_decoder()); 20 | } else if(strcasecmp(imbe_type, "vc55") == 0) { 21 | imbe = imbe_decoder_sptr(new vc55_imbe_decoder()); 22 | } else { 23 | imbe = imbe_decoder_sptr(new dummy_imbe_decoder()); 24 | } 25 | } else { 26 | imbe = imbe_decoder_sptr(new software_imbe_decoder()); 27 | } 28 | return imbe; 29 | } 30 | -------------------------------------------------------------------------------- /op25/gr-op25/lib/ldu1.cc: -------------------------------------------------------------------------------- 1 | /* -*- C++ -*- */ 2 | 3 | /* 4 | * Copyright 2008 Steve Glass 5 | * 6 | * This file is part of OP25. 7 | * 8 | * OP25 is free software; you can redistribute it and/or modify it 9 | * under the terms of the GNU General Public License as published by 10 | * the Free Software Foundation; either version 3, or (at your option) 11 | * any later version. 12 | * 13 | * OP25 is distributed in the hope that it will be useful, but WITHOUT 14 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY 15 | * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public 16 | * License for more details. 17 | * 18 | * You should have received a copy of the GNU General Public License 19 | * along with OP25; see the file COPYING. If not, write to the Free 20 | * Software Foundation, Inc., 51 Franklin Street, Boston, MA 21 | * 02110-1301, USA. 22 | */ 23 | 24 | #include "ldu1.h" 25 | 26 | using std::string; 27 | 28 | ldu1::ldu1(const_bit_queue& frame_body) : 29 | voice_data_unit(frame_body) 30 | { 31 | } 32 | 33 | ldu1::~ldu1() 34 | { 35 | } 36 | 37 | string 38 | ldu1::duid_str() const 39 | { 40 | return string("LDU1"); 41 | } 42 | -------------------------------------------------------------------------------- /op25/gr-op25/lib/ldu1.h: -------------------------------------------------------------------------------- 1 | /* -*- C++ -*- */ 2 | 3 | /* 4 | * Copyright 2008 Steve Glass 5 | * 6 | * This file is part of OP25. 7 | * 8 | * OP25 is free software; you can redistribute it and/or modify it 9 | * under the terms of the GNU General Public License as published by 10 | * the Free Software Foundation; either version 3, or (at your option) 11 | * any later version. 12 | * 13 | * OP25 is distributed in the hope that it will be useful, but WITHOUT 14 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY 15 | * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public 16 | * License for more details. 17 | * 18 | * You should have received a copy of the GNU General Public License 19 | * along with OP25; see the file COPYING. If not, write to the Free 20 | * Software Foundation, Inc., 51 Franklin Street, Boston, MA 21 | * 02110-1301, USA. 22 | */ 23 | 24 | #ifndef INCLUDED_LDU1_H 25 | #define INCLUDED_LDU1_H 26 | 27 | #include "voice_data_unit.h" 28 | 29 | /** 30 | * P25 Logical Data Unit 1. 31 | */ 32 | class ldu1 : public voice_data_unit 33 | { 34 | public: 35 | 36 | /** 37 | * ldu1 constuctor 38 | * 39 | * \param frame_body A const_bit_queue representing the frame body. 40 | */ 41 | ldu1(const_bit_queue& frame_body); 42 | 43 | /** 44 | * ldu1 (virtual) destuctor 45 | */ 46 | virtual ~ldu1(); 47 | 48 | /** 49 | * Returns a string describing the Data Unit ID (DUID). 50 | */ 51 | std::string duid_str() const; 52 | 53 | }; 54 | 55 | #endif /* INCLUDED_LDU1_H */ 56 | -------------------------------------------------------------------------------- /op25/gr-op25/lib/ldu2.cc: -------------------------------------------------------------------------------- 1 | /* -*- C++ -*- */ 2 | 3 | /* 4 | * Copyright 2008 Steve Glass 5 | * 6 | * This file is part of OP25. 7 | * 8 | * OP25 is free software; you can redistribute it and/or modify it 9 | * under the terms of the GNU General Public License as published by 10 | * the Free Software Foundation; either version 3, or (at your option) 11 | * any later version. 12 | * 13 | * OP25 is distributed in the hope that it will be useful, but WITHOUT 14 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY 15 | * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public 16 | * License for more details. 17 | * 18 | * You should have received a copy of the GNU General Public License 19 | * along with OP25; see the file COPYING. If not, write to the Free 20 | * Software Foundation, Inc., 51 Franklin Street, Boston, MA 21 | * 02110-1301, USA. 22 | */ 23 | 24 | #include "ldu2.h" 25 | 26 | using std::string; 27 | 28 | ldu2::ldu2(const_bit_queue& frame_body) : 29 | voice_data_unit(frame_body) 30 | { 31 | } 32 | 33 | ldu2::~ldu2() 34 | { 35 | } 36 | 37 | string 38 | ldu2::duid_str() const 39 | { 40 | return string("LDU2"); 41 | } 42 | -------------------------------------------------------------------------------- /op25/gr-op25/lib/ldu2.h: -------------------------------------------------------------------------------- 1 | /* -*- C++ -*- */ 2 | 3 | /* 4 | * Copyright 2008 Steve Glass 5 | * 6 | * This file is part of OP25. 7 | * 8 | * OP25 is free software; you can redistribute it and/or modify it 9 | * under the terms of the GNU General Public License as published by 10 | * the Free Software Foundation; either version 3, or (at your option) 11 | * any later version. 12 | * 13 | * OP25 is distributed in the hope that it will be useful, but WITHOUT 14 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY 15 | * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public 16 | * License for more details. 17 | * 18 | * You should have received a copy of the GNU General Public License 19 | * along with OP25; see the file COPYING. If not, write to the Free 20 | * Software Foundation, Inc., 51 Franklin Street, Boston, MA 21 | * 02110-1301, USA. 22 | */ 23 | 24 | #ifndef INCLUDED_LDU2_H 25 | #define INCLUDED_LDU2_H 26 | 27 | #include "voice_data_unit.h" 28 | 29 | /** 30 | * P25 Logical Data Unit 2. 31 | */ 32 | class ldu2 : public voice_data_unit 33 | { 34 | public: 35 | 36 | /** 37 | * ldu2 constructor. 38 | * 39 | * \param frame_body A const_bit_queue representing the frame body. 40 | */ 41 | ldu2(const_bit_queue& frame_body); 42 | 43 | /** 44 | * ldu2 (virtual) destructor. 45 | */ 46 | virtual ~ldu2(); 47 | 48 | /** 49 | * Returns a string describing the Data Unit ID (DUID). 50 | */ 51 | std::string duid_str() const; 52 | }; 53 | 54 | #endif /* INCLUDED_LDU2_H */ 55 | -------------------------------------------------------------------------------- /op25/gr-op25/lib/logfile_du_handler.cc: -------------------------------------------------------------------------------- 1 | /* -*- C++ -*- */ 2 | 3 | /* 4 | * Copyright 2008 Steve Glass 5 | * 6 | * This file is part of OP25. 7 | * 8 | * OP25 is free software; you can redistribute it and/or modify it 9 | * under the terms of the GNU General Public License as published by 10 | * the Free Software Foundation; either version 3, or (at your option) 11 | * any later version. 12 | * 13 | * OP25 is distributed in the hope that it will be useful, but WITHOUT 14 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY 15 | * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public 16 | * License for more details. 17 | * 18 | * You should have received a copy of the GNU General Public License 19 | * along with OP25; see the file COPYING. If not, write to the Free 20 | * Software Foundation, Inc., 51 Franklin Street, Boston, MA 21 | * 02110-1301, USA. 22 | */ 23 | 24 | #include "logfile_du_handler.h" 25 | 26 | #include 27 | #include 28 | 29 | using namespace std; 30 | 31 | logfile_du_handler::logfile_du_handler(data_unit_handler_sptr next, const char *filename) : 32 | data_unit_handler(next), 33 | d_log(filename) 34 | { 35 | } 36 | 37 | logfile_du_handler::~logfile_du_handler() 38 | { 39 | d_log.flush(); 40 | d_log.close(); 41 | } 42 | 43 | void 44 | logfile_du_handler::handle(data_unit::data_unit_sptr du) 45 | { 46 | du->dump(d_log); 47 | data_unit_handler::handle(du); 48 | } 49 | -------------------------------------------------------------------------------- /op25/gr-op25/lib/offline_imbe_decoder.h: -------------------------------------------------------------------------------- 1 | /* -*- C++ -*- */ 2 | 3 | /* 4 | * Copyright 2008 Steve Glass 5 | * 6 | * This file is part of OP25. 7 | * 8 | * OP25 is free software; you can redistribute it and/or modify it 9 | * under the terms of the GNU General Public License as published by 10 | * the Free Software Foundation; either version 3, or (at your option) 11 | * any later version. 12 | * 13 | * OP25 is distributed in the hope that it will be useful, but WITHOUT 14 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY 15 | * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public 16 | * License for more details. 17 | * 18 | * You should have received a copy of the GNU General Public License 19 | * along with OP25; see the file COPYING. If not, write to the Free 20 | * Software Foundation, Inc., 51 Franklin Street, Boston, MA 21 | * 02110-1301, USA. 22 | */ 23 | 24 | #ifndef INCLUDED_OFFLINE_IMBE_DECODER_H 25 | #define INCLUDED_OFFLINE_IMBE_DECODER_H 26 | 27 | #include "imbe_decoder.h" 28 | 29 | #include 30 | 31 | /** 32 | * offline_imbe_decoder dumps voice codewords to file for offline decoding. 33 | * 34 | */ 35 | class offline_imbe_decoder : public imbe_decoder { 36 | public: 37 | 38 | /** 39 | * offline_imbe_decoder default constructor. 40 | */ 41 | offline_imbe_decoder(); 42 | 43 | /** 44 | * offline_imbe_decoder (virtual) destructor. 45 | */ 46 | virtual ~offline_imbe_decoder(); 47 | 48 | /** 49 | * Dump voice_codeword in_out to file. 50 | * 51 | * \param cw IMBE codewords and parity. 52 | */ 53 | virtual void decode(const voice_codeword& cw); 54 | 55 | private: 56 | 57 | /** 58 | * The output file. 59 | */ 60 | FILE *d_fp; 61 | 62 | }; 63 | 64 | #endif /* INCLUDED_OFFLINE_IMBE_DECODER_H */ 65 | -------------------------------------------------------------------------------- /op25/gr-op25/lib/op25_p25_frame.h: -------------------------------------------------------------------------------- 1 | #ifndef INCLUDED_OP25_P25_FRAME_H 2 | #define INCLUDED_OP25_P25_FRAME_H 1 3 | 4 | #include "frame_sync_magics.h" 5 | 6 | static const size_t P25_VOICE_FRAME_SIZE = 1728; 7 | static const size_t P25_HEADER_SYMBOLS = 24 + 32 + 1; 8 | static const size_t P25_HEADER_BITS = P25_HEADER_SYMBOLS * 2; 9 | 10 | /* Given a 64-bit frame header word and a frame body which is to be initialized 11 | * 1. Place flags at beginning of frame body 12 | * 2. Store 64-bit frame header word 13 | * 3. FIXME Place first status symbol 14 | */ 15 | static inline void 16 | p25_setup_frame_header(bit_vector& frame_body, uint64_t hw) { 17 | uint64_t acc = P25_FRAME_SYNC_MAGIC; 18 | for (int i=47; i>=0; i--) { 19 | frame_body[ i ] = acc & 1; 20 | acc >>= 1; 21 | } 22 | acc = hw; 23 | for (int i=113; i>=72; i--) { 24 | frame_body[ i ] = acc & 1; 25 | acc >>= 1; 26 | } 27 | // FIXME: insert proper status dibit bits at 70, 71 28 | frame_body[70] = 1; 29 | frame_body[71] = 0; 30 | for (int i=69; i>=48; i--) { 31 | frame_body[ i ] = acc & 1; 32 | acc >>= 1; 33 | } 34 | } 35 | 36 | #endif /* INCLUDED_OP25_P25_FRAME_H */ 37 | -------------------------------------------------------------------------------- /op25/gr-op25/lib/pdu.cc: -------------------------------------------------------------------------------- 1 | /* -*- C++ -*- */ 2 | 3 | /* 4 | * Copyright 2008 Steve Glass 5 | * 6 | * This file is part of OP25. 7 | * 8 | * OP25 is free software; you can redistribute it and/or modify it 9 | * under the terms of the GNU General Public License as published by 10 | * the Free Software Foundation; either version 3, or (at your option) 11 | * any later version. 12 | * 13 | * OP25 is distributed in the hope that it will be useful, but WITHOUT 14 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY 15 | * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public 16 | * License for more details. 17 | * 18 | * You should have received a copy of the GNU General Public License 19 | * along with OP25; see the file COPYING. If not, write to the Free 20 | * Software Foundation, Inc., 51 Franklin Street, Boston, MA 21 | * 02110-1301, USA. 22 | */ 23 | 24 | #include "pdu.h" 25 | 26 | using std::string; 27 | 28 | pdu::pdu(const_bit_queue& frame_body) : 29 | abstract_data_unit(frame_body) 30 | { 31 | } 32 | pdu::~pdu() 33 | { 34 | } 35 | 36 | string 37 | pdu::duid_str() const 38 | { 39 | return string("PDU"); 40 | } 41 | 42 | void 43 | pdu::do_correct_errors(bit_vector& frame_body) 44 | { 45 | } 46 | 47 | uint16_t 48 | pdu::frame_size_max() const 49 | { 50 | #if 1 51 | const size_t HEADER_BLOCK_SIZE = 720; 52 | return HEADER_BLOCK_SIZE; 53 | #else 54 | const size_t MIN_HEADER_BLOCK_SZ = 312; 55 | // after HEADER_BLOCK_SIZE bits have been read we can then use the 56 | // header contents to decide on frame_size_max 57 | 58 | size_t n = MIN_HEADER_BLOCK_SZ; 59 | if(n < ) { 60 | static const size_t BITS[] = {}; 61 | static const size_t BITS_SZ = sizeof(BITS) / sizeof(BITS[0]); 62 | n = extract(); 63 | } 64 | return n; 65 | 66 | #endif 67 | } 68 | -------------------------------------------------------------------------------- /op25/gr-op25/lib/pickle.cc: -------------------------------------------------------------------------------- 1 | /* -*- C++ -*- */ 2 | 3 | /* 4 | * Copyright 2008 Steve Glass 5 | * 6 | * This file is part of OP25. 7 | * 8 | * OP25 is free software; you can redistribute it and/or modify it 9 | * under the terms of the GNU General Public License as published by 10 | * the Free Software Foundation; either version 3, or (at your option) 11 | * any later version. 12 | * 13 | * OP25 is distributed in the hope that it will be useful, but WITHOUT 14 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY 15 | * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public 16 | * License for more details. 17 | * 18 | * You should have received a copy of the GNU General Public License 19 | * along with OP25; see the file COPYING. If not, write to the Free 20 | * Software Foundation, Inc., 51 Franklin Street, Boston, MA 21 | * 02110-1301, USA. 22 | */ 23 | 24 | #include "pickle.h" 25 | 26 | #include 27 | #include 28 | 29 | using namespace std; 30 | 31 | pickle::pickle() 32 | { 33 | } 34 | 35 | pickle::~pickle() 36 | { 37 | } 38 | 39 | void 40 | pickle::add(string key, string value) 41 | { 42 | map_[key] = value; 43 | } 44 | 45 | string 46 | pickle::to_string() const 47 | { 48 | size_t n = 1; 49 | ostringstream os; 50 | os << "(dp" << n++ << endl; 51 | for(stringmap::const_iterator i(map_.begin()); i != map_.end(); ++i) { 52 | os << "S'" << i->first << "'" << endl; 53 | os << "p" << n++ << endl; 54 | os << "S'" << i->second << "'" << endl; 55 | os << "p" << n++ << endl << "s"; 56 | } 57 | os << "." << endl; 58 | return os.str(); 59 | } 60 | -------------------------------------------------------------------------------- /op25/gr-op25/lib/pickle.h: -------------------------------------------------------------------------------- 1 | /* -*- C++ -*- */ 2 | 3 | /* 4 | * Copyright 2008 Steve Glass 5 | * 6 | * This file is part of OP25. 7 | * 8 | * OP25 is free software; you can redistribute it and/or modify it 9 | * under the terms of the GNU General Public License as published by 10 | * the Free Software Foundation; either version 3, or (at your option) 11 | * any later version. 12 | * 13 | * OP25 is distributed in the hope that it will be useful, but WITHOUT 14 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY 15 | * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public 16 | * License for more details. 17 | * 18 | * You should have received a copy of the GNU General Public License 19 | * along with OP25; see the file COPYING. If not, write to the Free 20 | * Software Foundation, Inc., 51 Franklin Street, Boston, MA 21 | * 02110-1301, USA. 22 | */ 23 | 24 | #ifndef INCLUDED_PICKLE_H 25 | #define INCLUDED_PICKLE_H 26 | 27 | #include "abstract_data_unit.h" 28 | 29 | #include 30 | 31 | /** 32 | * A pickled Python dictionary. Used to pass stuff to the UI. 33 | */ 34 | class pickle 35 | { 36 | 37 | public: 38 | 39 | /** 40 | * pickle constructor. 41 | * 42 | * \param frame_body A const_bit_queue representing the frame body. 43 | */ 44 | pickle(); 45 | 46 | /** 47 | * pickle virtual destructor. 48 | */ 49 | ~pickle(); 50 | 51 | /** 52 | * Add a key/value pair to the pickled dictionary 53 | */ 54 | void add(std::string key, std::string value); 55 | 56 | /** 57 | * Returns a string describing the Data Unit ID (DUID). 58 | */ 59 | std::string to_string() const; 60 | 61 | private: 62 | 63 | typedef std::map stringmap; 64 | 65 | stringmap map_; 66 | 67 | }; 68 | 69 | #endif /* INCLUDED_PICKLE_H */ 70 | -------------------------------------------------------------------------------- /op25/gr-op25/lib/qa_op25.cc: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2012 Free Software Foundation, Inc. 3 | * 4 | * This file is part of GNU Radio 5 | * 6 | * GNU Radio is free software; you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation; either version 3, or (at your option) 9 | * any later version. 10 | * 11 | * GNU Radio is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with GNU Radio; see the file COPYING. If not, write to 18 | * the Free Software Foundation, Inc., 51 Franklin Street, 19 | * Boston, MA 02110-1301, USA. 20 | */ 21 | 22 | /* 23 | * This class gathers together all the test cases for the gr-filter 24 | * directory into a single test suite. As you create new test cases, 25 | * add them here. 26 | */ 27 | 28 | #include "qa_op25.h" 29 | 30 | CppUnit::TestSuite * 31 | qa_op25::suite() 32 | { 33 | CppUnit::TestSuite *s = new CppUnit::TestSuite("op25"); 34 | 35 | return s; 36 | } 37 | -------------------------------------------------------------------------------- /op25/gr-op25/lib/qa_op25.h: -------------------------------------------------------------------------------- 1 | /* -*- c++ -*- */ 2 | /* 3 | * Copyright 2012 Free Software Foundation, Inc. 4 | * 5 | * This file is part of GNU Radio 6 | * 7 | * GNU Radio is free software; you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published by 9 | * the Free Software Foundation; either version 3, or (at your option) 10 | * any later version. 11 | * 12 | * GNU Radio is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | * GNU General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU General Public License 18 | * along with GNU Radio; see the file COPYING. If not, write to 19 | * the Free Software Foundation, Inc., 51 Franklin Street, 20 | * Boston, MA 02110-1301, USA. 21 | */ 22 | 23 | #ifndef _QA_OP25_H_ 24 | #define _QA_OP25_H_ 25 | 26 | #include 27 | #include 28 | 29 | //! collect all the tests for the gr-filter directory 30 | 31 | class __GR_ATTR_EXPORT qa_op25 32 | { 33 | public: 34 | //! return suite of tests for all of gr-filter directory 35 | static CppUnit::TestSuite *suite(); 36 | }; 37 | 38 | #endif /* _QA_OP25_H_ */ 39 | -------------------------------------------------------------------------------- /op25/gr-op25/lib/test_op25.cc: -------------------------------------------------------------------------------- 1 | /* -*- c++ -*- */ 2 | /* 3 | * Copyright 2012 Free Software Foundation, Inc. 4 | * 5 | * This file is part of GNU Radio 6 | * 7 | * GNU Radio is free software; you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published by 9 | * the Free Software Foundation; either version 3, or (at your option) 10 | * any later version. 11 | * 12 | * GNU Radio is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | * GNU General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU General Public License 18 | * along with GNU Radio; see the file COPYING. If not, write to 19 | * the Free Software Foundation, Inc., 51 Franklin Street, 20 | * Boston, MA 02110-1301, USA. 21 | */ 22 | 23 | #ifdef HAVE_CONFIG_H 24 | #include "config.h" 25 | #endif 26 | 27 | #include 28 | #include 29 | 30 | #include 31 | #include "qa_op25.h" 32 | #include 33 | 34 | int 35 | main (int argc, char **argv) 36 | { 37 | CppUnit::TextTestRunner runner; 38 | std::ofstream xmlfile(get_unittest_path("op25.xml").c_str()); 39 | CppUnit::XmlOutputter *xmlout = new CppUnit::XmlOutputter(&runner.result(), xmlfile); 40 | 41 | runner.addTest(qa_op25::suite()); 42 | runner.setOutputter(xmlout); 43 | 44 | bool was_successful = runner.run("", false); 45 | 46 | return was_successful ? 0 : 1; 47 | } 48 | -------------------------------------------------------------------------------- /op25/gr-op25/lib/tsbk.cc: -------------------------------------------------------------------------------- 1 | /* -*- C++ -*- */ 2 | 3 | /* 4 | * Copyright 2008 Steve Glass 5 | * 6 | * This file is part of OP25. 7 | * 8 | * OP25 is free software; you can redistribute it and/or modify it 9 | * under the terms of the GNU General Public License as published by 10 | * the Free Software Foundation; either version 3, or (at your option) 11 | * any later version. 12 | * 13 | * OP25 is distributed in the hope that it will be useful, but WITHOUT 14 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY 15 | * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public 16 | * License for more details. 17 | * 18 | * You should have received a copy of the GNU General Public License 19 | * along with OP25; see the file COPYING. If not, write to the Free 20 | * Software Foundation, Inc., 51 Franklin Street, Boston, MA 21 | * 02110-1301, USA. 22 | */ 23 | 24 | #include "tsbk.h" 25 | 26 | using namespace std; 27 | 28 | tsbk::tsbk(const_bit_queue& frame_body) : 29 | abstract_data_unit(frame_body) 30 | { 31 | } 32 | 33 | tsbk::~tsbk() 34 | { 35 | } 36 | 37 | string 38 | tsbk::duid_str() const 39 | { 40 | return string("TSBK"); 41 | } 42 | 43 | uint16_t 44 | tsbk::frame_size_max() const 45 | { 46 | #if 1 47 | return 720; 48 | #else 49 | // todo: check this out! 50 | return 358; 51 | #endif 52 | } 53 | -------------------------------------------------------------------------------- /op25/gr-op25/lib/value_string.h: -------------------------------------------------------------------------------- 1 | /* -*- C++ -*- */ 2 | 3 | /* 4 | * Copyright 2008 Steve Glass 5 | * 6 | * This file is part of OP25. 7 | * 8 | * OP25 is free software; you can redistribute it and/or modify it 9 | * under the terms of the GNU General Public License as published by 10 | * the Free Software Foundation; either version 3, or (at your option) 11 | * any later version. 12 | * 13 | * OP25 is distributed in the hope that it will be useful, but WITHOUT 14 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY 15 | * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public 16 | * License for more details. 17 | * 18 | * You should have received a copy of the GNU General Public License 19 | * along with OP25; see the file COPYING. If not, write to the Free 20 | * Software Foundation, Inc., 51 Franklin Street, Boston, MA 21 | * 02110-1301, USA. 22 | */ 23 | 24 | #ifndef INCLUDED_VALUE_STRING 25 | #define INCLUDED_VALUE_STRING 26 | 27 | #include 28 | #include 29 | 30 | /* 31 | * Look up a value in a value_string array. 32 | * 33 | */ 34 | extern std::string lookup(uint16_t value, const class value_string mappings[], size_t mappings_sz); 35 | 36 | /* 37 | * Look up tables. 38 | */ 39 | 40 | extern const value_string ALGIDS[]; 41 | extern const size_t ALGIDS_SZ; 42 | 43 | extern const value_string MFIDS[]; 44 | extern const size_t MFIDS_SZ; 45 | 46 | extern const value_string NACS[]; 47 | extern const size_t NACS_SZ; 48 | 49 | #endif // INCLUDED_VALUE_STRING 50 | -------------------------------------------------------------------------------- /op25/gr-op25/lib/voice_data_unit.cc: -------------------------------------------------------------------------------- 1 | /* -*- C++ -*- */ 2 | 3 | /* 4 | * Copyright 2008 Steve Glass 5 | * 6 | * This file is part of OP25. 7 | * 8 | * OP25 is free software; you can redistribute it and/or modify it 9 | * under the terms of the GNU General Public License as published by 10 | * the Free Software Foundation; either version 3, or (at your option) 11 | * any later version. 12 | * 13 | * OP25 is distributed in the hope that it will be useful, but WITHOUT 14 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY 15 | * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public 16 | * License for more details. 17 | * 18 | * You should have received a copy of the GNU General Public License 19 | * along with OP25; see the file COPYING. If not, write to the Free 20 | * Software Foundation, Inc., 51 Franklin Street, Boston, MA 21 | * 02110-1301, USA. 22 | */ 23 | 24 | #include "voice_data_unit.h" 25 | #include "op25_imbe_frame.h" 26 | 27 | #include 28 | 29 | using namespace std; 30 | 31 | voice_data_unit::~voice_data_unit() 32 | { 33 | } 34 | 35 | voice_data_unit::voice_data_unit(const_bit_queue& frame_body) : 36 | abstract_data_unit(frame_body) 37 | { 38 | } 39 | 40 | void 41 | voice_data_unit::do_correct_errors(bit_vector& frame_body) 42 | { 43 | } 44 | 45 | void 46 | voice_data_unit::do_decode_audio(const_bit_vector& frame_body, imbe_decoder& imbe) 47 | { 48 | voice_codeword cw(voice_codeword_sz); 49 | for(size_t i = 0; i < nof_voice_codewords; ++i) { 50 | imbe_deinterleave(frame_body, cw, i); 51 | imbe.decode(cw); 52 | } 53 | } 54 | 55 | uint16_t 56 | voice_data_unit::frame_size_max() const 57 | { 58 | return 1728; 59 | } 60 | -------------------------------------------------------------------------------- /op25/gr-op25/lib/voice_du_handler.cc: -------------------------------------------------------------------------------- 1 | /* -*- C++ -*- */ 2 | 3 | /* 4 | * Copyright 2008 Steve Glass 5 | * 6 | * This file is part of OP25. 7 | * 8 | * OP25 is free software; you can redistribute it and/or modify it 9 | * under the terms of the GNU General Public License as published by 10 | * the Free Software Foundation; either version 3, or (at your option) 11 | * any later version. 12 | * 13 | * OP25 is distributed in the hope that it will be useful, but WITHOUT 14 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY 15 | * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public 16 | * License for more details. 17 | * 18 | * You should have received a copy of the GNU General Public License 19 | * along with OP25; see the file COPYING. If not, write to the Free 20 | * Software Foundation, Inc., 51 Franklin Street, Boston, MA 21 | * 02110-1301, USA. 22 | */ 23 | 24 | #include "voice_du_handler.h" 25 | 26 | #include 27 | #include 28 | 29 | using namespace std; 30 | 31 | voice_du_handler::voice_du_handler(data_unit_handler::data_unit_handler_sptr next, imbe_decoder::imbe_decoder_sptr decoder) : 32 | data_unit_handler(next), 33 | d_decoder(decoder) 34 | { 35 | } 36 | 37 | 38 | voice_du_handler::~voice_du_handler() 39 | { 40 | } 41 | 42 | void 43 | voice_du_handler::handle(data_unit::data_unit_sptr du) 44 | { 45 | du->decode_audio(*d_decoder); 46 | data_unit_handler::handle(du); 47 | } 48 | -------------------------------------------------------------------------------- /op25/gr-op25/python/op25/bindings/.gitignore: -------------------------------------------------------------------------------- 1 | failed_conversions.txt 2 | -------------------------------------------------------------------------------- /op25/gr-op25/python/op25/bindings/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Copyright 2020 Free Software Foundation, Inc. 2 | # 3 | # This file is part of GNU Radio 4 | # 5 | # SPDX-License-Identifier: GPL-3.0-or-later 6 | # 7 | 8 | ######################################################################## 9 | # Check if there is C++ code at all 10 | ######################################################################## 11 | if(NOT op25_sources) 12 | MESSAGE(STATUS "No C++ sources... skipping python bindings") 13 | return() 14 | endif(NOT op25_sources) 15 | 16 | ######################################################################## 17 | # Check for pygccxml 18 | ######################################################################## 19 | GR_PYTHON_CHECK_MODULE_RAW( 20 | "pygccxml" 21 | "import pygccxml" 22 | PYGCCXML_FOUND 23 | ) 24 | 25 | include(GrPybind) 26 | 27 | ######################################################################## 28 | # Python Bindings 29 | ######################################################################## 30 | 31 | list(APPEND op25_python_files 32 | decoder_bf_python.cc 33 | decoder_ff_python.cc 34 | fsk4_demod_ff_python.cc 35 | fsk4_slicer_fb_python.cc 36 | pcap_source_b_python.cc 37 | python_bindings.cc) 38 | 39 | GR_PYBIND_MAKE_OOT(op25 40 | ../../.. 41 | gr::op25 42 | "${op25_python_files}") 43 | 44 | # copy in bindings .so file for use in QA test module 45 | add_custom_target( 46 | copy_bindings_for_tests ALL 47 | COMMAND 48 | ${CMAKE_COMMAND} -E copy "${CMAKE_CURRENT_BINARY_DIR}/*.so" 49 | ${CMAKE_BINARY_DIR}/test_modules/gnuradio/op25/ 50 | DEPENDS op25_python) 51 | 52 | install(TARGETS op25_python DESTINATION ${GR_PYTHON_DIR}/gnuradio/op25 COMPONENT pythonapi) 53 | -------------------------------------------------------------------------------- /op25/gr-op25/python/op25/bindings/decoder_bf_python.cc: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2023 Free Software Foundation, Inc. 3 | * 4 | * This file is part of GNU Radio 5 | * 6 | * SPDX-License-Identifier: GPL-3.0-or-later 7 | * 8 | */ 9 | 10 | /***********************************************************************************/ 11 | /* This file is automatically generated using bindtool and can be manually 12 | * edited */ 13 | /* The following lines can be configured to regenerate this file during cmake */ 14 | /* If manual edits are made, the following tags should be modified accordingly. 15 | */ 16 | /* BINDTOOL_GEN_AUTOMATIC(0) */ 17 | /* BINDTOOL_USE_PYGCCXML(0) */ 18 | /* BINDTOOL_HEADER_FILE(decoder_bf.h) */ 19 | /* BINDTOOL_HEADER_FILE_HASH(500b85e2745f02e5848b401152969ce2) */ 20 | /***********************************************************************************/ 21 | 22 | #include 23 | #include 24 | #include 25 | 26 | namespace py = pybind11; 27 | 28 | #include 29 | // pydoc.h is automatically generated in the build directory 30 | #include 31 | 32 | void bind_decoder_bf(py::module &m) { 33 | 34 | using decoder_bf = ::gr::op25::decoder_bf; 35 | 36 | py::class_>(m, "decoder_bf", D(decoder_bf)) 38 | 39 | .def(py::init(&decoder_bf::make), D(decoder_bf, make)) 40 | 41 | .def("destination", &decoder_bf::destination, D(decoder_bf, destination)) 42 | 43 | .def("get_msgq", &decoder_bf::get_msgq, D(decoder_bf, get_msgq)) 44 | 45 | .def("set_msgq", &decoder_bf::set_msgq, py::arg("msgq"), 46 | D(decoder_bf, set_msgq)) 47 | 48 | ; 49 | } 50 | -------------------------------------------------------------------------------- /op25/gr-op25/python/op25/bindings/decoder_ff_python.cc: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2023 Free Software Foundation, Inc. 3 | * 4 | * This file is part of GNU Radio 5 | * 6 | * SPDX-License-Identifier: GPL-3.0-or-later 7 | * 8 | */ 9 | 10 | /***********************************************************************************/ 11 | /* This file is automatically generated using bindtool and can be manually 12 | * edited */ 13 | /* The following lines can be configured to regenerate this file during cmake */ 14 | /* If manual edits are made, the following tags should be modified accordingly. 15 | */ 16 | /* BINDTOOL_GEN_AUTOMATIC(0) */ 17 | /* BINDTOOL_USE_PYGCCXML(0) */ 18 | /* BINDTOOL_HEADER_FILE(decoder_ff.h) */ 19 | /* BINDTOOL_HEADER_FILE_HASH(308224a7010ef5c1208000dd7088239a) */ 20 | /***********************************************************************************/ 21 | 22 | #include 23 | #include 24 | #include 25 | 26 | namespace py = pybind11; 27 | 28 | #include 29 | // pydoc.h is automatically generated in the build directory 30 | #include 31 | 32 | void bind_decoder_ff(py::module &m) { 33 | 34 | using decoder_ff = ::gr::op25::decoder_ff; 35 | 36 | py::class_>(m, "decoder_ff", D(decoder_ff)) 38 | 39 | .def(py::init(&decoder_ff::make), D(decoder_ff, make)) 40 | 41 | .def("destination", &decoder_ff::destination, D(decoder_ff, destination)) 42 | 43 | .def("get_msgq", &decoder_ff::get_msgq, D(decoder_ff, get_msgq)) 44 | 45 | .def("set_msgq", &decoder_ff::set_msgq, py::arg("msgq"), 46 | D(decoder_ff, set_msgq)) 47 | 48 | ; 49 | } 50 | -------------------------------------------------------------------------------- /op25/gr-op25/python/op25/bindings/docstrings/decoder_bf_pydoc_template.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2023 Free Software Foundation, Inc. 3 | * 4 | * This file is part of GNU Radio 5 | * 6 | * SPDX-License-Identifier: GPL-3.0-or-later 7 | * 8 | */ 9 | #include "pydoc_macros.h" 10 | #define D(...) DOC(gr, op25, __VA_ARGS__) 11 | /* 12 | This file contains placeholders for docstrings for the Python bindings. 13 | Do not edit! These were automatically extracted during the binding process 14 | and will be overwritten during the build process 15 | */ 16 | 17 | static const char *__doc_gr_op25_decoder_bf = R"doc()doc"; 18 | 19 | static const char *__doc_gr_op25_decoder_bf_decoder_bf_0 = R"doc()doc"; 20 | 21 | static const char *__doc_gr_op25_decoder_bf_decoder_bf_1 = R"doc()doc"; 22 | 23 | static const char *__doc_gr_op25_decoder_bf_make = R"doc()doc"; 24 | 25 | static const char *__doc_gr_op25_decoder_bf_destination = R"doc()doc"; 26 | 27 | static const char *__doc_gr_op25_decoder_bf_get_msgq = R"doc()doc"; 28 | 29 | static const char *__doc_gr_op25_decoder_bf_set_msgq = R"doc()doc"; 30 | -------------------------------------------------------------------------------- /op25/gr-op25/python/op25/bindings/docstrings/decoder_ff_pydoc_template.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2023 Free Software Foundation, Inc. 3 | * 4 | * This file is part of GNU Radio 5 | * 6 | * SPDX-License-Identifier: GPL-3.0-or-later 7 | * 8 | */ 9 | #include "pydoc_macros.h" 10 | #define D(...) DOC(gr, op25, __VA_ARGS__) 11 | /* 12 | This file contains placeholders for docstrings for the Python bindings. 13 | Do not edit! These were automatically extracted during the binding process 14 | and will be overwritten during the build process 15 | */ 16 | 17 | static const char *__doc_gr_op25_decoder_ff = R"doc()doc"; 18 | 19 | static const char *__doc_gr_op25_decoder_ff_decoder_ff_0 = R"doc()doc"; 20 | 21 | static const char *__doc_gr_op25_decoder_ff_decoder_ff_1 = R"doc()doc"; 22 | 23 | static const char *__doc_gr_op25_decoder_ff_make = R"doc()doc"; 24 | 25 | static const char *__doc_gr_op25_decoder_ff_destination = R"doc()doc"; 26 | 27 | static const char *__doc_gr_op25_decoder_ff_get_msgq = R"doc()doc"; 28 | 29 | static const char *__doc_gr_op25_decoder_ff_set_msgq = R"doc()doc"; 30 | -------------------------------------------------------------------------------- /op25/gr-op25/python/op25/bindings/docstrings/fsk4_demod_ff_pydoc_template.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2023 Free Software Foundation, Inc. 3 | * 4 | * This file is part of GNU Radio 5 | * 6 | * SPDX-License-Identifier: GPL-3.0-or-later 7 | * 8 | */ 9 | #include "pydoc_macros.h" 10 | #define D(...) DOC(gr, op25, __VA_ARGS__) 11 | /* 12 | This file contains placeholders for docstrings for the Python bindings. 13 | Do not edit! These were automatically extracted during the binding process 14 | and will be overwritten during the build process 15 | */ 16 | 17 | static const char *__doc_gr_op25_fsk4_demod_ff = R"doc()doc"; 18 | 19 | static const char *__doc_gr_op25_fsk4_demod_ff_fsk4_demod_ff = R"doc()doc"; 20 | 21 | static const char *__doc_gr_op25_fsk4_demod_ff_make = R"doc()doc"; 22 | 23 | static const char *__doc_gr_op25_fsk4_demod_ff_reset = R"doc()doc"; 24 | 25 | static const char *__doc_gr_op25_fsk4_demod_ff_set_rate = R"doc()doc"; 26 | -------------------------------------------------------------------------------- /op25/gr-op25/python/op25/bindings/docstrings/fsk4_slicer_fb_pydoc_template.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2023 Free Software Foundation, Inc. 3 | * 4 | * This file is part of GNU Radio 5 | * 6 | * SPDX-License-Identifier: GPL-3.0-or-later 7 | * 8 | */ 9 | #include "pydoc_macros.h" 10 | #define D(...) DOC(gr, op25, __VA_ARGS__) 11 | /* 12 | This file contains placeholders for docstrings for the Python bindings. 13 | Do not edit! These were automatically extracted during the binding process 14 | and will be overwritten during the build process 15 | */ 16 | 17 | static const char *__doc_gr_op25_fsk4_slicer_fb = R"doc()doc"; 18 | 19 | static const char *__doc_gr_op25_fsk4_slicer_fb_fsk4_slicer_fb = R"doc()doc"; 20 | 21 | static const char *__doc_gr_op25_fsk4_slicer_fb_make = R"doc()doc"; 22 | -------------------------------------------------------------------------------- /op25/gr-op25/python/op25/bindings/docstrings/pcap_source_b_pydoc_template.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2023 Free Software Foundation, Inc. 3 | * 4 | * This file is part of GNU Radio 5 | * 6 | * SPDX-License-Identifier: GPL-3.0-or-later 7 | * 8 | */ 9 | #include "pydoc_macros.h" 10 | #define D(...) DOC(gr, op25, __VA_ARGS__) 11 | /* 12 | This file contains placeholders for docstrings for the Python bindings. 13 | Do not edit! These were automatically extracted during the binding process 14 | and will be overwritten during the build process 15 | */ 16 | 17 | static const char *__doc_gr_op25_pcap_source_b = R"doc()doc"; 18 | 19 | static const char *__doc_gr_op25_pcap_source_b_pcap_source_b = R"doc()doc"; 20 | 21 | static const char *__doc_gr_op25_pcap_source_b_make = R"doc()doc"; 22 | -------------------------------------------------------------------------------- /op25/gr-op25/python/op25/bindings/fsk4_slicer_fb_python.cc: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2023 Free Software Foundation, Inc. 3 | * 4 | * This file is part of GNU Radio 5 | * 6 | * SPDX-License-Identifier: GPL-3.0-or-later 7 | * 8 | */ 9 | 10 | /***********************************************************************************/ 11 | /* This file is automatically generated using bindtool and can be manually 12 | * edited */ 13 | /* The following lines can be configured to regenerate this file during cmake */ 14 | /* If manual edits are made, the following tags should be modified accordingly. 15 | */ 16 | /* BINDTOOL_GEN_AUTOMATIC(0) */ 17 | /* BINDTOOL_USE_PYGCCXML(0) */ 18 | /* BINDTOOL_HEADER_FILE(fsk4_slicer_fb.h) */ 19 | /* BINDTOOL_HEADER_FILE_HASH(1742ec2279536c54d7c818cf6d1184fe) */ 20 | /***********************************************************************************/ 21 | 22 | #include 23 | #include 24 | #include 25 | 26 | namespace py = pybind11; 27 | 28 | #include 29 | // pydoc.h is automatically generated in the build directory 30 | #include 31 | 32 | void bind_fsk4_slicer_fb(py::module &m) { 33 | 34 | using fsk4_slicer_fb = ::gr::op25::fsk4_slicer_fb; 35 | 36 | py::class_>(m, "fsk4_slicer_fb", 38 | D(fsk4_slicer_fb)) 39 | 40 | .def(py::init(&fsk4_slicer_fb::make), py::arg("slice_levels"), 41 | D(fsk4_slicer_fb, make)) 42 | 43 | ; 44 | } 45 | -------------------------------------------------------------------------------- /op25/gr-op25/python/op25/bindings/pcap_source_b_python.cc: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2023 Free Software Foundation, Inc. 3 | * 4 | * This file is part of GNU Radio 5 | * 6 | * SPDX-License-Identifier: GPL-3.0-or-later 7 | * 8 | */ 9 | 10 | /***********************************************************************************/ 11 | /* This file is automatically generated using bindtool and can be manually 12 | * edited */ 13 | /* The following lines can be configured to regenerate this file during cmake */ 14 | /* If manual edits are made, the following tags should be modified accordingly. 15 | */ 16 | /* BINDTOOL_GEN_AUTOMATIC(0) */ 17 | /* BINDTOOL_USE_PYGCCXML(0) */ 18 | /* BINDTOOL_HEADER_FILE(pcap_source_b.h) */ 19 | /* BINDTOOL_HEADER_FILE_HASH(f7beb8e8b79396426cc5de9ec3b61ae1) */ 20 | /***********************************************************************************/ 21 | 22 | #include 23 | #include 24 | #include 25 | 26 | namespace py = pybind11; 27 | 28 | #include 29 | // pydoc.h is automatically generated in the build directory 30 | #include 31 | 32 | void bind_pcap_source_b(py::module &m) { 33 | 34 | using pcap_source_b = ::gr::op25::pcap_source_b; 35 | 36 | py::class_>(m, "pcap_source_b", 38 | D(pcap_source_b)) 39 | 40 | .def(py::init(&pcap_source_b::make), py::arg("path"), py::arg("delay"), 41 | D(pcap_source_b, make)) 42 | 43 | ; 44 | } 45 | -------------------------------------------------------------------------------- /op25/gr-op25/python/op25/qa_decoder_bf.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | # -*- coding: utf-8 -*- 3 | # 4 | # Copyright 2010,2011 Steve Glass 5 | # 6 | # This is free software; you can redistribute it and/or modify 7 | # it under the terms of the GNU General Public License as published by 8 | # the Free Software Foundation; either version 3, or (at your option) 9 | # any later version. 10 | # 11 | # This software is distributed in the hope that it will be useful, 12 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | # GNU General Public License for more details. 15 | # 16 | # You should have received a copy of the GNU General Public License 17 | # along with this software; see the file COPYING. If not, write to 18 | # the Free Software Foundation, Inc., 51 Franklin Street, 19 | # Boston, MA 02110-1301, USA. 20 | # 21 | 22 | from gnuradio import gr, gr_unittest 23 | import op25_python as op25 24 | 25 | class qa_decoder_bf (gr_unittest.TestCase): 26 | 27 | def setUp (self): 28 | self.tb = gr.top_block () 29 | 30 | def tearDown (self): 31 | self.tb = None 32 | 33 | def test_001_t (self): 34 | # set up fg 35 | self.tb.run () 36 | # check data 37 | 38 | 39 | if __name__ == '__main__': 40 | gr_unittest.run(qa_decoder_bf, "qa_decoder_bf.xml") 41 | -------------------------------------------------------------------------------- /op25/gr-op25/python/op25/qa_decoder_ff.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | # -*- coding: utf-8 -*- 3 | # 4 | # Copyright 2010,2011 Steve Glass 5 | # 6 | # This is free software; you can redistribute it and/or modify 7 | # it under the terms of the GNU General Public License as published by 8 | # the Free Software Foundation; either version 3, or (at your option) 9 | # any later version. 10 | # 11 | # This software is distributed in the hope that it will be useful, 12 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | # GNU General Public License for more details. 15 | # 16 | # You should have received a copy of the GNU General Public License 17 | # along with this software; see the file COPYING. If not, write to 18 | # the Free Software Foundation, Inc., 51 Franklin Street, 19 | # Boston, MA 02110-1301, USA. 20 | # 21 | 22 | from gnuradio import gr, gr_unittest 23 | import op25_python as op25 24 | 25 | class qa_decoder_ff (gr_unittest.TestCase): 26 | 27 | def setUp (self): 28 | self.tb = gr.top_block () 29 | 30 | def tearDown (self): 31 | self.tb = None 32 | 33 | def test_001_t (self): 34 | # set up fg 35 | self.tb.run () 36 | # check data 37 | 38 | 39 | if __name__ == '__main__': 40 | gr_unittest.run(qa_decoder_ff, "qa_decoder_ff.xml") 41 | -------------------------------------------------------------------------------- /op25/gr-op25/python/op25/qa_fsk4_demod_ff.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | # -*- coding: utf-8 -*- 3 | # 4 | # Copyright 2010,2011 Steve Glass 5 | # 6 | # This is free software; you can redistribute it and/or modify 7 | # it under the terms of the GNU General Public License as published by 8 | # the Free Software Foundation; either version 3, or (at your option) 9 | # any later version. 10 | # 11 | # This software is distributed in the hope that it will be useful, 12 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | # GNU General Public License for more details. 15 | # 16 | # You should have received a copy of the GNU General Public License 17 | # along with this software; see the file COPYING. If not, write to 18 | # the Free Software Foundation, Inc., 51 Franklin Street, 19 | # Boston, MA 02110-1301, USA. 20 | # 21 | 22 | from gnuradio import gr, gr_unittest 23 | import op25_python as op25 24 | 25 | class qa_fsk4_demod_ff (gr_unittest.TestCase): 26 | 27 | def setUp (self): 28 | self.tb = gr.top_block () 29 | 30 | def tearDown (self): 31 | self.tb = None 32 | 33 | def test_001_t (self): 34 | # set up fg 35 | self.tb.run () 36 | # check data 37 | 38 | 39 | if __name__ == '__main__': 40 | gr_unittest.run(qa_fsk4_demod_ff, "qa_fsk4_demod_ff.xml") 41 | -------------------------------------------------------------------------------- /op25/gr-op25/python/op25/qa_fsk4_slicer_fb.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | # -*- coding: utf-8 -*- 3 | # 4 | # Copyright 2010,2011 Steve Glass 5 | # 6 | # This is free software; you can redistribute it and/or modify 7 | # it under the terms of the GNU General Public License as published by 8 | # the Free Software Foundation; either version 3, or (at your option) 9 | # any later version. 10 | # 11 | # This software is distributed in the hope that it will be useful, 12 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | # GNU General Public License for more details. 15 | # 16 | # You should have received a copy of the GNU General Public License 17 | # along with this software; see the file COPYING. If not, write to 18 | # the Free Software Foundation, Inc., 51 Franklin Street, 19 | # Boston, MA 02110-1301, USA. 20 | # 21 | 22 | from gnuradio import gr, gr_unittest 23 | import op25_python as op25 24 | 25 | class qa_fsk4_slicer_fb (gr_unittest.TestCase): 26 | 27 | def setUp (self): 28 | self.tb = gr.top_block () 29 | 30 | def tearDown (self): 31 | self.tb = None 32 | 33 | def test_001_t (self): 34 | # set up fg 35 | self.tb.run () 36 | # check data 37 | 38 | 39 | if __name__ == '__main__': 40 | gr_unittest.run(qa_fsk4_slicer_fb, "qa_fsk4_slicer_fb.xml") 41 | -------------------------------------------------------------------------------- /op25/gr-op25/python/op25/qa_pcap_source_b.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | # -*- coding: utf-8 -*- 3 | # 4 | # Copyright 2010,2011 Steve Glass 5 | # 6 | # This is free software; you can redistribute it and/or modify 7 | # it under the terms of the GNU General Public License as published by 8 | # the Free Software Foundation; either version 3, or (at your option) 9 | # any later version. 10 | # 11 | # This software is distributed in the hope that it will be useful, 12 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | # GNU General Public License for more details. 15 | # 16 | # You should have received a copy of the GNU General Public License 17 | # along with this software; see the file COPYING. If not, write to 18 | # the Free Software Foundation, Inc., 51 Franklin Street, 19 | # Boston, MA 02110-1301, USA. 20 | # 21 | 22 | from gnuradio import gr, gr_unittest 23 | import op25_python as op25 24 | 25 | class qa_pcap_source_b (gr_unittest.TestCase): 26 | 27 | def setUp (self): 28 | self.tb = gr.top_block () 29 | 30 | def tearDown (self): 31 | self.tb = None 32 | 33 | def test_001_t (self): 34 | # set up fg 35 | self.tb.run () 36 | # check data 37 | 38 | 39 | if __name__ == '__main__': 40 | gr_unittest.run(qa_pcap_source_b, "qa_pcap_source_b.xml") 41 | -------------------------------------------------------------------------------- /op25/gr-op25_repeater/apps/.gitignore: -------------------------------------------------------------------------------- 1 | # Untracked files 2 | stderr* 3 | *.2 4 | *.blist 5 | *.wlist 6 | *.json 7 | *.tsv 8 | *.sh 9 | *.txt 10 | *.liq 11 | *.bin 12 | op25_python 13 | 14 | # Tracked files that would otherwise be excluded 15 | !op25.sh 16 | !op25.liq 17 | !example_liquidsoap.liq 18 | !trunk.tsv 19 | !cfg.json 20 | !meta.json 21 | -------------------------------------------------------------------------------- /op25/gr-op25_repeater/apps/5-sdr_hw.rules: -------------------------------------------------------------------------------- 1 | # Airspy Mini 2 | ACTION=="remove", SUBSYSTEM=="usb", ENV{PRODUCT}=="1d50/60a1/100", RUN+="/bin/bash /home/pi/op25/op25/gr-op25_repeater/apps/sdrhw_removed.sh" 3 | # 4 | # RTL 2830 5 | ACTION=="remove", SUBSYSTEM=="usb", ENV{PRODUCT}=="4b4/2830/100", RUN+="/bin/bash /home/pi/op25/op25/gr-op25_repeater/apps/sdrhw_removed.sh" 6 | # RTL 2832 7 | ACTION=="remove", SUBSYSTEM=="usb", ENV{PRODUCT}=="bda/2832/100", RUN+="/bin/bash /home/pi/op25/op25/gr-op25_repeater/apps/sdrhw_removed.sh" 8 | # RTL 2838 9 | ACTION=="remove", SUBSYSTEM=="usb", ENV{PRODUCT}=="bda/2838/100", RUN+="/bin/bash /home/pi/op25/op25/gr-op25_repeater/apps/sdrhw_removed.sh" 10 | ACTION=="remove", SUBSYSTEM=="usb", ENV{PRODUCT}=="5da/2838/100", RUN+="/bin/bash /home/pi/op25/op25/gr-op25_repeater/apps/sdrhw_removed.sh" 11 | -------------------------------------------------------------------------------- /op25/gr-op25_repeater/apps/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Copyright 2011 Free Software Foundation, Inc. 2 | # 3 | # This file is part of GNU Radio 4 | # 5 | # GNU Radio is free software; you can redistribute it and/or modify 6 | # it under the terms of the GNU General Public License as published by 7 | # the Free Software Foundation; either version 3, or (at your option) 8 | # any later version. 9 | # 10 | # GNU Radio is distributed in the hope that it will be useful, 11 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | # GNU General Public License for more details. 14 | # 15 | # You should have received a copy of the GNU General Public License 16 | # along with GNU Radio; see the file COPYING. If not, write to 17 | # the Free Software Foundation, Inc., 51 Franklin Street, 18 | # Boston, MA 02110-1301, USA. 19 | 20 | include(GrPython) 21 | 22 | GR_PYTHON_INSTALL( 23 | PROGRAMS 24 | DESTINATION bin 25 | ) 26 | -------------------------------------------------------------------------------- /op25/gr-op25_repeater/apps/README-analog.md: -------------------------------------------------------------------------------- 1 | `multi_rx.py` now supports a simple narrowband fm analog demodulator. It piggybacks alongside the regular digital voice channel object defined in `cfg.json` and can either be controled by trunking (e.g. for SmartNet/SmartZone monitoring) or turned on and used as a stand-alone nbfm receiver. 2 | 3 | ``` 4 | "channels": [ 5 | { 6 | "name": "voice channel", 7 | "device": "rtl1", 8 | "destination": "udp://127.0.0.1:23456", 9 | "frequency": 859000000, 10 | "enable_analog": "auto", 11 | "nbfm_deviation": 4000, 12 | "nbfm_squelch": -60, 13 | "demod_type": "fsk4", 14 | "filter_type": "widepulse", 15 | "excess_bw": 0.2, 16 | "if_rate": 24000, 17 | "symbol_rate": 4800, 18 | "plot": "" 19 | } 20 | ``` 21 | 22 | Parameters of relevance to the NBFM module are: 23 | ``` 24 | enable_analog: "off","on" or "auto" - auto is the default for use with trunking 25 | nbfm_deviation: 4000 - deviation in Hz; will affect output volume 26 | nbfm_squelch: -60 - approx avg power (in dB) required to open squelch 27 | ``` 28 | 29 | -------------------------------------------------------------------------------- /op25/gr-op25_repeater/apps/README-configuration.md: -------------------------------------------------------------------------------- 1 | The following steps need to be taken by users wishing to configure OP25 to monitor a P25 Trunked system. More complex setups are supported, but this is the base starting point. 2 | 3 | All instructions below assume you are in the `apps` directory. 4 | ``` 5 | cd ~/op25/op25/gr-op25_repeater/apps 6 | ``` 7 | 8 | 1. Set up the control channel frequencies in `trunk.tsv`: 9 | ``` 10 | ./setTrunkFreq.sh 773.84375 11 | ``` 12 | 13 | If you need multiple frequencies because your control channel moves around, place them in a comma separated list as follows (with no whitespace) 14 | ``` 15 | ./setTrunkFreq.sh 773.84375,774.19375 16 | ``` 17 | 18 | 2. Use the startup script `op25.sh` to run the application (`rx.py`). This can be customized, but the defaults should be appropriate for most stand-alone systems. If you need streaming or multiple instances you'll need to dig more deeply into the command line options for port numbers. 19 | ``` 20 | ./op25.sh 21 | ``` 22 | 23 | 3. Once the application starts it will attempt to lock the control channel and make small tuning adjustments automatically. If you have an old sdr hardware that does not have a temp-compensated crytal oscillator (TXCO) you may need to adjust the ppm correction using the `-q` parameter in the `op25.sh` startup script. 24 | 25 | -------------------------------------------------------------------------------- /op25/gr-op25_repeater/apps/README-metadata.md: -------------------------------------------------------------------------------- 1 | OP25 supports sending of metadata updates to an icecast streaming server. Configuration depends on which variant of op25 you are running; `rx.py` or `multi_rx.py`. 2 | 3 | ## `rx.py` 4 | 5 | Make a local copy of meta.json (e.g. cp meta.json my_meta.json) and edit it so that it matches your streaming server mount point and password 6 | 7 | ``` 8 | { 9 | "icecastPass": "password", 10 | "icecastMountpoint": "mountpoint", 11 | "icecastServerAddress": "server.name:port", 12 | "delay": "0.0", "icecastMountExt": ".m3u", 13 | "meta_format_idle": "[idle]", 14 | "meta_format_tgid": "[%TGID%]", 15 | "meta_format_tag": "[%TGID%] %TAG%" 16 | } 17 | ``` 18 | 19 | Add the `-M my_meta.json` command line option to `rx.py` 20 | 21 | 22 | ## `multi_rx.py` 23 | 24 | Metadata information is entered in the `metadata` section of the main `cfg.json` configuration file. Format and content is the same as used by `rx.py` 25 | 26 | ## Metatag Format 27 | 28 | The user has some control over the format of the metadata presented to the streaming server. The following pieces of information are available: 29 | - `%TGID%`: numeric talkgroup id 30 | - `%TAG%`: descriptive talkgroup string (from `tgid-tags.tsv` file) 31 | 32 | By modifying the content of the `meta_format_*` parameters you can customize the text for the three typical use cases. 33 | - `meta_format_idle`: sent when op25 is idle/waiting for a call 34 | - `meta_format_tgid`: sent during a call when only the tgid is known 35 | - `meta_format_tag`: sent during a call when both tgid and tag are known 36 | 37 | `%TGID%` and `%TAG%` will be substituted with the in-call data at runtime 38 | -------------------------------------------------------------------------------- /op25/gr-op25_repeater/apps/README-op25_stats.md: -------------------------------------------------------------------------------- 1 | The `op25_stats.sh` program is a Bash shell script that processes a log file generated by the `rx.py` program and a "tag" file that has descriptive text identifying individual talkgroups. 2 | 3 | The program takes as arguments the logfile and tag file names, for example if run from within the `op25/op25/gr-op25_repeater/apps` directory: 4 | 5 | ``` 6 | ./op25_stats.sh stderr.2 montgomery.tsv 7 | ``` 8 | 9 | To generate the log data the script needs, run `rx.py` with the argument `-v 5`. **Do not** run with `-v 10` on a Raspberry Pi or other slow(er) machine as that amount of output will probably result in log file corruption. 10 | 11 | The script generates several output files in the current directory: 12 | 13 | - `op25-freqs-used.txt`: A list of the RF channels used by the monitored site 14 | - `op25-cc-used.txt`: A list of the control channels used by the monitored site 15 | - `op25-new-tgids.txt`: A list of the talkgroups seen on the site 16 | - `op25-tgid-frequency.txt`: Talkgroups sorted by how frequently used (from most to least) 17 | - `op25-tagless-frequency.txt`: Talkgroups for which there is no tag file entry, sorted by frequency of use (most to least) 18 | - `op25-tagless-numeric.txt`: Talkgroups for which there is no tag file entry, sorted numerically. (This is very useful when searching for tags from another list.) 19 | - `op25-activity.txt`: A histogram of system activity, showing the number of calls within each five minute period. This file can be fed into a graphing program to show activity vs. time. 20 | -------------------------------------------------------------------------------- /op25/gr-op25_repeater/apps/corr/111113113311333313133333: -------------------------------------------------------------------------------- 1 | P25P1 2 | -------------------------------------------------------------------------------- /op25/gr-op25_repeater/apps/corr/11131131111333133333-6k: -------------------------------------------------------------------------------- 1 | P25 TDMA S-ISCH (6K) 2 | -------------------------------------------------------------------------------- /op25/gr-op25_repeater/apps/corr/113131333331313331113311: -------------------------------------------------------------------------------- 1 | X2TDMA BS Voice 2 | -------------------------------------------------------------------------------- /op25/gr-op25_repeater/apps/corr/131111333113313313113313: -------------------------------------------------------------------------------- 1 | DMR BS Voice 2 | -------------------------------------------------------------------------------- /op25/gr-op25_repeater/apps/corr/13131333111311311133113311331133: -------------------------------------------------------------------------------- 1 | Provoice 2 | -------------------------------------------------------------------------------- /op25/gr-op25_repeater/apps/corr/131331111333333311111131: -------------------------------------------------------------------------------- 1 | X2TDMA MS Voice 2 | -------------------------------------------------------------------------------- /op25/gr-op25_repeater/apps/corr/133313311131311113313331: -------------------------------------------------------------------------------- 1 | DMR MS Voice 2 | -------------------------------------------------------------------------------- /op25/gr-op25_repeater/apps/corr/311131133313133331131113: -------------------------------------------------------------------------------- 1 | DMR MS Data 2 | -------------------------------------------------------------------------------- /op25/gr-op25_repeater/apps/corr/31131311331331111133131311311133: -------------------------------------------------------------------------------- 1 | Provoice EA 2 | -------------------------------------------------------------------------------- /op25/gr-op25_repeater/apps/corr/313113333111111133333313: -------------------------------------------------------------------------------- 1 | X2TDMA MS Data 2 | -------------------------------------------------------------------------------- /op25/gr-op25_repeater/apps/corr/313131313133131113313111: -------------------------------------------------------------------------------- 1 | DSTAR 2 | -------------------------------------------------------------------------------- /op25/gr-op25_repeater/apps/corr/313133113131111313: -------------------------------------------------------------------------------- 1 | NXDN BS Data 2 | -------------------------------------------------------------------------------- /op25/gr-op25_repeater/apps/corr/313133113131111333: -------------------------------------------------------------------------------- 1 | NXDN MS Data 2 | -------------------------------------------------------------------------------- /op25/gr-op25_repeater/apps/corr/313133113131113113: -------------------------------------------------------------------------------- 1 | NXDN BS Voice 2 | -------------------------------------------------------------------------------- /op25/gr-op25_repeater/apps/corr/313133113131113133: -------------------------------------------------------------------------------- 1 | NXDN MS Voice 2 | -------------------------------------------------------------------------------- /op25/gr-op25_repeater/apps/corr/313333111331131131331131: -------------------------------------------------------------------------------- 1 | DMR BS Data 2 | -------------------------------------------------------------------------------- /op25/gr-op25_repeater/apps/corr/331313111113131113331133: -------------------------------------------------------------------------------- 1 | X2TDMA BS Data 2 | -------------------------------------------------------------------------------- /op25/gr-op25_repeater/apps/example_keys.json: -------------------------------------------------------------------------------- 1 | { 2 | "0x1b50": {"algid": "0xaa", "key": [ "0x12", "0x34", "0x56", "0x78", "0x90" ]}, 3 | "0x3131": {"algid": "0xaa", "key": [ "0x31", "0x31", "0x31", "0x31", "0x31" ]}, 4 | "0x0001": {"algid": "0x81", "key": [ "0x12", "0x34", "0x56", "0x78", "0x90", "0xAB", "0xCD", "0xEF" ]}, 5 | "0x0002": {"algid": "0x84", "key": [ "0x01", "0x23", "0x45", "0x67", "0x89", "0xAB", "0xCD", "0xEF", "0x23", "0x45", "0x67", "0x89", "0xAB", "0xCD", "0xEF", "0x01", "0x45", "0x67", "0x89", "0xA8", "0xCD", "0xEF", "0x01", "0x23", "0x67", "0x89", "0xAB", "0xCD", "0xEF", "0x01", "0x23", "0x45" ]}, 6 | } 7 | -------------------------------------------------------------------------------- /op25/gr-op25_repeater/apps/log_ts.py: -------------------------------------------------------------------------------- 1 | # Copyright 2020 Graham Norbury 2 | # 3 | # This file is part of OP25 4 | # 5 | # OP25 is free software; you can redistribute it and/or modify it 6 | # under the terms of the GNU General Public License as published by 7 | # the Free Software Foundation; either version 3, or (at your option) 8 | # any later version. 9 | # 10 | # OP25 is distributed in the hope that it will be useful, but WITHOUT 11 | # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY 12 | # or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public 13 | # License for more details. 14 | # 15 | # You should have received a copy of the GNU General Public License 16 | # along with OP25; see the file COPYING. If not, write to the Free 17 | # Software Foundation, Inc., 51 Franklin Street, Boston, MA 18 | # 02110-1301, USA. 19 | 20 | # Modify TS_FORMAT to control logger timestamp format 21 | # 0 = legacy epoch seconds 22 | # 1 = formatted mm/dd/yy hh:mm:ss.usec 23 | TS_FORMAT = 1 24 | 25 | import time 26 | class log_ts(object): 27 | @staticmethod 28 | def get(supplied_ts=None): 29 | if supplied_ts is None: 30 | ts = time.time() 31 | else: 32 | ts = supplied_ts 33 | 34 | if TS_FORMAT == 0: 35 | formatted_ts = "{:.6f}".format(ts) 36 | else: 37 | formatted_ts = "{:s}{:s}".format(time.strftime("%m/%d/%y %H:%M:%S",time.localtime(ts)),"{:.6f}".format(ts - int(ts)).lstrip("0")) 38 | 39 | return formatted_ts 40 | 41 | -------------------------------------------------------------------------------- /op25/gr-op25_repeater/apps/meta.json: -------------------------------------------------------------------------------- 1 | { 2 | "icecastPass": "password", 3 | "icecastMountpoint": "mountpoint", 4 | "icecastServerAddress": "server.name:port", 5 | "delay": "0.0", "icecastMountExt": ".m3u", 6 | "meta_format_idle": "[idle]", 7 | "meta_format_tgid": "[%TGID%]", 8 | "meta_format_tag": "[%TGID%] %TAG%", 9 | "meta_format_rid": "@ [%RID%]" 10 | } 11 | -------------------------------------------------------------------------------- /op25/gr-op25_repeater/apps/nyseg.tsv: -------------------------------------------------------------------------------- 1 | 121 VestalElec 2 | 122 VestalGas 3 | 123 VestalMeter 4 | 128 RangeTest 5 | 131 BrewsterLine 6 | 133 BrewsterServ 7 | 141 ElmiraElec 8 | 142 ElmiraGas 9 | 143 ElmiraMeter 10 | 151 GenvElec/Gas 11 | 153 Call Center 12 | 171 Ithaca Elec 13 | 172 Ithaca Gas 14 | 173 Ithaca Meter 15 | 191 Liberty Line 16 | 193 Liberty Serv 17 | 221 ChathElec 18 | 228 RangeTest 19 | -------------------------------------------------------------------------------- /op25/gr-op25_repeater/apps/ontario.tsv: -------------------------------------------------------------------------------- 1 | 201 Sys Techs 2 | 1001 ROC Ops 3 | 1021 PureWtrsFld 4 | 1025 Sewers "690" 5 | 1027 PureWtrsOps 6 | 1029 PureWtrsPlnt 7 | 1031 PW VL Plant 8 | 1033 PW NWQ Plant 9 | 1041 RTOC Disptch 10 | 1047 Hwy Crews 11 | 1081 MC SpeclEvnt 12 | 1098 FairprtElect 13 | 1121 WaterAuthrty 14 | 1130 TrtmntPlants 15 | 1151 SenPkZoo Ops 16 | 1152 SenPkZoo Ch2 17 | 7001 OC Sheriff 18 | 7002 OCSheriffAdm 19 | 7501 CnandaiguaPD 20 | 7505 Geneva PD 21 | 8001 OC Fire Disp 22 | 8004 OC Fire Ops4 23 | 8005 OC Fire Ops5 24 | 8006 OC Fire Ops6 25 | 8034 GenevaFD Ops 26 | 9713 Range Test 27 | -------------------------------------------------------------------------------- /op25/gr-op25_repeater/apps/op25-legacy.sh: -------------------------------------------------------------------------------- 1 | ./rx.py --nocrypt --args "rtl" --gains 'lna:36' -S 960000 -X -q 0 -v 1 -2 -V -U -T trunk.tsv 2> stderr.2 2 | -------------------------------------------------------------------------------- /op25/gr-op25_repeater/apps/op25-liq.service: -------------------------------------------------------------------------------- 1 | [Unit] 2 | Description=op25-liq 3 | After=syslog.target network.target nss-lookup.target network-online.target 4 | Requires=network-online.target 5 | 6 | [Service] 7 | User=1000 8 | Group=1000 9 | WorkingDirectory=/home/pi/op25/op25/gr-op25_repeater/apps 10 | ExecStart=/usr/bin/liquidsoap op25.liq 11 | RestartSec=5 12 | Restart=on-failure 13 | 14 | [Install] 15 | WantedBy=multi-user.target 16 | -------------------------------------------------------------------------------- /op25/gr-op25_repeater/apps/op25-rx.service: -------------------------------------------------------------------------------- 1 | [Unit] 2 | Description=op25-rx 3 | After=syslog.target network.target nss-lookup.target network-online.target 4 | Requires=network-online.target 5 | 6 | [Service] 7 | User=1000 8 | Group=1000 9 | WorkingDirectory=/home/pi/op25/op25/gr-op25_repeater/apps 10 | ExecStart=/bin/bash -- op25.sh 11 | RestartSec=5 12 | Restart=on-failure 13 | 14 | [Install] 15 | WantedBy=multi-user.target 16 | 17 | -------------------------------------------------------------------------------- /op25/gr-op25_repeater/apps/op25.sh: -------------------------------------------------------------------------------- 1 | ./multi_rx.py -v 1 -c p25_single_rtl_example.json 2> stderr.2 2 | -------------------------------------------------------------------------------- /op25/gr-op25_repeater/apps/p25_rtl_example.sh: -------------------------------------------------------------------------------- 1 | ./multi_rx.py -v 1 -c p25_rtl_example.json 2> stderr.2 2 | -------------------------------------------------------------------------------- /op25/gr-op25_repeater/apps/sdrhw_removed.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 3 | # This script gratuitously kills all rx.py and multi_rx.py processes 4 | # It is intended to be invoked by a UDEV rule when a SDR device disconnects 5 | # 6 | LOG=/var/log/$(basename $0 | sed 's/[.]sh$/.log/') 7 | echo "$(date): $(basename $0): killing op25, cmd args: $@" >> ${LOG} 8 | kill $(pgrep -f rx.py) 9 | -------------------------------------------------------------------------------- /op25/gr-op25_repeater/apps/setTrunkFreq.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | ./cfgtrunk.py trunk.tsv 0.1 $1 3 | -------------------------------------------------------------------------------- /op25/gr-op25_repeater/apps/trunk.tsv: -------------------------------------------------------------------------------- 1 | "Sysname" "Control Channel List" "Offset" "NAC" "Modulation" "TGID Tags File" "Whitelist" "Blacklist" "Center Frequency" 2 | "P25 SYSTEM" "876.54320" "0" "0" "cqpsk" "" "" "" "" 3 | -------------------------------------------------------------------------------- /op25/gr-op25_repeater/apps/tx/dstar-cfg.dat: -------------------------------------------------------------------------------- 1 | ################################################################################# 2 | # 3 | # config file for DSTAR TX 4 | # 5 | ################################################################################# 6 | # 7 | # This file is part of OP25 8 | # 9 | # This is free software; you can redistribute it and/or modify 10 | # it under the terms of the GNU General Public License as published by 11 | # the Free Software Foundation; either version 3, or (at your option) 12 | # any later version. 13 | # 14 | # This software is distributed in the hope that it will be useful, 15 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | # GNU General Public License for more details. 18 | # 19 | # You should have received a copy of the GNU General Public License 20 | # along with this software; see the file COPYING. If not, write to 21 | # the Free Software Foundation, Inc., 51 Franklin Street, 22 | # Boston, MA 02110-1301, USA. 23 | ################################################################################# 24 | # 25 | # NOTE 26 | # 27 | # Syntax is unforgiving - no whitespace allowed (outside of comments) 28 | # 29 | ################################################################################# 30 | # flags - specify values in hex 31 | flag1=0 32 | flag2=0 33 | flag3=0 34 | # call sign fields - all have an 8-character limit 35 | rptcall2=DIRECT 36 | rptcall1=DIRECT 37 | urcall=CQCQCQ 38 | # # # # # # # # # # # # set your callsign in next line 39 | mycall1=mycall 40 | # appears to be used as a radio model ID - 4-char limit 41 | mycall2=OP25 42 | -------------------------------------------------------------------------------- /op25/gr-op25_repeater/apps/tx/generate-tsbks.py: -------------------------------------------------------------------------------- 1 | #! /usr/bin/python 2 | 3 | from p25craft import make_fakecc_tsdu 4 | 5 | # should generate file p25.out 6 | 7 | if __name__ == '__main__': 8 | params = { 9 | 'wacn' : 0xbee00, 10 | 'system_id': 0x290, 11 | 'cc_freq': 925000000, 12 | 'vc_freq': 924900000, 13 | 'nac': 0x293, 14 | 'subsystem_id': 1, 15 | 'site_id': 1} 16 | make_fakecc_tsdu(params) 17 | -------------------------------------------------------------------------------- /op25/gr-op25_repeater/apps/tx/hackrf-tx.sh: -------------------------------------------------------------------------------- 1 | #! /bin/sh 2 | 3 | ./op25_tx.py --gains 'RF:0,IF:0' -n 2 -r -e -i --args 'hackrf' -f 925005000 4 | -------------------------------------------------------------------------------- /op25/gr-op25_repeater/apps/tx/test-data-1200-2.dat: -------------------------------------------------------------------------------- 1 |  -------------------------------------------------------------------------------- /op25/gr-op25_repeater/apps/tx/test-data-1200-4.dat: -------------------------------------------------------------------------------- 1 |  -------------------------------------------------------------------------------- /op25/gr-op25_repeater/apps/tx/unpack.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | from gnuradio import gr, audio, eng_notation, blocks 3 | from gnuradio.eng_option import eng_option 4 | from optparse import OptionParser 5 | 6 | class app_top_block(gr.top_block): 7 | def __init__(self, options): 8 | gr.top_block.__init__(self) 9 | 10 | IN = blocks.file_source(gr.sizeof_char, options.input_file) 11 | bits_per_symbol = 2 12 | UNPACK = blocks.packed_to_unpacked_bb(bits_per_symbol, gr.GR_MSB_FIRST) 13 | OUT = blocks.file_sink(gr.sizeof_char, options.output) 14 | 15 | self.connect(IN, UNPACK, OUT) 16 | 17 | def main(): 18 | parser = OptionParser(option_class=eng_option) 19 | parser.add_option("-i", "--input-file", type="string", default="in.dat", help="specify the input file") 20 | parser.add_option("-o", "--output", type="string", default="out.dat", help="specify the output file") 21 | 22 | (options, args) = parser.parse_args() 23 | 24 | tb = app_top_block(options) 25 | try: 26 | tb.run() 27 | except KeyboardInterrupt: 28 | tb.stop() 29 | 30 | if __name__ == "__main__": 31 | main() 32 | -------------------------------------------------------------------------------- /op25/gr-op25_repeater/cmake/Modules/gnuradio-op25_repeaterConfig.cmake: -------------------------------------------------------------------------------- 1 | find_package(PkgConfig) 2 | 3 | PKG_CHECK_MODULES(PC_GR_OP25_REPEATER gnuradio-op25_repeater) 4 | 5 | FIND_PATH( 6 | GR_OP25_REPEATER_INCLUDE_DIRS 7 | NAMES gnuradio/op25_repeater/api.h 8 | HINTS $ENV{OP25_REPEATER_DIR}/include 9 | ${PC_OP25_REPEATER_INCLUDEDIR} 10 | PATHS ${CMAKE_INSTALL_PREFIX}/include 11 | /usr/local/include 12 | /usr/include 13 | ) 14 | 15 | FIND_LIBRARY( 16 | GR_OP25_REPEATER_LIBRARIES 17 | NAMES gnuradio-op25_repeater 18 | HINTS $ENV{OP25_REPEATER_DIR}/lib 19 | ${PC_OP25_REPEATER_LIBDIR} 20 | PATHS ${CMAKE_INSTALL_PREFIX}/lib 21 | ${CMAKE_INSTALL_PREFIX}/lib64 22 | /usr/local/lib 23 | /usr/local/lib64 24 | /usr/lib 25 | /usr/lib64 26 | ) 27 | 28 | include("${CMAKE_CURRENT_LIST_DIR}/gnuradio-op25_repeaterTarget.cmake") 29 | 30 | INCLUDE(FindPackageHandleStandardArgs) 31 | FIND_PACKAGE_HANDLE_STANDARD_ARGS(GR_OP25_REPEATER DEFAULT_MSG GR_OP25_REPEATER_LIBRARIES GR_OP25_REPEATER_INCLUDE_DIRS) 32 | MARK_AS_ADVANCED(GR_OP25_REPEATER_LIBRARIES GR_OP25_REPEATER_INCLUDE_DIRS) 33 | -------------------------------------------------------------------------------- /op25/gr-op25_repeater/cmake/Modules/targetConfig.cmake.in: -------------------------------------------------------------------------------- 1 | # Copyright 2018 Free Software Foundation, Inc. 2 | # 3 | # This file is part of GNU Radio 4 | # 5 | # SPDX-License-Identifier: GPL-3.0-or-later 6 | # 7 | 8 | include(CMakeFindDependencyMacro) 9 | 10 | set(target_deps "@TARGET_DEPENDENCIES@") 11 | foreach(dep IN LISTS target_deps) 12 | find_dependency(${dep}) 13 | endforeach() 14 | include("${CMAKE_CURRENT_LIST_DIR}/@TARGET@Targets.cmake") 15 | -------------------------------------------------------------------------------- /op25/gr-op25_repeater/docs/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Copyright 2011 Free Software Foundation, Inc. 2 | # 3 | # This file is part of GNU Radio 4 | # 5 | # GNU Radio is free software; you can redistribute it and/or modify 6 | # it under the terms of the GNU General Public License as published by 7 | # the Free Software Foundation; either version 3, or (at your option) 8 | # any later version. 9 | # 10 | # GNU Radio is distributed in the hope that it will be useful, 11 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | # GNU General Public License for more details. 14 | # 15 | # You should have received a copy of the GNU General Public License 16 | # along with GNU Radio; see the file COPYING. If not, write to 17 | # the Free Software Foundation, Inc., 51 Franklin Street, 18 | # Boston, MA 02110-1301, USA. 19 | 20 | ######################################################################## 21 | # Setup dependencies 22 | ######################################################################## 23 | find_package(Doxygen) 24 | 25 | ######################################################################## 26 | # Begin conditional configuration 27 | ######################################################################## 28 | if(ENABLE_DOXYGEN) 29 | 30 | ######################################################################## 31 | # Add subdirectories 32 | ######################################################################## 33 | add_subdirectory(doxygen) 34 | 35 | endif(ENABLE_DOXYGEN) 36 | -------------------------------------------------------------------------------- /op25/gr-op25_repeater/docs/README.op25_repeater: -------------------------------------------------------------------------------- 1 | This is the op25_repeater-write-a-block package meant as a guide to building 2 | out-of-tree packages. To use the op25_repeater blocks, the Python namespaces 3 | is in 'op25_repeater', which is imported as: 4 | 5 | import op25_repeater 6 | 7 | See the Doxygen documentation for details about the blocks available 8 | in this package. A quick listing of the details can be found in Python 9 | after importing by using: 10 | 11 | help(op25_repeater) 12 | -------------------------------------------------------------------------------- /op25/gr-op25_repeater/docs/doxygen/doxyxml/generated/__init__.py: -------------------------------------------------------------------------------- 1 | """ 2 | Contains generated files produced by generateDS.py. 3 | 4 | These do the real work of parsing the doxygen xml files but the 5 | resultant classes are not very friendly to navigate so the rest of the 6 | doxyxml module processes them further. 7 | """ 8 | -------------------------------------------------------------------------------- /op25/gr-op25_repeater/docs/doxygen/other/group_defs.dox: -------------------------------------------------------------------------------- 1 | /*! 2 | * \defgroup block GNU Radio OP25_REPEATER C++ Signal Processing Blocks 3 | * \brief All C++ blocks that can be used from the OP25_REPEATER GNU Radio 4 | * module are listed here or in the subcategories below. 5 | * 6 | */ 7 | 8 | -------------------------------------------------------------------------------- /op25/gr-op25_repeater/docs/doxygen/other/main_page.dox: -------------------------------------------------------------------------------- 1 | /*! \mainpage 2 | 3 | Welcome to the GNU Radio OP25_REPEATER Block 4 | 5 | This is the intro page for the Doxygen manual generated for the OP25_REPEATER 6 | block (docs/doxygen/other/main_page.dox). Edit it to add more detailed 7 | documentation about the new GNU Radio modules contained in this 8 | project. 9 | 10 | */ 11 | -------------------------------------------------------------------------------- /op25/gr-op25_repeater/docs/doxygen/pydoc_macros.h: -------------------------------------------------------------------------------- 1 | #ifndef PYDOC_MACROS_H 2 | #define PYDOC_MACROS_H 3 | 4 | #define __EXPAND(x) x 5 | #define __COUNT(_1, _2, _3, _4, _5, _6, _7, COUNT, ...) COUNT 6 | #define __VA_SIZE(...) __EXPAND(__COUNT(__VA_ARGS__, 7, 6, 5, 4, 3, 2, 1)) 7 | #define __CAT1(a, b) a##b 8 | #define __CAT2(a, b) __CAT1(a, b) 9 | #define __DOC1(n1) __doc_##n1 10 | #define __DOC2(n1, n2) __doc_##n1##_##n2 11 | #define __DOC3(n1, n2, n3) __doc_##n1##_##n2##_##n3 12 | #define __DOC4(n1, n2, n3, n4) __doc_##n1##_##n2##_##n3##_##n4 13 | #define __DOC5(n1, n2, n3, n4, n5) __doc_##n1##_##n2##_##n3##_##n4##_##n5 14 | #define __DOC6(n1, n2, n3, n4, n5, n6) __doc_##n1##_##n2##_##n3##_##n4##_##n5##_##n6 15 | #define __DOC7(n1, n2, n3, n4, n5, n6, n7) \ 16 | __doc_##n1##_##n2##_##n3##_##n4##_##n5##_##n6##_##n7 17 | #define DOC(...) __EXPAND(__EXPAND(__CAT2(__DOC, __VA_SIZE(__VA_ARGS__)))(__VA_ARGS__)) 18 | 19 | #endif // PYDOC_MACROS_H 20 | -------------------------------------------------------------------------------- /op25/gr-op25_repeater/grc/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Copyright 2011 Free Software Foundation, Inc. 2 | # 3 | # This file is part of GNU Radio 4 | # 5 | # GNU Radio is free software; you can redistribute it and/or modify 6 | # it under the terms of the GNU General Public License as published by 7 | # the Free Software Foundation; either version 3, or (at your option) 8 | # any later version. 9 | # 10 | # GNU Radio is distributed in the hope that it will be useful, 11 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | # GNU General Public License for more details. 14 | # 15 | # You should have received a copy of the GNU General Public License 16 | # along with GNU Radio; see the file COPYING. If not, write to 17 | # the Free Software Foundation, Inc., 51 Franklin Street, 18 | # Boston, MA 02110-1301, USA. 19 | install(FILES 20 | op25_repeater_vocoder.xml 21 | op25_repeater_gardner_costas_cc.xml 22 | op25_repeater_p25_frame_assembler.xml 23 | op25_repeater_fsk4_slicer_fb.xml DESTINATION share/gnuradio/grc/blocks 24 | ) 25 | -------------------------------------------------------------------------------- /op25/gr-op25_repeater/grc/op25_repeater_fsk4_slicer_fb.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | fsk4_slicer_fb 4 | op25_repeater_fsk4_slicer_fb 5 | op25_repeater 6 | import op25_repeater 7 | op25_repeater.fsk4_slicer_fb($&slice_levels) 8 | 13 | 14 | ... 15 | ... 16 | ... 17 | 18 | 19 | 24 | 25 | in 26 | 27 | 28 | 29 | 34 | 35 | out 36 | 37 | 38 | 39 | -------------------------------------------------------------------------------- /op25/gr-op25_repeater/grc/op25_repeater_p25_frame_assembler.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | p25_frame_assembler 4 | op25_repeater_p25_frame_assembler 5 | op25_repeater 6 | import op25_repeater 7 | op25_repeater.p25_frame_assembler($udp_host, $port, $debug, $do_imbe, $do_output, $do_msgq, $queue) 8 | 13 | 14 | ... 15 | ... 16 | ... 17 | 18 | 19 | 24 | 25 | in 26 | 27 | 28 | 29 | 34 | 35 | out 36 | 37 | 38 | 39 | -------------------------------------------------------------------------------- /op25/gr-op25_repeater/grc/op25_repeater_vocoder.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | vocoder 4 | op25_repeater_vocoder 5 | op25_repeater 6 | import op25_repeater 7 | op25_repeater.vocoder($encode_flag, $verbose_flag, $stretch_amt, $udp_host, $udp_port, $raw_vectors_flag) 8 | 13 | 14 | ... 15 | ... 16 | ... 17 | 18 | 19 | 24 | 25 | in 26 | 27 | 28 | 29 | 34 | 35 | out 36 | 37 | 38 | 39 | -------------------------------------------------------------------------------- /op25/gr-op25_repeater/include/gnuradio/op25_repeater/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Copyright 2011,2012 Free Software Foundation, Inc. 2 | # 3 | # This file is part of GNU Radio 4 | # 5 | # GNU Radio is free software; you can redistribute it and/or modify 6 | # it under the terms of the GNU General Public License as published by 7 | # the Free Software Foundation; either version 3, or (at your option) 8 | # any later version. 9 | # 10 | # GNU Radio is distributed in the hope that it will be useful, 11 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | # GNU General Public License for more details. 14 | # 15 | # You should have received a copy of the GNU General Public License 16 | # along with GNU Radio; see the file COPYING. If not, write to 17 | # the Free Software Foundation, Inc., 51 Franklin Street, 18 | # Boston, MA 02110-1301, USA. 19 | 20 | ######################################################################## 21 | # Install public header files 22 | ######################################################################## 23 | install(FILES 24 | api.h 25 | vocoder.h 26 | gardner_cc.h 27 | p25_frame_assembler.h 28 | frame_assembler.h 29 | analog_udp.h 30 | rmsagc_ff.h 31 | ambe_encoder_sb.h 32 | ysf_tx_sb.h 33 | dstar_tx_sb.h 34 | fsk4_slicer_fb.h DESTINATION include/gnuradio/op25_repeater 35 | ) 36 | -------------------------------------------------------------------------------- /op25/gr-op25_repeater/include/gnuradio/op25_repeater/api.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2011 Free Software Foundation, Inc. 3 | * 4 | * This file is part of GNU Radio 5 | * 6 | * GNU Radio is free software; you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation; either version 3, or (at your option) 9 | * any later version. 10 | * 11 | * GNU Radio is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with GNU Radio; see the file COPYING. If not, write to 18 | * the Free Software Foundation, Inc., 51 Franklin Street, 19 | * Boston, MA 02110-1301, USA. 20 | */ 21 | 22 | #ifndef INCLUDED_OP25_REPEATER_API_H 23 | #define INCLUDED_OP25_REPEATER_API_H 24 | 25 | #include 26 | 27 | #ifdef gnuradio_op25_repeater_EXPORTS 28 | # define OP25_REPEATER_API __GR_ATTR_EXPORT 29 | #else 30 | # define OP25_REPEATER_API __GR_ATTR_IMPORT 31 | #endif 32 | 33 | #endif /* INCLUDED_OP25_REPEATER_API_H */ 34 | -------------------------------------------------------------------------------- /op25/gr-op25_repeater/lib/CCITTChecksumReverse.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2009,2011,2014 by Jonathan Naylor, G4KLX 3 | * 4 | * This program is free software; you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation; version 2 of the License. 7 | * 8 | * This program is distributed in the hope that it will be useful, 9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 | * GNU General Public License for more details. 12 | */ 13 | 14 | #ifndef CCITTChecksumReverse_H 15 | #define CCITTChecksumReverse_H 16 | 17 | #include 18 | 19 | class CCCITTChecksumReverse { 20 | public: 21 | CCCITTChecksumReverse(); 22 | ~CCCITTChecksumReverse(); 23 | 24 | void update(const unsigned char* data, unsigned int length); 25 | 26 | void result(unsigned char* data); 27 | 28 | bool check(const unsigned char* data); 29 | 30 | void reset(); 31 | 32 | private: 33 | union { 34 | uint16_t m_crc16; 35 | uint8_t m_crc8[2U]; 36 | }; 37 | }; 38 | 39 | #endif 40 | -------------------------------------------------------------------------------- /op25/gr-op25_repeater/lib/ambe.h: -------------------------------------------------------------------------------- 1 | #ifndef INCLUDED_AMBE_H 2 | #define INCLUDED_AMBE_H 3 | #ifdef __cplusplus 4 | extern "C" { 5 | #endif 6 | int mbe_dequantizeAmbe2250Parms (mbe_parms* cur_mp, mbe_parms* prev_mp, mbe_errs* errs, const int *b); 7 | int mbe_dequantizeAmbe2400Parms (mbe_parms* cur_mp, mbe_parms* prev_mp, mbe_errs* errs, const int *b); 8 | int mbe_dequantizeAmbeTone(mbe_tone* tone, mbe_errs* errs, const int *u); 9 | #ifdef __cplusplus 10 | } 11 | #endif 12 | #endif /* INCLUDED_AMBE_H */ 13 | -------------------------------------------------------------------------------- /op25/gr-op25_repeater/lib/ambe_encoder.h: -------------------------------------------------------------------------------- 1 | // P25 TDMA Decoder (C) Copyright 2013, 2014 Max H. Parke KA1RBI 2 | // 3 | // This file is part of OP25 4 | // 5 | // OP25 is free software; you can redistribute it and/or modify it 6 | // under the terms of the GNU General Public License as published by 7 | // the Free Software Foundation; either version 3, or (at your option) 8 | // any later version. 9 | // 10 | // OP25 is distributed in the hope that it will be useful, but WITHOUT 11 | // ANY WARRANTY; without even the implied warranty of MERCHANTABILITY 12 | // or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public 13 | // License for more details. 14 | // 15 | // You should have received a copy of the GNU General Public License 16 | // along with OP25; see the file COPYING. If not, write to the Free 17 | // Software Foundation, Inc., 51 Franklin Street, Boston, MA 18 | // 02110-1301, USA. 19 | 20 | #ifndef INCLUDED_AMBE_ENCODER_H 21 | #define INCLUDED_AMBE_ENCODER_H 22 | 23 | #include 24 | 25 | class ambe_encoder { 26 | public: 27 | void encode(int16_t samples[], uint8_t codeword[]); 28 | ambe_encoder(void); 29 | void set_49bit_mode(void); 30 | void set_dstar_mode(void); 31 | void set_gain_adjust(const float gain_adjust) {d_gain_adjust = gain_adjust;} 32 | void set_alt_dstar_interleave(const bool v) { d_alt_dstar_interleave = v; } 33 | private: 34 | imbe_vocoder vocoder; 35 | p25p2_vf interleaver; 36 | mbe_parms cur_mp; 37 | mbe_parms prev_mp; 38 | mbe_errs errs_mp; 39 | bool d_49bit_mode; 40 | bool d_dstar_mode; 41 | float d_gain_adjust; 42 | bool d_alt_dstar_interleave; 43 | }; 44 | 45 | #endif /* INCLUDED_AMBE_ENCODER_H */ 46 | -------------------------------------------------------------------------------- /op25/gr-op25_repeater/lib/bch.h: -------------------------------------------------------------------------------- 1 | #include 2 | typedef std::vector bit_vector; 3 | int bchDec(bit_vector& Codeword); 4 | 5 | -------------------------------------------------------------------------------- /op25/gr-op25_repeater/lib/ber1011.cc: -------------------------------------------------------------------------------- 1 | /* 2 | * (C) 2019, Graham J Norbury 3 | * gnorbury@bondcar.com 4 | * 5 | * Stand-alone utility to calculate bit error rate of a binary dibit capture file 6 | * containing APCO 1011Hz test tone sequence. 7 | * 8 | */ 9 | 10 | #include 11 | #include 12 | #include 13 | 14 | #include "frame_sync_magics.h" 15 | 16 | static const int SYNC_SIZE = 48; // 48 bits 17 | static const unsigned int SYNC_THRESHOLD = 4; // 4 bit errors in sync allowed 18 | 19 | bool test_sync(uint64_t cw, int &sync, int &errs) 20 | { 21 | int popcnt = 0; 22 | popcnt = __builtin_popcountll(cw ^ P25_FRAME_SYNC_MAGIC); 23 | if (popcnt <= SYNC_THRESHOLD) 24 | { 25 | errs = popcnt; 26 | return true; 27 | } 28 | 29 | return false; 30 | } 31 | 32 | int main (int argc, char* argv[]) 33 | { 34 | uint64_t cw = 0; 35 | int sync = 0; 36 | int s_errs = 0; 37 | 38 | if (argc < 2) 39 | { 40 | fprintf(stderr, "Usage: ber1011 \n"); 41 | return 1; 42 | } 43 | 44 | char dibit; 45 | size_t fpos = 0; 46 | std::fstream file(argv[1], std::ios::in | std::ios::binary); 47 | while (!file.eof()) 48 | { 49 | file.read((&dibit), 1); 50 | fpos++; 51 | 52 | cw = ((cw << 1) + ((dibit >>1) & 0x1)) & 0xffffffffffff; 53 | if (test_sync(cw, sync, s_errs)) 54 | printf("Matched sync with %d errs at %lu bit 1\n", s_errs, fpos); 55 | 56 | cw = ((cw << 1) + (dibit & 0x1)) & 0xffffffffffff; 57 | if (test_sync(cw, sync, s_errs)) 58 | printf("Matched sync with %d errs at %lu bit 0\n", s_errs, fpos); 59 | 60 | } 61 | 62 | return 0; 63 | 64 | } 65 | 66 | -------------------------------------------------------------------------------- /op25/gr-op25_repeater/lib/bptc19696.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2015 by Jonathan Naylor G4KLX 3 | * 4 | * Modifications of original code to work with OP25 5 | * Copyright (C) 2019 by Graham J. Norbury 6 | * 7 | * This program is free software; you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published by 9 | * the Free Software Foundation; either version 2 of the License, or 10 | * (at your option) any later version. 11 | * 12 | * This program is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | * GNU General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU General Public License 18 | * along with this program; if not, write to the Free Software 19 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 20 | */ 21 | 22 | #if !defined(BPTC19696_H) 23 | #define BPTC19696_H 24 | 25 | class CBPTC19696 26 | { 27 | public: 28 | CBPTC19696(); 29 | ~CBPTC19696(); 30 | 31 | bool decode(const unsigned char* in, unsigned char* out); 32 | 33 | private: 34 | bool* m_rawData; 35 | bool* m_deInterData; 36 | 37 | void decodeExtractBinary(const unsigned char* in); 38 | bool decodeErrorCheck(); 39 | void decodeDeInterleave(); 40 | void decodeExtractData(unsigned char* data) const; 41 | 42 | #if 0 43 | public: 44 | void encode(const unsigned char* in, unsigned char* out); 45 | 46 | private: 47 | void encodeExtractData(const unsigned char* in) const; 48 | void encodeInterleave(); 49 | void encodeErrorCheck(); 50 | void encodeExtractBinary(unsigned char* data); 51 | #endif 52 | }; 53 | 54 | #endif 55 | -------------------------------------------------------------------------------- /op25/gr-op25_repeater/lib/check_frame_sync.h: -------------------------------------------------------------------------------- 1 | 2 | #ifndef INCLUDED_CHECK_FRAME_SYNC_H 3 | #define INCLUDED_CHECK_FRAME_SYNC_H 4 | 5 | #include 6 | 7 | static inline bool check_frame_sync(uint64_t x, int err_threshold, int len) { 8 | int errs=0; 9 | const uint64_t mask = (1LL<> 1) & m1; //put count of each 2 bits into those 2 bits 17 | x = (x & m2) + ((x >> 2) & m2); //put count of each 4 bits into those 4 bits 18 | x = (x + (x >> 4)) & m4; //put count of each 8 bits into those 8 bits 19 | errs = (x * h01) >> 56; //returns left 8 bits of x + (x<<8) + (x<<16) + (x<<24) + ... 20 | if (errs <= err_threshold) return true; 21 | return false; 22 | } 23 | 24 | #endif /* INCLUDED_CHECK_FRAME_SYNC_H */ 25 | -------------------------------------------------------------------------------- /op25/gr-op25_repeater/lib/ezpwd/definitions: -------------------------------------------------------------------------------- 1 | // 2 | // C++ Definitions -- include once in a single C++ compilation unit 3 | // 4 | #ifndef _EZPWD_DEFINITIONS 5 | #define _EZPWD_DEFINITIONS 6 | 7 | #include "serialize_definitions" 8 | 9 | #endif // _EZPWD_DEFINITIONS -------------------------------------------------------------------------------- /op25/gr-op25_repeater/lib/golay2087.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2015 by Jonathan Naylor G4KLX 3 | * 4 | * Modifications of original code to work with OP25 5 | * Copyright (C) 2019 by Graham J. Norbury 6 | * 7 | * This program is free software; you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published by 9 | * the Free Software Foundation; either version 2 of the License, or 10 | * (at your option) any later version. 11 | * 12 | * This program is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | * GNU General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU General Public License 18 | * along with this program; if not, write to the Free Software 19 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 20 | */ 21 | 22 | #ifndef Golay2087_H 23 | #define Golay2087_H 24 | 25 | #include 26 | 27 | typedef std::vector bit_vector; 28 | 29 | class CGolay2087 { 30 | public: 31 | static void encode(bit_vector& data); 32 | static unsigned int decode(bit_vector& data); 33 | 34 | private: 35 | static unsigned int getSyndrome1987(unsigned int pattern); 36 | }; 37 | 38 | class CQR1676 { 39 | public: 40 | static void encode(bit_vector& data); 41 | static unsigned char decode(bit_vector& data); 42 | 43 | private: 44 | static unsigned int getSyndrome1576(unsigned int pattern); 45 | }; 46 | 47 | #endif 48 | -------------------------------------------------------------------------------- /op25/gr-op25_repeater/lib/hamming.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2015,2016 by Jonathan Naylor G4KLX 3 | * 4 | * Modifications of original code to work with OP25 5 | * Copyright (C) 2019 by Graham J. Norbury 6 | * 7 | * This program is free software; you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published by 9 | * the Free Software Foundation; either version 2 of the License, or 10 | * (at your option) any later version. 11 | * 12 | * This program is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | * GNU General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU General Public License 18 | * along with this program; if not, write to the Free Software 19 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 20 | */ 21 | 22 | #ifndef Hamming_H 23 | #define Hamming_H 24 | 25 | class CHamming { 26 | public: 27 | static void encode15113_1(bool* d); 28 | static bool decode15113_1(bool* d); 29 | 30 | static void encode15113_2(bool* d); 31 | static bool decode15113_2(bool* d); 32 | 33 | static void encode1393(bool* d); 34 | static bool decode1393(bool* d); 35 | 36 | static void encode1063(bool* d); 37 | static bool decode1063(bool* d); 38 | 39 | static void encode16114(bool* d); 40 | static bool decode16114(bool* d); 41 | 42 | static void encode17123(bool* d); 43 | static bool decode17123(bool* d); 44 | }; 45 | 46 | #endif 47 | -------------------------------------------------------------------------------- /op25/gr-op25_repeater/lib/imbe_decoder.cc: -------------------------------------------------------------------------------- 1 | #include "imbe_decoder.h" 2 | 3 | imbe_decoder::~imbe_decoder() 4 | { 5 | } 6 | 7 | imbe_decoder::imbe_decoder() : 8 | d_audio() 9 | { 10 | } 11 | 12 | audio_samples* 13 | imbe_decoder::audio() 14 | { 15 | return &d_audio; 16 | } 17 | -------------------------------------------------------------------------------- /op25/gr-op25_repeater/lib/imbe_vocoder/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 2.6) 2 | 3 | SET( MORE_FLAGS "-fPIC") 4 | SET( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${MORE_FLAGS}" ) 5 | 6 | list(APPEND imbe_vocoder_sources 7 | aux_sub.cc 8 | basicop2.cc 9 | ch_decode.cc 10 | ch_encode.cc 11 | dc_rmv.cc 12 | decode.cc 13 | dsp_sub.cc 14 | encode.cc 15 | imbe_vocoder.cc 16 | math_sub.cc 17 | pe_lpf.cc 18 | pitch_est.cc 19 | pitch_ref.cc 20 | qnt_sub.cc 21 | rand_gen.cc 22 | sa_decode.cc 23 | sa_encode.cc 24 | sa_enh.cc 25 | tbls.cc 26 | uv_synt.cc 27 | v_synt.cc 28 | v_uv_det.cc 29 | ) 30 | 31 | add_library(imbe_vocoder STATIC ${imbe_vocoder_sources}) 32 | -------------------------------------------------------------------------------- /op25/gr-op25_repeater/lib/imbe_vocoder/ch_decode.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Project 25 IMBE Encoder/Decoder Fixed-Point implementation 3 | * Developed by Pavel Yazev E-mail: pyazev@gmail.com 4 | * Version 1.0 (c) Copyright 2009 5 | * 6 | * This is free software; you can redistribute it and/or modify it 7 | * under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation; either version 3, or (at your option) 9 | * any later version. 10 | * 11 | * The software is distributed in the hope that it will be useful, but 12 | * WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 14 | * See the GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this; see the file COPYING. If not, write to the Free 18 | * Software Foundation, Inc., 51 Franklin Street, Boston, MA 19 | * 02110-1301, USA. 20 | */ 21 | 22 | #ifndef _CH_DECODE 23 | #define _CH_DECODE 24 | 25 | #include "typedef.h" 26 | 27 | #define BIT_STREAM_LEN (3 + 3*12 + 3*11 + 3) 28 | 29 | void decode_frame_vector(IMBE_PARAM *imbe_param, Word16 *frame_vector); 30 | void v_uv_decode(IMBE_PARAM *imbe_param); 31 | 32 | #endif 33 | -------------------------------------------------------------------------------- /op25/gr-op25_repeater/lib/imbe_vocoder/ch_encode.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Project 25 IMBE Encoder/Decoder Fixed-Point implementation 3 | * Developed by Pavel Yazev E-mail: pyazev@gmail.com 4 | * Version 1.0 (c) Copyright 2009 5 | * 6 | * This is free software; you can redistribute it and/or modify it 7 | * under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation; either version 3, or (at your option) 9 | * any later version. 10 | * 11 | * The software is distributed in the hope that it will be useful, but 12 | * WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 14 | * See the GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this; see the file COPYING. If not, write to the Free 18 | * Software Foundation, Inc., 51 Franklin Street, Boston, MA 19 | * 02110-1301, USA. 20 | */ 21 | 22 | 23 | #ifndef _CH_ENCODE 24 | #define _CH_ENCODE 25 | 26 | #define EN_BIT_STREAM_LEN (3 + 3*12 + 6 + 2*11 + 3) 27 | 28 | 29 | void encode_frame_vector(IMBE_PARAM *imbe_param, Word16 *frame_vector); 30 | 31 | 32 | #endif 33 | -------------------------------------------------------------------------------- /op25/gr-op25_repeater/lib/imbe_vocoder/dc_rmv.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Project 25 IMBE Encoder/Decoder Fixed-Point implementation 3 | * Developed by Pavel Yazev E-mail: pyazev@gmail.com 4 | * Version 1.0 (c) Copyright 2009 5 | * 6 | * This is free software; you can redistribute it and/or modify it 7 | * under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation; either version 3, or (at your option) 9 | * any later version. 10 | * 11 | * The software is distributed in the hope that it will be useful, but 12 | * WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 14 | * See the GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this; see the file COPYING. If not, write to the Free 18 | * Software Foundation, Inc., 51 Franklin Street, Boston, MA 19 | * 02110-1301, USA. 20 | */ 21 | 22 | 23 | #ifndef _DC_RMV 24 | #define _DC_RMV 25 | 26 | //----------------------------------------------------------------------------- 27 | // PURPOSE: 28 | // High-pass filter to remove DC 29 | // 30 | // 31 | // INPUT: 32 | // *sigin - pointer to input signal buffer 33 | // *sigout - pointer to output signal buffer 34 | // *mem - pointer to filter's memory element 35 | // len - number of input signal samples 36 | // 37 | // OUTPUT: 38 | // None 39 | // 40 | // RETURN: 41 | // Saved filter state in mem 42 | // 43 | //----------------------------------------------------------------------------- 44 | void dc_rmv(Word16 *sigin, Word16 *sigout, Word32 *mem, Word16 len); 45 | 46 | #endif 47 | -------------------------------------------------------------------------------- /op25/gr-op25_repeater/lib/imbe_vocoder/decode.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Project 25 IMBE Encoder/Decoder Fixed-Point implementation 3 | * Developed by Pavel Yazev E-mail: pyazev@gmail.com 4 | * Version 1.0 (c) Copyright 2009 5 | * 6 | * This is free software; you can redistribute it and/or modify it 7 | * under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation; either version 3, or (at your option) 9 | * any later version. 10 | * 11 | * The software is distributed in the hope that it will be useful, but 12 | * WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 14 | * See the GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this; see the file COPYING. If not, write to the Free 18 | * Software Foundation, Inc., 51 Franklin Street, Boston, MA 19 | * 02110-1301, USA. 20 | */ 21 | 22 | 23 | #ifndef _DECODE 24 | #define _DECODE 25 | #if 0 26 | void decode_init(IMBE_PARAM *imbe_param); 27 | void decode(IMBE_PARAM *imbe_param, Word16 *frame_vector, Word16 *snd); 28 | #endif 29 | #endif 30 | 31 | -------------------------------------------------------------------------------- /op25/gr-op25_repeater/lib/imbe_vocoder/encode.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Project 25 IMBE Encoder/Decoder Fixed-Point implementation 3 | * Developed by Pavel Yazev E-mail: pyazev@gmail.com 4 | * Version 1.0 (c) Copyright 2009 5 | * 6 | * This is free software; you can redistribute it and/or modify it 7 | * under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation; either version 3, or (at your option) 9 | * any later version. 10 | * 11 | * The software is distributed in the hope that it will be useful, but 12 | * WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 14 | * See the GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this; see the file COPYING. If not, write to the Free 18 | * Software Foundation, Inc., 51 Franklin Street, Boston, MA 19 | * 02110-1301, USA. 20 | */ 21 | 22 | 23 | #ifndef _ENCODE 24 | #define _ENCODE 25 | 26 | #define PITCH_EST_BUF_SIZE 621 27 | #if 0 28 | void encode_init(void); 29 | void encode(IMBE_PARAM *imbe_param, Word16 *frame_vector, Word16 *snd); 30 | #endif 31 | 32 | #endif 33 | -------------------------------------------------------------------------------- /op25/gr-op25_repeater/lib/imbe_vocoder/pe_lpf.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Project 25 IMBE Encoder/Decoder Fixed-Point implementation 3 | * Developed by Pavel Yazev E-mail: pyazev@gmail.com 4 | * Version 1.0 (c) Copyright 2009 5 | * 6 | * This is free software; you can redistribute it and/or modify it 7 | * under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation; either version 3, or (at your option) 9 | * any later version. 10 | * 11 | * The software is distributed in the hope that it will be useful, but 12 | * WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 14 | * See the GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this; see the file COPYING. If not, write to the Free 18 | * Software Foundation, Inc., 51 Franklin Street, Boston, MA 19 | * 02110-1301, USA. 20 | */ 21 | 22 | #ifndef _PE_LPF 23 | #define _PE_LPF 24 | 25 | 26 | //----------------------------------------------------------------------------- 27 | // PURPOSE: 28 | // Low-pass filter for pitch estimator 29 | // 30 | // 31 | // INPUT: 32 | // *sigin - pointer to input signal buffer 33 | // *sigout - pointer to output signal buffer 34 | // *mem - pointer to filter's memory element 35 | // len - number of input signal samples 36 | // 37 | // OUTPUT: 38 | // None 39 | // 40 | // RETURN: 41 | // Saved filter state in mem 42 | // 43 | //----------------------------------------------------------------------------- 44 | void pe_lpf(Word16 *sigin, Word16 *sigout, Word16 *mem, Word16 len); 45 | 46 | 47 | #endif 48 | -------------------------------------------------------------------------------- /op25/gr-op25_repeater/lib/imbe_vocoder/pitch_est.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Project 25 IMBE Encoder/Decoder Fixed-Point implementation 3 | * Developed by Pavel Yazev E-mail: pyazev@gmail.com 4 | * Version 1.0 (c) Copyright 2009 5 | * 6 | * This is free software; you can redistribute it and/or modify it 7 | * under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation; either version 3, or (at your option) 9 | * any later version. 10 | * 11 | * The software is distributed in the hope that it will be useful, but 12 | * WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 14 | * See the GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this; see the file COPYING. If not, write to the Free 18 | * Software Foundation, Inc., 51 Franklin Street, Boston, MA 19 | * 02110-1301, USA. 20 | */ 21 | 22 | 23 | #ifndef _PITCH_EST 24 | #define _PITCH_EST 25 | 26 | void pitch_est_init(void); 27 | void pitch_est(IMBE_PARAM *imbe_param, Word16 *frames_buf); 28 | 29 | #endif 30 | -------------------------------------------------------------------------------- /op25/gr-op25_repeater/lib/imbe_vocoder/pitch_ref.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Project 25 IMBE Encoder/Decoder Fixed-Point implementation 3 | * Developed by Pavel Yazev E-mail: pyazev@gmail.com 4 | * Version 1.0 (c) Copyright 2009 5 | * 6 | * This is free software; you can redistribute it and/or modify it 7 | * under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation; either version 3, or (at your option) 9 | * any later version. 10 | * 11 | * The software is distributed in the hope that it will be useful, but 12 | * WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 14 | * See the GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this; see the file COPYING. If not, write to the Free 18 | * Software Foundation, Inc., 51 Franklin Street, Boston, MA 19 | * 02110-1301, USA. 20 | */ 21 | 22 | 23 | #ifndef _PITCH_REF 24 | #define _PITCH_REF 25 | 26 | void pitch_ref(IMBE_PARAM *imbe_param, Cmplx16 *fft_buf); 27 | 28 | #endif 29 | -------------------------------------------------------------------------------- /op25/gr-op25_repeater/lib/imbe_vocoder/rand_gen.cc: -------------------------------------------------------------------------------- 1 | /* 2 | * Project 25 IMBE Encoder/Decoder Fixed-Point implementation 3 | * Developed by Pavel Yazev E-mail: pyazev@gmail.com 4 | * Version 1.0 (c) Copyright 2009 5 | * 6 | * This is free software; you can redistribute it and/or modify it 7 | * under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation; either version 3, or (at your option) 9 | * any later version. 10 | * 11 | * The software is distributed in the hope that it will be useful, but 12 | * WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 14 | * See the GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this; see the file COPYING. If not, write to the Free 18 | * Software Foundation, Inc., 51 Franklin Street, Boston, MA 19 | * 02110-1301, USA. 20 | */ 21 | 22 | 23 | 24 | #include "typedef.h" 25 | #include "basic_op.h" 26 | 27 | static UWord32 seed = 1; 28 | 29 | 30 | //----------------------------------------------------------------------------- 31 | // PURPOSE: 32 | // Generate pseudo-random numbers in range -1...1 33 | // 34 | // 35 | // INPUT: 36 | // None 37 | // 38 | // OUTPUT: 39 | // None 40 | // 41 | // RETURN: 42 | // Pseudo-random number in signed Q1.16 format 43 | // 44 | //----------------------------------------------------------------------------- 45 | Word16 rand_gen(void) 46 | { 47 | UWord32 hi, lo; 48 | 49 | lo = 16807 * (seed & 0xFFFF); 50 | hi = 16807 * (seed >> 16); 51 | 52 | lo += (Word32)(hi & 0x7FFF) << 16; 53 | lo += (hi >> 15); 54 | 55 | if(lo > 0x7FFFFFFF) 56 | lo -= 0x7FFFFFFF; 57 | 58 | seed = lo; 59 | 60 | return (Word16)lo; 61 | } 62 | -------------------------------------------------------------------------------- /op25/gr-op25_repeater/lib/imbe_vocoder/rand_gen.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Project 25 IMBE Encoder/Decoder Fixed-Point implementation 3 | * Developed by Pavel Yazev E-mail: pyazev@gmail.com 4 | * Version 1.0 (c) Copyright 2009 5 | * 6 | * This is free software; you can redistribute it and/or modify it 7 | * under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation; either version 3, or (at your option) 9 | * any later version. 10 | * 11 | * The software is distributed in the hope that it will be useful, but 12 | * WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 14 | * See the GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this; see the file COPYING. If not, write to the Free 18 | * Software Foundation, Inc., 51 Franklin Street, Boston, MA 19 | * 02110-1301, USA. 20 | */ 21 | 22 | 23 | #ifndef _RAND_GEN 24 | #define _RAND_GEN 25 | 26 | 27 | //----------------------------------------------------------------------------- 28 | // PURPOSE: 29 | // Generate pseudo-random numbers in range -1...1 30 | // 31 | // 32 | // INPUT: 33 | // None 34 | // 35 | // OUTPUT: 36 | // None 37 | // 38 | // RETURN: 39 | // Pseudo-random number in signed Q1.16 format 40 | // 41 | //----------------------------------------------------------------------------- 42 | Word16 rand_gen(void); 43 | 44 | #endif 45 | -------------------------------------------------------------------------------- /op25/gr-op25_repeater/lib/imbe_vocoder/sa_encode.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Project 25 IMBE Encoder/Decoder Fixed-Point implementation 3 | * Developed by Pavel Yazev E-mail: pyazev@gmail.com 4 | * Version 1.0 (c) Copyright 2009 5 | * 6 | * This is free software; you can redistribute it and/or modify it 7 | * under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation; either version 3, or (at your option) 9 | * any later version. 10 | * 11 | * The software is distributed in the hope that it will be useful, but 12 | * WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 14 | * See the GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this; see the file COPYING. If not, write to the Free 18 | * Software Foundation, Inc., 51 Franklin Street, Boston, MA 19 | * 02110-1301, USA. 20 | */ 21 | 22 | 23 | #ifndef _SA_ENCODE 24 | #define _SA_ENCODE 25 | 26 | 27 | void sa_encode_init(void); 28 | void sa_encode(IMBE_PARAM *imbe_param); 29 | 30 | #endif 31 | -------------------------------------------------------------------------------- /op25/gr-op25_repeater/lib/imbe_vocoder/sa_enh.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Project 25 IMBE Encoder/Decoder Fixed-Point implementation 3 | * Developed by Pavel Yazev E-mail: pyazev@gmail.com 4 | * Version 1.0 (c) Copyright 2009 5 | * 6 | * This is free software; you can redistribute it and/or modify it 7 | * under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation; either version 3, or (at your option) 9 | * any later version. 10 | * 11 | * The software is distributed in the hope that it will be useful, but 12 | * WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 14 | * See the GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this; see the file COPYING. If not, write to the Free 18 | * Software Foundation, Inc., 51 Franklin Street, Boston, MA 19 | * 02110-1301, USA. 20 | */ 21 | 22 | 23 | #ifndef _SA_ENH 24 | #define _SA_ENH 25 | 26 | #define CNST_0_9898_Q1_15 0x7EB3 27 | #define CNST_0_5_Q2_14 0x2000 28 | #define CNST_1_2_Q2_14 0x4CCC 29 | 30 | 31 | //----------------------------------------------------------------------------- 32 | // PURPOSE: 33 | // Perform Spectral Amplitude Enhancement 34 | // 35 | // 36 | // INPUT: 37 | // IMBE_PARAM *imbe_param - pointer to IMBE_PARAM structure with 38 | // valid num_harms, sa and fund_freq items 39 | // 40 | // OUTPUT: 41 | // None 42 | // 43 | // RETURN: 44 | // Enhanced Spectral Amplitudes 45 | // 46 | //----------------------------------------------------------------------------- 47 | void sa_enh(IMBE_PARAM *imbe_param); 48 | 49 | 50 | #endif 51 | -------------------------------------------------------------------------------- /op25/gr-op25_repeater/lib/imbe_vocoder/uv_synt.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Project 25 IMBE Encoder/Decoder Fixed-Point implementation 3 | * Developed by Pavel Yazev E-mail: pyazev@gmail.com 4 | * Version 1.0 (c) Copyright 2009 5 | * 6 | * This is free software; you can redistribute it and/or modify it 7 | * under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation; either version 3, or (at your option) 9 | * any later version. 10 | * 11 | * The software is distributed in the hope that it will be useful, but 12 | * WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 14 | * See the GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this; see the file COPYING. If not, write to the Free 18 | * Software Foundation, Inc., 51 Franklin Street, Boston, MA 19 | * 02110-1301, USA. 20 | */ 21 | 22 | #ifndef _UV_SYNT 23 | #define _UV_SYNT 24 | 25 | void uv_synt_init(void); 26 | void uv_synt(IMBE_PARAM *imbe_param, Word16 *snd); 27 | void fft(Word16 *datam1, Word16 nn, Word16 isign); 28 | 29 | #endif 30 | -------------------------------------------------------------------------------- /op25/gr-op25_repeater/lib/imbe_vocoder/v_synt.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Project 25 IMBE Encoder/Decoder Fixed-Point implementation 3 | * Developed by Pavel Yazev E-mail: pyazev@gmail.com 4 | * Version 1.0 (c) Copyright 2009 5 | * 6 | * This is free software; you can redistribute it and/or modify it 7 | * under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation; either version 3, or (at your option) 9 | * any later version. 10 | * 11 | * The software is distributed in the hope that it will be useful, but 12 | * WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 14 | * See the GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this; see the file COPYING. If not, write to the Free 18 | * Software Foundation, Inc., 51 Franklin Street, Boston, MA 19 | * 02110-1301, USA. 20 | */ 21 | 22 | 23 | #ifndef _V_SYNT 24 | #define _V_SYNT 25 | 26 | void v_synt_init(void); 27 | void v_synt(IMBE_PARAM *imbe_param, Word16 *snd); 28 | 29 | 30 | #endif 31 | -------------------------------------------------------------------------------- /op25/gr-op25_repeater/lib/imbe_vocoder/v_uv_det.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Project 25 IMBE Encoder/Decoder Fixed-Point implementation 3 | * Developed by Pavel Yazev E-mail: pyazev@gmail.com 4 | * Version 1.0 (c) Copyright 2009 5 | * 6 | * This is free software; you can redistribute it and/or modify it 7 | * under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation; either version 3, or (at your option) 9 | * any later version. 10 | * 11 | * The software is distributed in the hope that it will be useful, but 12 | * WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 14 | * See the GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this; see the file COPYING. If not, write to the Free 18 | * Software Foundation, Inc., 51 Franklin Street, Boston, MA 19 | * 02110-1301, USA. 20 | */ 21 | 22 | 23 | #ifndef _V_UV_DET 24 | #define _V_UV_DET 25 | 26 | void v_uv_det(IMBE_PARAM *imbe_param, Cmplx16 *fft_buf); 27 | 28 | #endif 29 | -------------------------------------------------------------------------------- /op25/gr-op25_repeater/lib/op25_crypt.h: -------------------------------------------------------------------------------- 1 | /* -*- c++ -*- */ 2 | /* 3 | * Copyright 2025 Graham J. Norbury 4 | * 5 | * This is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 3, or (at your option) 8 | * any later version. 9 | * 10 | * This software is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this software; see the file COPYING. If not, write to 17 | * the Free Software Foundation, Inc., 51 Franklin Street, 18 | * Boston, MA 02110-1301, USA. 19 | */ 20 | 21 | #ifndef INCLUDED_OP25_REPEATER_OP25_CRYPT_H 22 | #define INCLUDED_OP25_REPEATER_OP25_CRYPT_H 23 | 24 | #include 25 | #include 26 | 27 | enum algid_type : uint8_t { 28 | ALG_UNENCRYPTED = 0x80, 29 | ALG_DES_OFB = 0x81, 30 | ALG_AES_256 = 0x84, 31 | ALG_ADP_RC4 = 0xAA 32 | }; 33 | 34 | enum frame_type { FT_UNK = 0, FT_LDU1, FT_LDU2, FT_2V, FT_4V_0, FT_4V_1, FT_4V_2, FT_4V_3 }; 35 | enum protocol_type { PT_UNK = 0, PT_P25_PHASE1, PT_P25_PHASE2 }; 36 | 37 | typedef std::vector packed_codeword; 38 | 39 | struct key_info { 40 | key_info() : algid(0), key() {} 41 | key_info(uint8_t a, const std::vector &k) : algid(a), key(k) {} 42 | uint8_t algid; 43 | std::vector key; 44 | }; 45 | 46 | #endif /* INCLUDED_OP25_REPEATER_P25_CRYPT_H */ 47 | -------------------------------------------------------------------------------- /op25/gr-op25_repeater/lib/op25_imbe_frame.h: -------------------------------------------------------------------------------- 1 | ../../gr-op25/lib/op25_imbe_frame.h -------------------------------------------------------------------------------- /op25/gr-op25_repeater/lib/op25_p25_frame.h: -------------------------------------------------------------------------------- 1 | #ifndef INCLUDED_OP25_P25_FRAME_H 2 | #define INCLUDED_OP25_P25_FRAME_H 1 3 | 4 | #include "frame_sync_magics.h" 5 | 6 | static const size_t P25_VOICE_FRAME_SIZE = 1728; 7 | static const size_t P25_HEADER_SYMBOLS = 24 + 32 + 1; 8 | static const size_t P25_HEADER_BITS = P25_HEADER_SYMBOLS * 2; 9 | 10 | /* Given a 64-bit frame header word and a frame body which is to be initialized 11 | * 1. Place flags at beginning of frame body 12 | * 2. Store 64-bit frame header word 13 | * 3. FIXME Place first status symbol 14 | */ 15 | static inline void 16 | p25_setup_frame_header(bit_vector& frame_body, uint64_t hw) { 17 | uint64_t acc = P25_FRAME_SYNC_MAGIC; 18 | for (int i=47; i>=0; i--) { 19 | frame_body[ i ] = acc & 1; 20 | acc >>= 1; 21 | } 22 | acc = hw; 23 | for (int i=113; i>=72; i--) { 24 | frame_body[ i ] = acc & 1; 25 | acc >>= 1; 26 | } 27 | // FIXME: insert proper status dibit bits at 70, 71 28 | frame_body[70] = 1; 29 | frame_body[71] = 0; 30 | for (int i=69; i>=48; i--) { 31 | frame_body[ i ] = acc & 1; 32 | acc >>= 1; 33 | } 34 | } 35 | 36 | #endif /* INCLUDED_OP25_P25_FRAME_H */ 37 | -------------------------------------------------------------------------------- /op25/gr-op25_repeater/lib/op25_timer.cc: -------------------------------------------------------------------------------- 1 | // 2 | // Microsecond timer 3 | // (C) Copyright 2019 Graham J. Norbury 4 | // 5 | // This file is part of OP25 6 | // 7 | // OP25 is free software; you can redistribute it and/or modify it 8 | // under the terms of the GNU General Public License as published by 9 | // the Free Software Foundation; either version 3, or (at your option) 10 | // any later version. 11 | // 12 | // OP25 is distributed in the hope that it will be useful, but WITHOUT 13 | // ANY WARRANTY; without even the implied warranty of MERCHANTABILITY 14 | // or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public 15 | // License for more details. 16 | // 17 | // You should have received a copy of the GNU General Public License 18 | // along with OP25; see the file COPYING. If not, write to the Free 19 | // Software Foundation, Inc., 51 Franklin Street, Boston, MA 20 | // 02110-1301, USA. 21 | 22 | #include "op25_timer.h" 23 | 24 | op25_timer::op25_timer(uint64_t duration) : 25 | d_duration(duration) 26 | { 27 | reset(); 28 | } 29 | 30 | op25_timer::~op25_timer() 31 | { 32 | } 33 | 34 | void 35 | op25_timer::reset() 36 | { 37 | gettimeofday(&d_timer, 0); 38 | } 39 | 40 | bool 41 | op25_timer::expired() 42 | { 43 | struct timeval cur_time; 44 | gettimeofday(&cur_time, 0); 45 | 46 | int64_t diff_usec = cur_time.tv_usec - d_timer.tv_usec; 47 | int64_t diff_sec = cur_time.tv_sec - d_timer.tv_sec ; 48 | 49 | if (diff_usec < 0) { 50 | diff_usec += 1000000; 51 | diff_sec -= 1; 52 | } 53 | diff_usec += diff_sec * 1000000; 54 | if ((uint64_t)diff_usec >= d_duration) 55 | return true; 56 | 57 | return false; 58 | } 59 | -------------------------------------------------------------------------------- /op25/gr-op25_repeater/lib/op25_timer.h: -------------------------------------------------------------------------------- 1 | // 2 | // Microsecond timer 3 | // (C) Copyright 2019 Graham J. Norbury 4 | // 5 | // This file is part of OP25 6 | // 7 | // OP25 is free software; you can redistribute it and/or modify it 8 | // under the terms of the GNU General Public License as published by 9 | // the Free Software Foundation; either version 3, or (at your option) 10 | // any later version. 11 | // 12 | // OP25 is distributed in the hope that it will be useful, but WITHOUT 13 | // ANY WARRANTY; without even the implied warranty of MERCHANTABILITY 14 | // or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public 15 | // License for more details. 16 | // 17 | // You should have received a copy of the GNU General Public License 18 | // along with OP25; see the file COPYING. If not, write to the Free 19 | // Software Foundation, Inc., 51 Franklin Street, Boston, MA 20 | // 02110-1301, USA. 21 | 22 | #ifndef INCLUDED_OP25_TIMER_H 23 | #define INCLUDED_OP25_TIMER_H 24 | 25 | #include 26 | #include 27 | 28 | class op25_timer { 29 | public: 30 | op25_timer(const uint64_t duration); 31 | ~op25_timer(); 32 | void reset(); 33 | bool expired(); 34 | 35 | private: 36 | struct timeval d_timer; 37 | uint64_t d_duration; 38 | }; 39 | 40 | #endif /* INCLUDED_OP25_TIMER_H */ 41 | -------------------------------------------------------------------------------- /op25/gr-op25_repeater/lib/p25p2_duid.h: -------------------------------------------------------------------------------- 1 | 2 | // P25 TDMA Decoder (C) Copyright 2013, 2014 Max H. Parke KA1RBI 3 | // 4 | // This file is part of OP25 5 | // 6 | // OP25 is free software; you can redistribute it and/or modify it 7 | // under the terms of the GNU General Public License as published by 8 | // the Free Software Foundation; either version 3, or (at your option) 9 | // any later version. 10 | // 11 | // OP25 is distributed in the hope that it will be useful, but WITHOUT 12 | // ANY WARRANTY; without even the implied warranty of MERCHANTABILITY 13 | // or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public 14 | // License for more details. 15 | // 16 | // You should have received a copy of the GNU General Public License 17 | // along with OP25; see the file COPYING. If not, write to the Free 18 | // Software Foundation, Inc., 51 Franklin Street, Boston, MA 19 | // 02110-1301, USA. 20 | 21 | #ifndef INCLUDED_P25P2_DUID_H 22 | #define INCLUDED_P25P2_DUID_H 23 | 24 | #include 25 | 26 | /* static const char* duid_strings[] = { 27 | "4v", 28 | "?1", 29 | "?2", 30 | "sacch w", 31 | "?4", 32 | "?5", 33 | "2v", 34 | "?7", 35 | "?8", 36 | "facch w", 37 | "?10", 38 | "?11" 39 | "sacch w/o", 40 | "?13", 41 | "?14" 42 | "facch w/o" 43 | }; */ 44 | 45 | class p25p2_duid; 46 | class p25p2_duid 47 | { 48 | public: 49 | p25p2_duid(); // constructor 50 | int16_t duid_lookup(const uint8_t codeword); 51 | uint8_t extract_duid(const uint8_t dibits[]); 52 | private: 53 | }; 54 | #endif /* INCLUDED_P25P2_DUID_H */ 55 | -------------------------------------------------------------------------------- /op25/gr-op25_repeater/lib/p25p2_framer.h: -------------------------------------------------------------------------------- 1 | /* -*- c++ -*- */ 2 | 3 | /* 4 | * construct P25 P2 TDMA frames out of raw dibits 5 | * Copyright 2014, Max H. Parke KA1RBI 6 | * 7 | * usage: after constructing, call rx_sym once per received dibit. 8 | * frame available when true is returned 9 | */ 10 | 11 | #ifndef INCLUDED_P25P2_FRAMER_H 12 | #define INCLUDED_P25P2_FRAMER_H 13 | 14 | #include "frame_sync_magics.h" 15 | 16 | static const unsigned int P25P2_BURST_SIZE=360; /* in bits */ 17 | 18 | class p25p2_framer; 19 | 20 | class p25p2_framer 21 | { 22 | private: 23 | typedef std::vector bit_vector; 24 | // internal instance variables and state 25 | uint32_t d_next_bit; 26 | uint32_t d_in_sync; 27 | uint64_t d_fs; 28 | uint64_t nid_accum; 29 | 30 | public: 31 | p25p2_framer(); // constructor 32 | ~p25p2_framer (); // destructor 33 | bool rx_sym(uint8_t dibit) ; 34 | uint64_t get_fs() { return d_fs; } 35 | 36 | uint32_t symbols_received; 37 | 38 | bit_vector d_frame_body; // all bits in frame 39 | }; 40 | 41 | #endif /* INCLUDED_P25P2_FRAMER_H */ 42 | -------------------------------------------------------------------------------- /op25/gr-op25_repeater/lib/p25p2_isch.h: -------------------------------------------------------------------------------- 1 | 2 | // P25 TDMA Decoder (C) Copyright 2013, 2014 Max H. Parke KA1RBI 3 | // 4 | // This file is part of OP25 5 | // 6 | // OP25 is free software; you can redistribute it and/or modify it 7 | // under the terms of the GNU General Public License as published by 8 | // the Free Software Foundation; either version 3, or (at your option) 9 | // any later version. 10 | // 11 | // OP25 is distributed in the hope that it will be useful, but WITHOUT 12 | // ANY WARRANTY; without even the implied warranty of MERCHANTABILITY 13 | // or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public 14 | // License for more details. 15 | // 16 | // You should have received a copy of the GNU General Public License 17 | // along with OP25; see the file COPYING. If not, write to the Free 18 | // Software Foundation, Inc., 51 Franklin Street, Boston, MA 19 | // 02110-1301, USA. 20 | 21 | #ifndef INCLUDED_P25P2_ISCH_H 22 | #define INCLUDED_P25P2_ISCH_H 23 | 24 | #include 25 | #include 26 | #include 27 | 28 | class p25p2_isch; 29 | class p25p2_isch 30 | { 31 | public: 32 | p25p2_isch(); // constructor 33 | int16_t isch_lookup(uint64_t cw); 34 | int16_t isch_lookup(const uint8_t dibits[]); 35 | private: 36 | std::map isch_map; 37 | }; 38 | #endif /* INCLUDED_P25P2_ISCH_H */ 39 | -------------------------------------------------------------------------------- /op25/gr-op25_repeater/lib/p25p2_sync.h: -------------------------------------------------------------------------------- 1 | // P25 TDMA Decoder (C) Copyright 2013, 2014 Max H. Parke KA1RBI 2 | // 3 | // This file is part of OP25 4 | // 5 | // OP25 is free software; you can redistribute it and/or modify it 6 | // under the terms of the GNU General Public License as published by 7 | // the Free Software Foundation; either version 3, or (at your option) 8 | // any later version. 9 | // 10 | // OP25 is distributed in the hope that it will be useful, but WITHOUT 11 | // ANY WARRANTY; without even the implied warranty of MERCHANTABILITY 12 | // or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public 13 | // License for more details. 14 | // 15 | // You should have received a copy of the GNU General Public License 16 | // along with OP25; see the file COPYING. If not, write to the Free 17 | // Software Foundation, Inc., 51 Franklin Street, Boston, MA 18 | // 02110-1301, USA. 19 | 20 | #ifndef INCLUDED_P25P2_SYNC_H 21 | #define INCLUDED_P25P2_SYNC_H 22 | 23 | #include 24 | #include "p25p2_isch.h" 25 | 26 | class p25p2_sync; 27 | class p25p2_sync 28 | { 29 | public: 30 | p25p2_sync(); // constructor 31 | p25p2_isch isch; 32 | void check_confidence (const uint8_t dibits[]); 33 | bool in_sync(void); 34 | uint32_t tdma_slotid(void) { return _tdma_slotid; } 35 | int last_rc(void) { return d_last_rc; } 36 | private: 37 | int32_t sync_confidence; 38 | uint32_t _tdma_slotid; 39 | uint32_t packets; 40 | int d_last_rc; 41 | }; 42 | #endif /* INCLUDED_P25P2_SYNC_H */ 43 | -------------------------------------------------------------------------------- /op25/gr-op25_repeater/lib/qa_op25_repeater.cc: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2012 Free Software Foundation, Inc. 3 | * 4 | * This file is part of GNU Radio 5 | * 6 | * GNU Radio is free software; you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation; either version 3, or (at your option) 9 | * any later version. 10 | * 11 | * GNU Radio is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with GNU Radio; see the file COPYING. If not, write to 18 | * the Free Software Foundation, Inc., 51 Franklin Street, 19 | * Boston, MA 02110-1301, USA. 20 | */ 21 | 22 | /* 23 | * This class gathers together all the test cases for the gr-filter 24 | * directory into a single test suite. As you create new test cases, 25 | * add them here. 26 | */ 27 | 28 | #include "qa_op25_repeater.h" 29 | 30 | CppUnit::TestSuite * 31 | qa_op25_repeater::suite() 32 | { 33 | CppUnit::TestSuite *s = new CppUnit::TestSuite("op25_repeater"); 34 | 35 | return s; 36 | } 37 | -------------------------------------------------------------------------------- /op25/gr-op25_repeater/lib/qa_op25_repeater.h: -------------------------------------------------------------------------------- 1 | /* -*- c++ -*- */ 2 | /* 3 | * Copyright 2012 Free Software Foundation, Inc. 4 | * 5 | * This file is part of GNU Radio 6 | * 7 | * GNU Radio is free software; you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published by 9 | * the Free Software Foundation; either version 3, or (at your option) 10 | * any later version. 11 | * 12 | * GNU Radio is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | * GNU General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU General Public License 18 | * along with GNU Radio; see the file COPYING. If not, write to 19 | * the Free Software Foundation, Inc., 51 Franklin Street, 20 | * Boston, MA 02110-1301, USA. 21 | */ 22 | 23 | #ifndef _QA_OP25_REPEATER_H_ 24 | #define _QA_OP25_REPEATER_H_ 25 | 26 | #include 27 | #include 28 | 29 | //! collect all the tests for the gr-filter directory 30 | 31 | class __GR_ATTR_EXPORT qa_op25_repeater 32 | { 33 | public: 34 | //! return suite of tests for all of gr-filter directory 35 | static CppUnit::TestSuite *suite(); 36 | }; 37 | 38 | #endif /* _QA_OP25_REPEATER_H_ */ 39 | -------------------------------------------------------------------------------- /op25/gr-op25_repeater/lib/rs.h: -------------------------------------------------------------------------------- 1 | 2 | #ifndef INCLUDED_OP25_RS_H 3 | #define INCLUDED_OP25_RS_H 4 | 5 | #include 6 | #include 7 | #include 8 | #include 9 | 10 | uint32_t gly24128Dec (uint32_t n, size_t* errs = NULL) ; 11 | uint32_t gly23127Dec (uint32_t n, size_t* errs = NULL) ; 12 | 13 | #endif 14 | -------------------------------------------------------------------------------- /op25/gr-op25_repeater/lib/test_op25_repeater.cc: -------------------------------------------------------------------------------- 1 | /* -*- c++ -*- */ 2 | /* 3 | * Copyright 2012 Free Software Foundation, Inc. 4 | * 5 | * This file is part of GNU Radio 6 | * 7 | * GNU Radio is free software; you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published by 9 | * the Free Software Foundation; either version 3, or (at your option) 10 | * any later version. 11 | * 12 | * GNU Radio is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | * GNU General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU General Public License 18 | * along with GNU Radio; see the file COPYING. If not, write to 19 | * the Free Software Foundation, Inc., 51 Franklin Street, 20 | * Boston, MA 02110-1301, USA. 21 | */ 22 | 23 | #ifdef HAVE_CONFIG_H 24 | #include "config.h" 25 | #endif 26 | 27 | #include 28 | #include 29 | 30 | #include 31 | #include "qa_op25_repeater.h" 32 | #include 33 | 34 | int 35 | main (int argc, char **argv) 36 | { 37 | CppUnit::TextTestRunner runner; 38 | std::ofstream xmlfile(get_unittest_path("op25_repeater.xml").c_str()); 39 | CppUnit::XmlOutputter *xmlout = new CppUnit::XmlOutputter(&runner.result(), xmlfile); 40 | 41 | runner.addTest(qa_op25_repeater::suite()); 42 | runner.setOutputter(xmlout); 43 | 44 | bool was_successful = runner.run("", false); 45 | 46 | return was_successful ? 0 : 1; 47 | } 48 | -------------------------------------------------------------------------------- /op25/gr-op25_repeater/lib/trellis.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2016 by Jonathan Naylor, G4KLX 3 | * 4 | * Modifications of original code to work with OP25 5 | * Copyright (C) 2019 by Graham J. Norbury 6 | * 7 | * This program is free software; you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published by 9 | * the Free Software Foundation; version 2 of the License. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | */ 16 | 17 | #ifndef DMRTrellis_H 18 | #define DMRTrellis_H 19 | 20 | class CDMRTrellis { 21 | public: 22 | CDMRTrellis(); 23 | ~CDMRTrellis(); 24 | 25 | bool decode(const unsigned char* data, unsigned char* payload); 26 | 27 | private: 28 | void deinterleave(const unsigned char* in, signed char* dibits) const; 29 | void dibitsToPoints(const signed char* dibits, unsigned char* points) const; 30 | void pointsToDibits(const unsigned char* points, signed char* dibits) const; 31 | void bitsToTribits(const unsigned char* payload, unsigned char* tribits) const; 32 | void tribitsToBits(const unsigned char* tribits, unsigned char* payload) const; 33 | bool fixCode(unsigned char* points, unsigned int failPos, unsigned char* payload) const; 34 | unsigned int checkCode(const unsigned char* points, unsigned char* tribits) const; 35 | }; 36 | 37 | #endif 38 | -------------------------------------------------------------------------------- /op25/gr-op25_repeater/python/op25_repeater/bindings/.gitignore: -------------------------------------------------------------------------------- 1 | failed_conversions.txt 2 | -------------------------------------------------------------------------------- /op25/gr-op25_repeater/python/op25_repeater/bindings/ambe_encoder_sb_python.cc: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2023 Free Software Foundation, Inc. 3 | * 4 | * This file is part of GNU Radio 5 | * 6 | * SPDX-License-Identifier: GPL-3.0-or-later 7 | * 8 | */ 9 | 10 | /***********************************************************************************/ 11 | /* This file is automatically generated using bindtool and can be manually 12 | * edited */ 13 | /* The following lines can be configured to regenerate this file during cmake */ 14 | /* If manual edits are made, the following tags should be modified accordingly. 15 | */ 16 | /* BINDTOOL_GEN_AUTOMATIC(0) */ 17 | /* BINDTOOL_USE_PYGCCXML(0) */ 18 | /* BINDTOOL_HEADER_FILE(ambe_encoder_sb.h) */ 19 | /* BINDTOOL_HEADER_FILE_HASH(9ac675c0207e69f1882d8d4d8eb119d1) */ 20 | /***********************************************************************************/ 21 | 22 | #include 23 | #include 24 | #include 25 | 26 | namespace py = pybind11; 27 | 28 | #include 29 | // pydoc.h is automatically generated in the build directory 30 | #include 31 | 32 | void bind_ambe_encoder_sb(py::module &m) { 33 | 34 | using ambe_encoder_sb = ::gr::op25_repeater::ambe_encoder_sb; 35 | 36 | py::class_>(m, "ambe_encoder_sb", 38 | D(ambe_encoder_sb)) 39 | 40 | .def(py::init(&ambe_encoder_sb::make), py::arg("versbose_flag"), 41 | D(ambe_encoder_sb, make)) 42 | 43 | .def("set_gain_adjust", &ambe_encoder_sb::set_gain_adjust, 44 | py::arg("gain_adjust"), D(ambe_encoder_sb, set_gain_adjust)) 45 | 46 | ; 47 | } 48 | -------------------------------------------------------------------------------- /op25/gr-op25_repeater/python/op25_repeater/bindings/analog_udp_python.cc: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2023 Free Software Foundation, Inc. 3 | * 4 | * This file is part of GNU Radio 5 | * 6 | * SPDX-License-Identifier: GPL-3.0-or-later 7 | * 8 | */ 9 | 10 | /***********************************************************************************/ 11 | /* This file is automatically generated using bindtool and can be manually 12 | * edited */ 13 | /* The following lines can be configured to regenerate this file during cmake */ 14 | /* If manual edits are made, the following tags should be modified accordingly. 15 | */ 16 | /* BINDTOOL_GEN_AUTOMATIC(0) */ 17 | /* BINDTOOL_USE_PYGCCXML(0) */ 18 | /* BINDTOOL_HEADER_FILE(analog_udp.h) */ 19 | /* BINDTOOL_HEADER_FILE_HASH(8f107938145adf78888ad428d04b1783) */ 20 | /***********************************************************************************/ 21 | 22 | #include 23 | #include 24 | #include 25 | 26 | namespace py = pybind11; 27 | 28 | #include 29 | // pydoc.h is automatically generated in the build directory 30 | #include 31 | 32 | void bind_analog_udp(py::module &m) { 33 | 34 | using analog_udp = ::gr::op25_repeater::analog_udp; 35 | 36 | py::class_>(m, "analog_udp", D(analog_udp)) 38 | 39 | .def(py::init(&analog_udp::make), py::arg("options"), py::arg("debug"), 40 | py::arg("msgq_id"), py::arg("queue"), D(analog_udp, make)) 41 | 42 | .def("set_debug", &analog_udp::set_debug, py::arg("debug"), 43 | D(analog_udp, set_debug)) 44 | 45 | ; 46 | } 47 | -------------------------------------------------------------------------------- /op25/gr-op25_repeater/python/op25_repeater/bindings/dmr_bs_tx_bb_python.cc: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2023 Free Software Foundation, Inc. 3 | * 4 | * This file is part of GNU Radio 5 | * 6 | * SPDX-License-Identifier: GPL-3.0-or-later 7 | * 8 | */ 9 | 10 | /***********************************************************************************/ 11 | /* This file is automatically generated using bindtool and can be manually 12 | * edited */ 13 | /* The following lines can be configured to regenerate this file during cmake */ 14 | /* If manual edits are made, the following tags should be modified accordingly. 15 | */ 16 | /* BINDTOOL_GEN_AUTOMATIC(0) */ 17 | /* BINDTOOL_USE_PYGCCXML(0) */ 18 | /* BINDTOOL_HEADER_FILE(dmr_bs_tx_bb.h) */ 19 | /* BINDTOOL_HEADER_FILE_HASH(a53b7aea26b87ad3ab2eb7cfc0862732) */ 20 | /***********************************************************************************/ 21 | 22 | #include 23 | #include 24 | #include 25 | 26 | namespace py = pybind11; 27 | 28 | #include 29 | // pydoc.h is automatically generated in the build directory 30 | #include 31 | 32 | void bind_dmr_bs_tx_bb(py::module &m) { 33 | 34 | using dmr_bs_tx_bb = ::gr::op25_repeater::dmr_bs_tx_bb; 35 | 36 | py::class_>(m, "dmr_bs_tx_bb", D(dmr_bs_tx_bb)) 38 | 39 | .def(py::init(&dmr_bs_tx_bb::make), py::arg("versbose_flag"), 40 | py::arg("conf_file"), D(dmr_bs_tx_bb, make)) 41 | 42 | ; 43 | } 44 | -------------------------------------------------------------------------------- /op25/gr-op25_repeater/python/op25_repeater/bindings/docstrings/ambe_encoder_sb_pydoc_template.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2023 Free Software Foundation, Inc. 3 | * 4 | * This file is part of GNU Radio 5 | * 6 | * SPDX-License-Identifier: GPL-3.0-or-later 7 | * 8 | */ 9 | #include "pydoc_macros.h" 10 | #define D(...) DOC(gr, op25_repeater, __VA_ARGS__) 11 | /* 12 | This file contains placeholders for docstrings for the Python bindings. 13 | Do not edit! These were automatically extracted during the binding process 14 | and will be overwritten during the build process 15 | */ 16 | 17 | static const char *__doc_gr_op25_repeater_ambe_encoder_sb = R"doc()doc"; 18 | 19 | static const char *__doc_gr_op25_repeater_ambe_encoder_sb_ambe_encoder_sb = 20 | R"doc()doc"; 21 | 22 | static const char *__doc_gr_op25_repeater_ambe_encoder_sb_make = R"doc()doc"; 23 | 24 | static const char *__doc_gr_op25_repeater_ambe_encoder_sb_set_gain_adjust = 25 | R"doc()doc"; 26 | -------------------------------------------------------------------------------- /op25/gr-op25_repeater/python/op25_repeater/bindings/docstrings/analog_udp_pydoc_template.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2023 Free Software Foundation, Inc. 3 | * 4 | * This file is part of GNU Radio 5 | * 6 | * SPDX-License-Identifier: GPL-3.0-or-later 7 | * 8 | */ 9 | #include "pydoc_macros.h" 10 | #define D(...) DOC(gr, op25_repeater, __VA_ARGS__) 11 | /* 12 | This file contains placeholders for docstrings for the Python bindings. 13 | Do not edit! These were automatically extracted during the binding process 14 | and will be overwritten during the build process 15 | */ 16 | 17 | static const char *__doc_gr_op25_repeater_analog_udp = R"doc()doc"; 18 | 19 | static const char *__doc_gr_op25_repeater_analog_udp_analog_udp = R"doc()doc"; 20 | 21 | static const char *__doc_gr_op25_repeater_analog_udp_make = R"doc()doc"; 22 | 23 | static const char *__doc_gr_op25_repeater_analog_udp_set_debug = R"doc()doc"; 24 | -------------------------------------------------------------------------------- /op25/gr-op25_repeater/python/op25_repeater/bindings/docstrings/costas_loop_cc_pydoc_template.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2023 Free Software Foundation, Inc. 3 | * 4 | * This file is part of GNU Radio 5 | * 6 | * SPDX-License-Identifier: GPL-3.0-or-later 7 | * 8 | */ 9 | #include "pydoc_macros.h" 10 | #define D(...) DOC(gr, op25_repeater, __VA_ARGS__) 11 | /* 12 | This file contains placeholders for docstrings for the Python bindings. 13 | Do not edit! These were automatically extracted during the binding process 14 | and will be overwritten during the build process 15 | */ 16 | 17 | static const char *__doc_gr_op25_repeater_costas_loop_cc = R"doc()doc"; 18 | 19 | static const char *__doc_gr_op25_repeater_costas_loop_cc_costas_loop_cc_0 = 20 | R"doc()doc"; 21 | 22 | static const char *__doc_gr_op25_repeater_costas_loop_cc_costas_loop_cc_1 = 23 | R"doc()doc"; 24 | 25 | static const char *__doc_gr_op25_repeater_costas_loop_cc_make = R"doc()doc"; 26 | 27 | static const char *__doc_gr_op25_repeater_costas_loop_cc_error = R"doc()doc"; 28 | 29 | static const char *__doc_gr_op25_repeater_costas_loop_cc_get_phase = 30 | R"doc()doc"; 31 | 32 | static const char *__doc_gr_op25_repeater_costas_loop_cc_set_frequency = 33 | R"doc()doc"; 34 | 35 | static const char *__doc_gr_op25_repeater_costas_loop_cc_set_phase = 36 | R"doc()doc"; 37 | 38 | static const char *__doc_gr_op25_repeater_costas_loop_cc_set_max_phase = 39 | R"doc()doc"; 40 | -------------------------------------------------------------------------------- /op25/gr-op25_repeater/python/op25_repeater/bindings/docstrings/dmr_bs_tx_bb_pydoc_template.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2023 Free Software Foundation, Inc. 3 | * 4 | * This file is part of GNU Radio 5 | * 6 | * SPDX-License-Identifier: GPL-3.0-or-later 7 | * 8 | */ 9 | #include "pydoc_macros.h" 10 | #define D(...) DOC(gr, op25_repeater, __VA_ARGS__) 11 | /* 12 | This file contains placeholders for docstrings for the Python bindings. 13 | Do not edit! These were automatically extracted during the binding process 14 | and will be overwritten during the build process 15 | */ 16 | 17 | static const char *__doc_gr_op25_repeater_dmr_bs_tx_bb = R"doc()doc"; 18 | 19 | static const char *__doc_gr_op25_repeater_dmr_bs_tx_bb_dmr_bs_tx_bb = 20 | R"doc()doc"; 21 | 22 | static const char *__doc_gr_op25_repeater_dmr_bs_tx_bb_make = R"doc()doc"; 23 | -------------------------------------------------------------------------------- /op25/gr-op25_repeater/python/op25_repeater/bindings/docstrings/dstar_tx_sb_pydoc_template.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2023 Free Software Foundation, Inc. 3 | * 4 | * This file is part of GNU Radio 5 | * 6 | * SPDX-License-Identifier: GPL-3.0-or-later 7 | * 8 | */ 9 | #include "pydoc_macros.h" 10 | #define D(...) DOC(gr, op25_repeater, __VA_ARGS__) 11 | /* 12 | This file contains placeholders for docstrings for the Python bindings. 13 | Do not edit! These were automatically extracted during the binding process 14 | and will be overwritten during the build process 15 | */ 16 | 17 | static const char *__doc_gr_op25_repeater_dstar_tx_sb = R"doc()doc"; 18 | 19 | static const char *__doc_gr_op25_repeater_dstar_tx_sb_dstar_tx_sb = R"doc()doc"; 20 | 21 | static const char *__doc_gr_op25_repeater_dstar_tx_sb_make = R"doc()doc"; 22 | 23 | static const char *__doc_gr_op25_repeater_dstar_tx_sb_set_gain_adjust = 24 | R"doc()doc"; 25 | -------------------------------------------------------------------------------- /op25/gr-op25_repeater/python/op25_repeater/bindings/docstrings/frame_assembler_pydoc_template.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2023 Free Software Foundation, Inc. 3 | * 4 | * This file is part of GNU Radio 5 | * 6 | * SPDX-License-Identifier: GPL-3.0-or-later 7 | * 8 | */ 9 | #include "pydoc_macros.h" 10 | #define D(...) DOC(gr, op25_repeater, __VA_ARGS__) 11 | /* 12 | This file contains placeholders for docstrings for the Python bindings. 13 | Do not edit! These were automatically extracted during the binding process 14 | and will be overwritten during the build process 15 | */ 16 | 17 | static const char *__doc_gr_op25_repeater_frame_assembler = R"doc()doc"; 18 | 19 | static const char *__doc_gr_op25_repeater_frame_assembler_frame_assembler = 20 | R"doc()doc"; 21 | 22 | static const char *__doc_gr_op25_repeater_frame_assembler_make = R"doc()doc"; 23 | 24 | static const char *__doc_gr_op25_repeater_frame_assembler_set_debug = 25 | R"doc()doc"; 26 | 27 | static const char *__doc_gr_op25_repeater_frame_assembler_control = R"doc()doc"; 28 | -------------------------------------------------------------------------------- /op25/gr-op25_repeater/python/op25_repeater/bindings/docstrings/fsk4_slicer_fb_pydoc_template.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2023 Free Software Foundation, Inc. 3 | * 4 | * This file is part of GNU Radio 5 | * 6 | * SPDX-License-Identifier: GPL-3.0-or-later 7 | * 8 | */ 9 | #include "pydoc_macros.h" 10 | #define D(...) DOC(gr, op25_repeater, __VA_ARGS__) 11 | /* 12 | This file contains placeholders for docstrings for the Python bindings. 13 | Do not edit! These were automatically extracted during the binding process 14 | and will be overwritten during the build process 15 | */ 16 | 17 | static const char *__doc_gr_op25_repeater_fsk4_slicer_fb = R"doc()doc"; 18 | 19 | static const char *__doc_gr_op25_repeater_fsk4_slicer_fb_fsk4_slicer_fb = 20 | R"doc()doc"; 21 | 22 | static const char *__doc_gr_op25_repeater_fsk4_slicer_fb_make = R"doc()doc"; 23 | 24 | static const char *__doc_gr_op25_repeater_fsk4_slicer_fb_set_debug = 25 | R"doc()doc"; 26 | -------------------------------------------------------------------------------- /op25/gr-op25_repeater/python/op25_repeater/bindings/docstrings/gardner_cc_pydoc_template.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2023 Free Software Foundation, Inc. 3 | * 4 | * This file is part of GNU Radio 5 | * 6 | * SPDX-License-Identifier: GPL-3.0-or-later 7 | * 8 | */ 9 | #include "pydoc_macros.h" 10 | #define D(...) DOC(gr, op25_repeater, __VA_ARGS__) 11 | /* 12 | This file contains placeholders for docstrings for the Python bindings. 13 | Do not edit! These were automatically extracted during the binding process 14 | and will be overwritten during the build process 15 | */ 16 | 17 | static const char *__doc_gr_op25_repeater_gardner_cc = R"doc()doc"; 18 | 19 | static const char *__doc_gr_op25_repeater_gardner_cc_gardner_cc = R"doc()doc"; 20 | 21 | static const char *__doc_gr_op25_repeater_gardner_cc_make = R"doc()doc"; 22 | 23 | static const char *__doc_gr_op25_repeater_gardner_cc_set_omega = R"doc()doc"; 24 | 25 | static const char *__doc_gr_op25_repeater_gardner_cc_reset = R"doc()doc"; 26 | 27 | static const char *__doc_gr_op25_repeater_gardner_cc_locked = R"doc()doc"; 28 | 29 | static const char *__doc_gr_op25_repeater_gardner_cc_quality = R"doc()doc"; 30 | -------------------------------------------------------------------------------- /op25/gr-op25_repeater/python/op25_repeater/bindings/docstrings/iqfile_source_pydoc_template.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2023 Free Software Foundation, Inc. 3 | * 4 | * This file is part of GNU Radio 5 | * 6 | * SPDX-License-Identifier: GPL-3.0-or-later 7 | * 8 | */ 9 | #include "pydoc_macros.h" 10 | #define D(...) DOC(gr, op25_repeater, __VA_ARGS__) 11 | /* 12 | This file contains placeholders for docstrings for the Python bindings. 13 | Do not edit! These were automatically extracted during the binding process 14 | and will be overwritten during the build process 15 | */ 16 | 17 | static const char *__doc_gr_op25_repeater_iqfile_source = R"doc()doc"; 18 | 19 | static const char *__doc_gr_op25_repeater_iqfile_source_iqfile_source_0 = 20 | R"doc()doc"; 21 | 22 | static const char *__doc_gr_op25_repeater_iqfile_source_iqfile_source_1 = 23 | R"doc()doc"; 24 | 25 | static const char *__doc_gr_op25_repeater_iqfile_source_make = R"doc()doc"; 26 | 27 | static const char *__doc_gr_op25_repeater_iqfile_source_seek = R"doc()doc"; 28 | 29 | static const char *__doc_gr_op25_repeater_iqfile_source_open = R"doc()doc"; 30 | 31 | static const char *__doc_gr_op25_repeater_iqfile_source_close = R"doc()doc"; 32 | 33 | static const char *__doc_gr_op25_repeater_iqfile_source_set_begin_tag = 34 | R"doc()doc"; 35 | 36 | static const char *__doc_gr_op25_repeater_iqfile_source_is_dsd = R"doc()doc"; 37 | 38 | static const char *__doc_gr_op25_repeater_iqfile_source_get_dsd_rate = 39 | R"doc()doc"; 40 | 41 | static const char *__doc_gr_op25_repeater_iqfile_source_get_dsd_freq = 42 | R"doc()doc"; 43 | 44 | static const char *__doc_gr_op25_repeater_iqfile_source_get_dsd_ts = 45 | R"doc()doc"; 46 | -------------------------------------------------------------------------------- /op25/gr-op25_repeater/python/op25_repeater/bindings/docstrings/p25_frame_assembler_pydoc_template.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2023 Free Software Foundation, Inc. 3 | * 4 | * This file is part of GNU Radio 5 | * 6 | * SPDX-License-Identifier: GPL-3.0-or-later 7 | * 8 | */ 9 | #include "pydoc_macros.h" 10 | #define D(...) DOC(gr, op25_repeater, __VA_ARGS__) 11 | /* 12 | This file contains placeholders for docstrings for the Python bindings. 13 | Do not edit! These were automatically extracted during the binding process 14 | and will be overwritten during the build process 15 | */ 16 | 17 | static const char *__doc_gr_op25_repeater_p25_frame_assembler = R"doc()doc"; 18 | 19 | static const char 20 | *__doc_gr_op25_repeater_p25_frame_assembler_p25_frame_assembler = 21 | R"doc()doc"; 22 | 23 | static const char *__doc_gr_op25_repeater_p25_frame_assembler_make = 24 | R"doc()doc"; 25 | 26 | static const char *__doc_gr_op25_repeater_p25_frame_assembler_set_debug = 27 | R"doc()doc"; 28 | 29 | static const char *__doc_gr_op25_repeater_p25_frame_assembler_control = 30 | R"doc()doc"; 31 | -------------------------------------------------------------------------------- /op25/gr-op25_repeater/python/op25_repeater/bindings/docstrings/rmsagc_ff_pydoc_template.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2023 Free Software Foundation, Inc. 3 | * 4 | * This file is part of GNU Radio 5 | * 6 | * SPDX-License-Identifier: GPL-3.0-or-later 7 | * 8 | */ 9 | #include "pydoc_macros.h" 10 | #define D(...) DOC(gr, op25_repeater, __VA_ARGS__) 11 | /* 12 | This file contains placeholders for docstrings for the Python bindings. 13 | Do not edit! These were automatically extracted during the binding process 14 | and will be overwritten during the build process 15 | */ 16 | 17 | static const char *__doc_gr_op25_repeater_rmsagc_ff = R"doc()doc"; 18 | 19 | static const char *__doc_gr_op25_repeater_rmsagc_ff_rmsagc_ff_0 = R"doc()doc"; 20 | 21 | static const char *__doc_gr_op25_repeater_rmsagc_ff_rmsagc_ff_1 = R"doc()doc"; 22 | 23 | static const char *__doc_gr_op25_repeater_rmsagc_ff_make = R"doc()doc"; 24 | 25 | static const char *__doc_gr_op25_repeater_rmsagc_ff_set_alpha = R"doc()doc"; 26 | 27 | static const char *__doc_gr_op25_repeater_rmsagc_ff_set_k = R"doc()doc"; 28 | -------------------------------------------------------------------------------- /op25/gr-op25_repeater/python/op25_repeater/bindings/docstrings/vocoder_pydoc_template.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2023 Free Software Foundation, Inc. 3 | * 4 | * This file is part of GNU Radio 5 | * 6 | * SPDX-License-Identifier: GPL-3.0-or-later 7 | * 8 | */ 9 | #include "pydoc_macros.h" 10 | #define D(...) DOC(gr, op25_repeater, __VA_ARGS__) 11 | /* 12 | This file contains placeholders for docstrings for the Python bindings. 13 | Do not edit! These were automatically extracted during the binding process 14 | and will be overwritten during the build process 15 | */ 16 | 17 | static const char *__doc_gr_op25_repeater_vocoder = R"doc()doc"; 18 | 19 | static const char *__doc_gr_op25_repeater_vocoder_vocoder = R"doc()doc"; 20 | 21 | static const char *__doc_gr_op25_repeater_vocoder_make = R"doc()doc"; 22 | 23 | static const char *__doc_gr_op25_repeater_vocoder_set_gain_adjust = R"doc()doc"; 24 | -------------------------------------------------------------------------------- /op25/gr-op25_repeater/python/op25_repeater/bindings/docstrings/ysf_tx_sb_pydoc_template.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2023 Free Software Foundation, Inc. 3 | * 4 | * This file is part of GNU Radio 5 | * 6 | * SPDX-License-Identifier: GPL-3.0-or-later 7 | * 8 | */ 9 | #include "pydoc_macros.h" 10 | #define D(...) DOC(gr, op25_repeater, __VA_ARGS__) 11 | /* 12 | This file contains placeholders for docstrings for the Python bindings. 13 | Do not edit! These were automatically extracted during the binding process 14 | and will be overwritten during the build process 15 | */ 16 | 17 | static const char *__doc_gr_op25_repeater_ysf_tx_sb = R"doc()doc"; 18 | 19 | static const char *__doc_gr_op25_repeater_ysf_tx_sb_ysf_tx_sb = R"doc()doc"; 20 | 21 | static const char *__doc_gr_op25_repeater_ysf_tx_sb_make = R"doc()doc"; 22 | 23 | static const char *__doc_gr_op25_repeater_ysf_tx_sb_set_gain_adjust = 24 | R"doc()doc"; 25 | -------------------------------------------------------------------------------- /op25/gr-op25_repeater/python/op25_repeater/bindings/dstar_tx_sb_python.cc: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2023 Free Software Foundation, Inc. 3 | * 4 | * This file is part of GNU Radio 5 | * 6 | * SPDX-License-Identifier: GPL-3.0-or-later 7 | * 8 | */ 9 | 10 | /***********************************************************************************/ 11 | /* This file is automatically generated using bindtool and can be manually 12 | * edited */ 13 | /* The following lines can be configured to regenerate this file during cmake */ 14 | /* If manual edits are made, the following tags should be modified accordingly. 15 | */ 16 | /* BINDTOOL_GEN_AUTOMATIC(0) */ 17 | /* BINDTOOL_USE_PYGCCXML(0) */ 18 | /* BINDTOOL_HEADER_FILE(dstar_tx_sb.h) */ 19 | /* BINDTOOL_HEADER_FILE_HASH(15a53983d26e3470e692a851c0bb76bb) */ 20 | /***********************************************************************************/ 21 | 22 | #include 23 | #include 24 | #include 25 | 26 | namespace py = pybind11; 27 | 28 | #include 29 | // pydoc.h is automatically generated in the build directory 30 | #include 31 | 32 | void bind_dstar_tx_sb(py::module &m) { 33 | 34 | using dstar_tx_sb = ::gr::op25_repeater::dstar_tx_sb; 35 | 36 | py::class_>(m, "dstar_tx_sb", D(dstar_tx_sb)) 38 | 39 | .def(py::init(&dstar_tx_sb::make), py::arg("versbose_flag"), 40 | py::arg("conf_file"), D(dstar_tx_sb, make)) 41 | 42 | .def("set_gain_adjust", &dstar_tx_sb::set_gain_adjust, 43 | py::arg("gain_adjust"), D(dstar_tx_sb, set_gain_adjust)) 44 | 45 | ; 46 | } 47 | -------------------------------------------------------------------------------- /op25/gr-op25_repeater/python/op25_repeater/bindings/rmsagc_ff_python.cc: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2023 Free Software Foundation, Inc. 3 | * 4 | * This file is part of GNU Radio 5 | * 6 | * SPDX-License-Identifier: GPL-3.0-or-later 7 | * 8 | */ 9 | 10 | /***********************************************************************************/ 11 | /* This file is automatically generated using bindtool and can be manually 12 | * edited */ 13 | /* The following lines can be configured to regenerate this file during cmake */ 14 | /* If manual edits are made, the following tags should be modified accordingly. 15 | */ 16 | /* BINDTOOL_GEN_AUTOMATIC(0) */ 17 | /* BINDTOOL_USE_PYGCCXML(0) */ 18 | /* BINDTOOL_HEADER_FILE(rmsagc_ff.h) */ 19 | /* BINDTOOL_HEADER_FILE_HASH(b7e9da846151ace63502dc857ca72b85) */ 20 | /***********************************************************************************/ 21 | 22 | #include 23 | #include 24 | #include 25 | 26 | namespace py = pybind11; 27 | 28 | #include 29 | // pydoc.h is automatically generated in the build directory 30 | #include 31 | 32 | void bind_rmsagc_ff(py::module &m) { 33 | 34 | using rmsagc_ff = ::gr::op25_repeater::rmsagc_ff; 35 | 36 | py::class_>(m, "rmsagc_ff", D(rmsagc_ff)) 38 | 39 | .def(py::init(&rmsagc_ff::make), py::arg("alpha") = 0.01, 40 | py::arg("k") = 1., D(rmsagc_ff, make)) 41 | 42 | .def("set_alpha", &rmsagc_ff::set_alpha, py::arg("alpha"), 43 | D(rmsagc_ff, set_alpha)) 44 | 45 | .def("set_k", &rmsagc_ff::set_k, py::arg("k"), D(rmsagc_ff, set_k)) 46 | 47 | ; 48 | } 49 | -------------------------------------------------------------------------------- /op25/gr-op25_repeater/python/op25_repeater/bindings/vocoder_python.cc: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2023 Free Software Foundation, Inc. 3 | * 4 | * This file is part of GNU Radio 5 | * 6 | * SPDX-License-Identifier: GPL-3.0-or-later 7 | * 8 | */ 9 | 10 | /***********************************************************************************/ 11 | /* This file is automatically generated using bindtool and can be manually 12 | * edited */ 13 | /* The following lines can be configured to regenerate this file during cmake */ 14 | /* If manual edits are made, the following tags should be modified accordingly. 15 | */ 16 | /* BINDTOOL_GEN_AUTOMATIC(0) */ 17 | /* BINDTOOL_USE_PYGCCXML(0) */ 18 | /* BINDTOOL_HEADER_FILE(vocoder.h) */ 19 | /* BINDTOOL_HEADER_FILE_HASH(6f5e665b6482d7f4d3874d01016ca78f) */ 20 | /***********************************************************************************/ 21 | 22 | #include 23 | #include 24 | #include 25 | 26 | namespace py = pybind11; 27 | 28 | #include 29 | // pydoc.h is automatically generated in the build directory 30 | #include 31 | 32 | void bind_vocoder(py::module &m) { 33 | 34 | using vocoder = ::gr::op25_repeater::vocoder; 35 | 36 | py::class_>( 37 | m, "vocoder", D(vocoder)) 38 | 39 | .def(py::init(&vocoder::make), py::arg("encode_flag"), 40 | py::arg("verbose_flag"), py::arg("stretch_amt"), py::arg("udp_host"), 41 | py::arg("udp_port"), py::arg("raw_vectors_flag"), D(vocoder, make)) 42 | 43 | .def("set_gain_adjust", &vocoder::set_gain_adjust, py::arg("gain_adjust"), 44 | D(vocoder, set_gain_adjust)) 45 | 46 | ; 47 | } 48 | -------------------------------------------------------------------------------- /op25/gr-op25_repeater/python/op25_repeater/bindings/ysf_tx_sb_python.cc: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2023 Free Software Foundation, Inc. 3 | * 4 | * This file is part of GNU Radio 5 | * 6 | * SPDX-License-Identifier: GPL-3.0-or-later 7 | * 8 | */ 9 | 10 | /***********************************************************************************/ 11 | /* This file is automatically generated using bindtool and can be manually 12 | * edited */ 13 | /* The following lines can be configured to regenerate this file during cmake */ 14 | /* If manual edits are made, the following tags should be modified accordingly. 15 | */ 16 | /* BINDTOOL_GEN_AUTOMATIC(0) */ 17 | /* BINDTOOL_USE_PYGCCXML(0) */ 18 | /* BINDTOOL_HEADER_FILE(ysf_tx_sb.h) */ 19 | /* BINDTOOL_HEADER_FILE_HASH(3f99637b436cc582b9fa2b53f49be741) */ 20 | /***********************************************************************************/ 21 | 22 | #include 23 | #include 24 | #include 25 | 26 | namespace py = pybind11; 27 | 28 | #include 29 | // pydoc.h is automatically generated in the build directory 30 | #include 31 | 32 | void bind_ysf_tx_sb(py::module &m) { 33 | 34 | using ysf_tx_sb = ::gr::op25_repeater::ysf_tx_sb; 35 | 36 | py::class_>( 37 | m, "ysf_tx_sb", D(ysf_tx_sb)) 38 | 39 | .def(py::init(&ysf_tx_sb::make), py::arg("versbose_flag"), 40 | py::arg("conf_file"), py::arg("fullrate_mode"), D(ysf_tx_sb, make)) 41 | 42 | .def("set_gain_adjust", &ysf_tx_sb::set_gain_adjust, 43 | py::arg("gain_adjust"), D(ysf_tx_sb, set_gain_adjust)) 44 | 45 | ; 46 | } 47 | -------------------------------------------------------------------------------- /op25/gr-op25_repeater/python/op25_repeater/build_utils_codes.py: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2004 Free Software Foundation, Inc. 3 | # 4 | # This file is part of GNU Radio 5 | # 6 | # GNU Radio is free software; you can redistribute it and/or modify 7 | # it under the terms of the GNU General Public License as published by 8 | # the Free Software Foundation; either version 3, or (at your option) 9 | # any later version. 10 | # 11 | # GNU Radio is distributed in the hope that it will be useful, 12 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | # GNU General Public License for more details. 15 | # 16 | # You should have received a copy of the GNU General Public License 17 | # along with GNU Radio; see the file COPYING. If not, write to 18 | # the Free Software Foundation, Inc., 51 Franklin Street, 19 | # Boston, MA 02110-1301, USA. 20 | # 21 | 22 | def i_code (code3): 23 | return code3[0] 24 | 25 | def o_code (code3): 26 | if len (code3) >= 2: 27 | return code3[1] 28 | else: 29 | return code3[0] 30 | 31 | def tap_code (code3): 32 | if len (code3) >= 3: 33 | return code3[2] 34 | else: 35 | return code3[0] 36 | 37 | def i_type (code3): 38 | return char_to_type[i_code (code3)] 39 | 40 | def o_type (code3): 41 | return char_to_type[o_code (code3)] 42 | 43 | def tap_type (code3): 44 | return char_to_type[tap_code (code3)] 45 | 46 | 47 | char_to_type = {} 48 | char_to_type['s'] = 'short' 49 | char_to_type['i'] = 'int' 50 | char_to_type['f'] = 'float' 51 | char_to_type['c'] = 'gr_complex' 52 | char_to_type['b'] = 'unsigned char' 53 | -------------------------------------------------------------------------------- /op25/gr-op25_repeater/python/op25_repeater/qa_fsk4_slicer_fb.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | # -*- coding: utf-8 -*- 3 | # 4 | # Copyright 2013 <+YOU OR YOUR COMPANY+>. 5 | # 6 | # This is free software; you can redistribute it and/or modify 7 | # it under the terms of the GNU General Public License as published by 8 | # the Free Software Foundation; either version 3, or (at your option) 9 | # any later version. 10 | # 11 | # This software is distributed in the hope that it will be useful, 12 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | # GNU General Public License for more details. 15 | # 16 | # You should have received a copy of the GNU General Public License 17 | # along with this software; see the file COPYING. If not, write to 18 | # the Free Software Foundation, Inc., 51 Franklin Street, 19 | # Boston, MA 02110-1301, USA. 20 | # 21 | 22 | from gnuradio import gr, gr_unittest 23 | import op25_repeater_python as op25_repeater 24 | 25 | class qa_fsk4_slicer_fb (gr_unittest.TestCase): 26 | 27 | def setUp (self): 28 | self.tb = gr.top_block () 29 | 30 | def tearDown (self): 31 | self.tb = None 32 | 33 | def test_001_t (self): 34 | # set up fg 35 | self.tb.run () 36 | # check data 37 | 38 | 39 | if __name__ == '__main__': 40 | gr_unittest.run(qa_fsk4_slicer_fb, "qa_fsk4_slicer_fb.xml") 41 | -------------------------------------------------------------------------------- /op25/gr-op25_repeater/python/op25_repeater/qa_gardner_costas_cc.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | # -*- coding: utf-8 -*- 3 | # 4 | # Copyright 2013 <+YOU OR YOUR COMPANY+>. 5 | # 6 | # This is free software; you can redistribute it and/or modify 7 | # it under the terms of the GNU General Public License as published by 8 | # the Free Software Foundation; either version 3, or (at your option) 9 | # any later version. 10 | # 11 | # This software is distributed in the hope that it will be useful, 12 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | # GNU General Public License for more details. 15 | # 16 | # You should have received a copy of the GNU General Public License 17 | # along with this software; see the file COPYING. If not, write to 18 | # the Free Software Foundation, Inc., 51 Franklin Street, 19 | # Boston, MA 02110-1301, USA. 20 | # 21 | 22 | from gnuradio import gr, gr_unittest 23 | import op25_repeater_python as op25_repeater 24 | 25 | class qa_gardner_costas_cc (gr_unittest.TestCase): 26 | 27 | def setUp (self): 28 | self.tb = gr.top_block () 29 | 30 | def tearDown (self): 31 | self.tb = None 32 | 33 | def test_001_t (self): 34 | # set up fg 35 | self.tb.run () 36 | # check data 37 | 38 | 39 | if __name__ == '__main__': 40 | gr_unittest.run(qa_gardner_costas_cc, "qa_gardner_costas_cc.xml") 41 | -------------------------------------------------------------------------------- /op25/gr-op25_repeater/python/op25_repeater/qa_p25_frame_assembler.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | # -*- coding: utf-8 -*- 3 | # 4 | # Copyright 2013 <+YOU OR YOUR COMPANY+>. 5 | # 6 | # This is free software; you can redistribute it and/or modify 7 | # it under the terms of the GNU General Public License as published by 8 | # the Free Software Foundation; either version 3, or (at your option) 9 | # any later version. 10 | # 11 | # This software is distributed in the hope that it will be useful, 12 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | # GNU General Public License for more details. 15 | # 16 | # You should have received a copy of the GNU General Public License 17 | # along with this software; see the file COPYING. If not, write to 18 | # the Free Software Foundation, Inc., 51 Franklin Street, 19 | # Boston, MA 02110-1301, USA. 20 | # 21 | 22 | from gnuradio import gr, gr_unittest 23 | import op25_repeater_python as op25_repeater 24 | 25 | class qa_p25_frame_assembler (gr_unittest.TestCase): 26 | 27 | def setUp (self): 28 | self.tb = gr.top_block () 29 | 30 | def tearDown (self): 31 | self.tb = None 32 | 33 | def test_001_t (self): 34 | # set up fg 35 | self.tb.run () 36 | # check data 37 | 38 | 39 | if __name__ == '__main__': 40 | gr_unittest.run(qa_p25_frame_assembler, "qa_p25_frame_assembler.xml") 41 | -------------------------------------------------------------------------------- /op25/gr-op25_repeater/python/op25_repeater/qa_vocoder.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | # -*- coding: utf-8 -*- 3 | # 4 | # Copyright 2013 <+YOU OR YOUR COMPANY+>. 5 | # 6 | # This is free software; you can redistribute it and/or modify 7 | # it under the terms of the GNU General Public License as published by 8 | # the Free Software Foundation; either version 3, or (at your option) 9 | # any later version. 10 | # 11 | # This software is distributed in the hope that it will be useful, 12 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | # GNU General Public License for more details. 15 | # 16 | # You should have received a copy of the GNU General Public License 17 | # along with this software; see the file COPYING. If not, write to 18 | # the Free Software Foundation, Inc., 51 Franklin Street, 19 | # Boston, MA 02110-1301, USA. 20 | # 21 | 22 | from gnuradio import gr, gr_unittest 23 | import op25_repeater_python as op25_repeater 24 | 25 | class qa_vocoder (gr_unittest.TestCase): 26 | 27 | def setUp (self): 28 | self.tb = gr.top_block () 29 | 30 | def tearDown (self): 31 | self.tb = None 32 | 33 | def test_001_t (self): 34 | # set up fg 35 | self.tb.run () 36 | # check data 37 | 38 | 39 | if __name__ == '__main__': 40 | gr_unittest.run(qa_vocoder, "qa_vocoder.xml") 41 | -------------------------------------------------------------------------------- /op25/gr-op25_repeater/www/images/.gitignore: -------------------------------------------------------------------------------- 1 | # Untracked files 2 | plot-* 3 | -------------------------------------------------------------------------------- /op25/gr-op25_repeater/www/images/1x1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/boatbod/op25/35f7e7474b7ecf25c4e8d93f20a58a8d132639a9/op25/gr-op25_repeater/www/images/1x1.png -------------------------------------------------------------------------------- /op25/gr-op25_repeater/www/www-static/config.js: -------------------------------------------------------------------------------- 1 | // Copyright 2017, 2018 Max H. Parke KA1RBI 2 | // Copyright 2018, 2019, 2020, 2021 gnorbury@bondcar.com 3 | // JavaScript UI Updates, Michael Rose, 2025 4 | // 5 | // This file is part of OP25 6 | // 7 | // OP25 is free software; you can redistribute it and/or modify it 8 | // under the terms of the GNU General Public License as published by 9 | // the Free Software Foundation; either version 3, or (at your option) 10 | // any later version. 11 | // 12 | // OP25 is distributed in the hope that it will be useful, but WITHOUT 13 | // ANY WARRANTY; without even the implied warranty of MERCHANTABILITY 14 | // or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public 15 | // License for more details. 16 | // 17 | // You should have received a copy of the GNU General Public License 18 | // along with OP25; see the file COPYING. If not, write to the Free 19 | // Software Foundation, Inc., 51 Franklin Street, Boston, MA 20 | // 02110-1301, USA. 21 | 22 | // config.js is deprecated - 27-APR-2025 23 | 24 | -------------------------------------------------------------------------------- /op25/gr-op25_repeater/www/www-static/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/boatbod/op25/35f7e7474b7ecf25c4e8d93f20a58a8d132639a9/op25/gr-op25_repeater/www/www-static/favicon.ico -------------------------------------------------------------------------------- /parseheader_generic.py.patch: -------------------------------------------------------------------------------- 1 | --- parseheader_generic.py 2023-01-28 21:16:40.804833423 -0500 2 | +++ parseheader_generic.py.fix 2023-01-28 21:10:32.909996468 -0500 3 | @@ -321,7 +321,7 @@ 4 | compiler='gcc', 5 | undefine_symbols=['__PIE__'], 6 | define_symbols=self.define_symbols, 7 | - cflags='-std=c++17 -fPIC') 8 | + cflags='-std=c++17 -fPIC -fsized-deallocation') 9 | decls = parser.parse( 10 | [self.target_file], xml_generator_config, 11 | compilation_mode=parser.COMPILATION_MODE.ALL_AT_ONCE) 12 | -------------------------------------------------------------------------------- /rebuild.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | usage() 4 | { 5 | echo "Usage: $0 [-d|-r]" 6 | echo " -d Debug build" 7 | echo " -r Release build (default)" 8 | exit 2 9 | } 10 | 11 | BUILD_TYPE="" 12 | while getopts 'dr?h' c 13 | do 14 | case $c in 15 | d) BUILD_TYPE="-DCMAKE_BUILD_TYPE=Debug" ;; 16 | r) BUILD_TYPE="-DCMAKE_BUILD_TYPE=Release" ;; 17 | h|?) usage ;; 18 | esac 19 | done 20 | 21 | git pull 22 | cd build 23 | rm -rf * 24 | cmake ../ $BUILD_TYPE 2>&1 | tee cmake.log 25 | make 2>&1 | tee make.log 26 | sudo make install 2>&1 | tee install.log 27 | sudo ldconfig 28 | -------------------------------------------------------------------------------- /update-rtlsdr.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/bash 2 | 3 | # 4 | # Script to update librtlsdr0 driver to the latest version 5 | # for compatibility with RTL-SDR Blog V4 hardware 6 | # 7 | 8 | # Script has no error checking, so if it blows up it may not 9 | # fail gracefully and may leave your system in an unknown state 10 | # Use at your own risk! 11 | 12 | # First install required support tools 13 | sudo apt update 14 | sudo apt -y install libusb-1.0-0-dev debhelper 15 | # Get latest RTL-SDR driver source 16 | mkdir update-rtlsdr 17 | cd update-rtlsdr 18 | git clone https://github.com/rtlsdrblog/rtl-sdr-blog 19 | # Build the packages 20 | cd rtl-sdr-blog 21 | libtoolize 22 | autoreconf -i 23 | dpkg-buildpackage -b --no-sign 24 | cd .. 25 | # Install the packages 26 | sudo dpkg -i librtlsdr0_*.deb 27 | sudo dpkg -i librtlsdr-dev_*.deb 28 | sudo dpkg -i rtl-sdr_*.deb 29 | cd .. 30 | # Clean up 31 | rm -rf update-rtlsdr 32 | --------------------------------------------------------------------------------