stating gr-cariboulite

bug_fixes_integration_tx
David Michaeli 2022-04-24 22:20:41 +03:00
rodzic ebdba93510
commit 1c7e6abd2e
44 zmienionych plików z 7336 dodań i 0 usunięć

Wyświetl plik

@ -0,0 +1,62 @@
# Copyright 2011-2021 Free Software Foundation, Inc.
#
# This file is part of GNU Radio
#
# SPDX-License-Identifier: GPL-3.0-or-later
#
########################################################################
# Setup dependencies
########################################################################
########################################################################
# External dependencies
########################################################################
find_package(CaribouLite 1.0)
########################################################################
# Register component
########################################################################
include(GrComponent)
GR_REGISTER_COMPONENT("gr-cariboulite" ENABLE_GR_CARIBOULITE
CARIBOULITE_FOUND
ENABLE_GNURADIO_RUNTIME
)
SET(GR_PKG_CARIBOULITE_EXAMPLES_DIR ${GR_PKG_DATA_DIR}/examples/cariboulite)
########################################################################
# Begin conditional configuration
########################################################################
if(ENABLE_GR_CARIBOULITE)
message(STATUS " CariobouLite Version: ${CaribouLite_VERSION}")
########################################################################
# Add subdirectories
########################################################################
add_subdirectory(include/gnuradio/cariboulite)
add_subdirectory(lib)
add_subdirectory(docs)
if(ENABLE_PYTHON)
add_subdirectory(python/cariboulite)
if(ENABLE_EXAMPLES)
add_subdirectory(examples/grc)
endif(ENABLE_EXAMPLES)
endif(ENABLE_PYTHON)
if(ENABLE_GRC)
add_subdirectory(grc)
endif(ENABLE_GRC)
########################################################################
# Create Pkg Config File
########################################################################
configure_file(
${CMAKE_CURRENT_SOURCE_DIR}/gnuradio-cariboulite.pc.in
${CMAKE_CURRENT_BINARY_DIR}/gnuradio-cariboulite.pc
@ONLY)
install(
FILES ${CMAKE_CURRENT_BINARY_DIR}/gnuradio-cariboulite.pc
DESTINATION ${GR_LIBRARY_DIR}/pkgconfig
)
endif(ENABLE_GR_CARIBOULITE)

Wyświetl plik

@ -0,0 +1,11 @@
# Copyright 2011 Free Software Foundation, Inc.
#
# This file is part of GNU Radio
#
# SPDX-License-Identifier: GPL-3.0-or-later
#
install(
FILES README.cariboulite
DESTINATION ${GR_PKG_DOC_DIR}
)

Wyświetl plik

@ -0,0 +1,13 @@
This is the gr-cariboulite package. It is interfaces to the CaribouLite
library, which supports driver modules for many types of SDR hardware.
The Python namespace is in gnuradio.cariboulite, which would be normally
imported as:
from gnuradio import cariboulite
See the Doxygen documentation for details about the blocks available
in this package. A quick listing of the details can be found in Python
after importing by using:
help(cariboulite)

Wyświetl plik

@ -0,0 +1,16 @@
# Copyright 2012-2021 Free Software Foundation, Inc.
#
# This file is part of GNU Radio
#
# SPDX-License-Identifier: GPL-3.0-or-later
#
install(
FILES
fm_radio_receiver_soapy.grc
fm_radio_receiver_soapyremote.grc
soapy_receive2.grc
soapy_receive.grc
soapy_transmit.grc
DESTINATION ${GR_PKG_SOAPY_EXAMPLES_DIR}
)

Wyświetl plik

@ -0,0 +1,530 @@
options:
parameters:
author: ''
catch_exceptions: 'True'
category: '[GRC Hier Blocks]'
cmake_opt: ''
comment: ''
copyright: ''
description: ''
gen_cmake: 'On'
gen_linking: dynamic
generate_options: qt_gui
hier_block_src_path: '.:'
id: fm_radio_receiver_soapy
max_nouts: '0'
output_language: python
placement: (0,0)
qt_qss_theme: ''
realtime_scheduling: ''
run: 'True'
run_command: '{python} -u {filename}'
run_options: prompt
sizing_mode: fixed
thread_safe_setters: ''
title: ''
states:
bus_sink: false
bus_source: false
bus_structure: null
coordinate: [8, 8]
rotation: 0
state: enabled
blocks:
- name: antenna
id: variable
parameters:
comment: ''
value: '"RX"'
states:
bus_sink: false
bus_source: false
bus_structure: null
coordinate: [240, 172.0]
rotation: 0
state: enabled
- name: audio_rate
id: variable
parameters:
comment: ''
value: '48000'
states:
bus_sink: false
bus_source: false
bus_structure: null
coordinate: [240, 92.0]
rotation: 0
state: enabled
- name: gain
id: variable_qtgui_range
parameters:
comment: ''
gui_hint: 1,3,1,3
label: Gain
min_len: '200'
orient: QtCore.Qt.Horizontal
rangeType: float
start: '0'
step: '2'
stop: '60'
value: '6'
widget: counter_slider
states:
bus_sink: false
bus_source: false
bus_structure: null
coordinate: [784, 8.0]
rotation: 0
state: enabled
- name: radio_freq
id: variable_qtgui_entry
parameters:
comment: ''
gui_hint: 0,0,1,3
label: Center Frequency
type: real
value: 99.5e6
states:
bus_sink: false
bus_source: false
bus_structure: null
coordinate: [368, 16.0]
rotation: 0
state: enabled
- name: samp_rate
id: variable
parameters:
comment: ''
value: 2.5e6
states:
bus_sink: false
bus_source: false
bus_structure: null
coordinate: [240, 12.0]
rotation: 0
state: enabled
- name: vol
id: variable_qtgui_range
parameters:
comment: ''
gui_hint: 0,3,1,3
label: Volume
min_len: '200'
orient: QtCore.Qt.Horizontal
rangeType: float
start: '0'
step: '0.05'
stop: '1.5'
value: '0.3'
widget: counter_slider
states:
bus_sink: false
bus_source: false
bus_structure: null
coordinate: [592, 8.0]
rotation: 0
state: enabled
- name: analog_wfm_rcv_0
id: analog_wfm_rcv
parameters:
affinity: ''
alias: ''
audio_decimation: '2'
comment: Quadrature rate is the input rate
maxoutbuf: '0'
minoutbuf: '0'
quad_rate: audio_rate
states:
bus_sink: false
bus_source: false
bus_structure: null
coordinate: [896, 404.0]
rotation: 180
state: enabled
- name: audio_sink_0
id: audio_sink
parameters:
affinity: ''
alias: ''
comment: ''
device_name: ''
num_inputs: '1'
ok_to_block: 'True'
samp_rate: audio_rate
states:
bus_sink: false
bus_source: false
bus_structure: null
coordinate: [880, 588.0]
rotation: 180
state: enabled
- name: blocks_multiply_const_vxx_0
id: blocks_multiply_const_vxx
parameters:
affinity: ''
alias: ''
comment: ''
const: vol
maxoutbuf: '0'
minoutbuf: '0'
type: float
vlen: '1'
states:
bus_sink: false
bus_source: false
bus_structure: null
coordinate: [896, 524.0]
rotation: 0
state: enabled
- name: low_pass_filter_0
id: low_pass_filter
parameters:
affinity: ''
alias: ''
beta: '6.76'
comment: ''
cutoff_freq: 60e3
decim: '1'
gain: '1'
interp: '1'
maxoutbuf: '0'
minoutbuf: '0'
samp_rate: samp_rate
type: fir_filter_ccf
width: 10e3
win: window.WIN_HAMMING
states:
bus_sink: false
bus_source: false
bus_structure: null
coordinate: [496, 296.0]
rotation: 0
state: enabled
- name: pfb_arb_resampler_xxx_0
id: pfb_arb_resampler_xxx
parameters:
affinity: ''
alias: ''
atten: '100'
comment: ''
maxoutbuf: '0'
minoutbuf: '0'
nfilts: '32'
rrate: (audio_rate * 2) / samp_rate
samp_delay: '0'
taps: ''
type: ccf
states:
bus_sink: false
bus_source: false
bus_structure: null
coordinate: [792, 276.0]
rotation: 0
state: true
- name: qtgui_freq_sink_x_0
id: qtgui_freq_sink_x
parameters:
affinity: ''
alias: ''
alpha1: '1.0'
alpha10: '1.0'
alpha2: '1.0'
alpha3: '1.0'
alpha4: '1.0'
alpha5: '1.0'
alpha6: '1.0'
alpha7: '1.0'
alpha8: '1.0'
alpha9: '1.0'
autoscale: 'False'
average: '1.0'
axislabels: 'True'
bw: samp_rate
color1: '"blue"'
color10: '"dark blue"'
color2: '"red"'
color3: '"green"'
color4: '"black"'
color5: '"cyan"'
color6: '"magenta"'
color7: '"yellow"'
color8: '"dark red"'
color9: '"dark green"'
comment: ''
ctrlpanel: 'False'
fc: radio_freq
fftsize: '1024'
freqhalf: 'True'
grid: 'False'
gui_hint: 2,0,2,3
label: Relative Gain
label1: ''
label10: ''
label2: ''
label3: ''
label4: ''
label5: ''
label6: ''
label7: ''
label8: ''
label9: ''
legend: 'True'
maxoutbuf: '0'
minoutbuf: '0'
name: '"Input"'
nconnections: '1'
norm_window: 'False'
showports: 'True'
tr_chan: '0'
tr_level: '0.0'
tr_mode: qtgui.TRIG_MODE_FREE
tr_tag: '""'
type: complex
units: dB
update_time: '0.10'
width1: '1'
width10: '1'
width2: '1'
width3: '1'
width4: '1'
width5: '1'
width6: '1'
width7: '1'
width8: '1'
width9: '1'
wintype: window.WIN_BLACKMAN_hARRIS
ymax: '0'
ymin: '-90'
states:
bus_sink: false
bus_source: false
bus_structure: null
coordinate: [496, 492.0]
rotation: 0
state: enabled
- name: qtgui_freq_sink_x_1
id: qtgui_freq_sink_x
parameters:
affinity: ''
alias: ''
alpha1: '1.0'
alpha10: '1.0'
alpha2: '1.0'
alpha3: '1.0'
alpha4: '1.0'
alpha5: '1.0'
alpha6: '1.0'
alpha7: '1.0'
alpha8: '1.0'
alpha9: '1.0'
autoscale: 'False'
average: '1.0'
axislabels: 'True'
bw: audio_rate
color1: '"blue"'
color10: '"dark blue"'
color2: '"red"'
color3: '"green"'
color4: '"black"'
color5: '"cyan"'
color6: '"magenta"'
color7: '"yellow"'
color8: '"dark red"'
color9: '"dark green"'
comment: ''
ctrlpanel: 'False'
fc: radio_freq
fftsize: '1024'
freqhalf: 'True'
grid: 'False'
gui_hint: 2,3,2,3
label: Relative Gain
label1: ''
label10: ''
label2: ''
label3: ''
label4: ''
label5: ''
label6: ''
label7: ''
label8: ''
label9: ''
legend: 'True'
maxoutbuf: '0'
minoutbuf: '0'
name: Audio
nconnections: '1'
norm_window: 'False'
showports: 'True'
tr_chan: '0'
tr_level: '0.0'
tr_mode: qtgui.TRIG_MODE_FREE
tr_tag: '""'
type: float
units: dB
update_time: '0.10'
width1: '1'
width10: '1'
width2: '1'
width3: '1'
width4: '1'
width5: '1'
width6: '1'
width7: '1'
width8: '1'
width9: '1'
wintype: window.WIN_BLACKMAN_hARRIS
ymax: '10'
ymin: '-90'
states:
bus_sink: false
bus_source: false
bus_structure: null
coordinate: [776, 652.0]
rotation: 180
state: enabled
- name: qtgui_waterfall_sink_x_0
id: qtgui_waterfall_sink_x
parameters:
affinity: ''
alias: ''
alpha1: '1.0'
alpha10: '1.0'
alpha2: '1.0'
alpha3: '1.0'
alpha4: '1.0'
alpha5: '1.0'
alpha6: '1.0'
alpha7: '1.0'
alpha8: '1.0'
alpha9: '1.0'
axislabels: 'True'
bw: samp_rate
color1: '0'
color10: '0'
color2: '0'
color3: '0'
color4: '0'
color5: '0'
color6: '0'
color7: '0'
color8: '0'
color9: '0'
comment: ''
fc: radio_freq
fftsize: '1024'
freqhalf: 'True'
grid: 'False'
gui_hint: 4,0,2,3
int_max: '10'
int_min: '-80'
label1: ''
label10: ''
label2: ''
label3: ''
label4: ''
label5: ''
label6: ''
label7: ''
label8: ''
label9: ''
legend: 'True'
maxoutbuf: '0'
minoutbuf: '0'
name: '""'
nconnections: '1'
showports: 'True'
type: complex
update_time: '0.10'
wintype: window.WIN_BLACKMAN_hARRIS
states:
bus_sink: false
bus_source: false
bus_structure: null
coordinate: [496, 184.0]
rotation: 0
state: enabled
- name: soapy_source_0
id: soapy_source
parameters:
affinity: ''
agc0: 'False'
agc1: 'False'
alias: ''
amp_gain0: '0'
ant0: antenna
ant1: RX2
balance0: '0'
balance1: '0'
bw0: '0'
bw1: '0'
center_freq0: radio_freq
center_freq1: '0'
clock_rate: '0'
clock_source: ''
comment: ''
correction0: '0'
correction1: '0'
dc_offset0: '0'
dc_offset1: '0'
dc_removal0: 'False'
dc_removal1: 'True'
dev: driver=rtlsdr
dev_args: ''
devname: rtlsdr
gain_mode0: Overall
gain_mode1: Overall
ifgr_gain: '59'
lna_gain0: '10'
lna_gain1: '10'
maxoutbuf: '0'
minoutbuf: '0'
mix_gain0: '10'
nchan: '1'
nco_freq0: '0'
nco_freq1: '0'
overall_gain0: gain
overall_gain1: '10'
pga_gain0: '24'
pga_gain1: '24'
rf_gain0: '18'
rfgr_gain: '9'
rxvga1_gain: '5'
rxvga2_gain: '0'
samp_rate: samp_rate
sdrplay_agc_setpoint: '-30'
sdrplay_biastee: 'True'
sdrplay_dabnotch: 'False'
sdrplay_if_mode: Zero-IF
sdrplay_rfnotch: 'False'
settings0: ''
settings1: ''
stream_args: ''
tia_gain0: '0'
tia_gain1: '0'
tune_args0: ''
tune_args1: ''
tuner_gain0: '10'
type: fc32
vga_gain0: '10'
states:
bus_sink: false
bus_source: false
bus_structure: null
coordinate: [88, 312.0]
rotation: 0
state: true
connections:
- [analog_wfm_rcv_0, '0', blocks_multiply_const_vxx_0, '0']
- [blocks_multiply_const_vxx_0, '0', audio_sink_0, '0']
- [blocks_multiply_const_vxx_0, '0', qtgui_freq_sink_x_1, '0']
- [low_pass_filter_0, '0', pfb_arb_resampler_xxx_0, '0']
- [pfb_arb_resampler_xxx_0, '0', analog_wfm_rcv_0, '0']
- [soapy_source_0, '0', low_pass_filter_0, '0']
- [soapy_source_0, '0', qtgui_freq_sink_x_0, '0']
- [soapy_source_0, '0', qtgui_waterfall_sink_x_0, '0']
metadata:
file_format: 1

Wyświetl plik

@ -0,0 +1,532 @@
options:
parameters:
author: ''
catch_exceptions: 'True'
category: '[GRC Hier Blocks]'
cmake_opt: ''
comment: ''
copyright: ''
description: ''
gen_cmake: 'On'
gen_linking: dynamic
generate_options: qt_gui
hier_block_src_path: '.:'
id: fm_radio_receiver_soapy
max_nouts: '0'
output_language: python
placement: (0,0)
qt_qss_theme: ''
realtime_scheduling: ''
run: 'True'
run_command: '{python} -u {filename}'
run_options: prompt
sizing_mode: fixed
thread_safe_setters: ''
title: ''
states:
bus_sink: false
bus_source: false
bus_structure: null
coordinate: [8, 8]
rotation: 0
state: enabled
blocks:
- name: antenna
id: variable
parameters:
comment: ''
value: '"RX"'
states:
bus_sink: false
bus_source: false
bus_structure: null
coordinate: [368, 12.0]
rotation: 0
state: enabled
- name: audio_rate
id: variable
parameters:
comment: ''
value: '48000'
states:
bus_sink: false
bus_source: false
bus_structure: null
coordinate: [240, 92.0]
rotation: 0
state: enabled
- name: gain
id: variable_qtgui_range
parameters:
comment: ''
gui_hint: 1,3,1,3
label: Gain
min_len: '200'
orient: QtCore.Qt.Horizontal
rangeType: float
start: '0'
step: '2'
stop: '60'
value: '6'
widget: counter_slider
states:
bus_sink: false
bus_source: false
bus_structure: null
coordinate: [672, 8.0]
rotation: 0
state: enabled
- name: radio_freq
id: variable_qtgui_entry
parameters:
comment: ''
gui_hint: 0,0,1,3
label: Center Frequency
type: real
value: 95.7e6
states:
bus_sink: false
bus_source: false
bus_structure: null
coordinate: [832, 8.0]
rotation: 0
state: enabled
- name: samp_rate
id: variable
parameters:
comment: ''
value: 2.5e6
states:
bus_sink: false
bus_source: false
bus_structure: null
coordinate: [240, 12.0]
rotation: 0
state: enabled
- name: vol
id: variable_qtgui_range
parameters:
comment: ''
gui_hint: 0,3,1,3
label: Volume
min_len: '200'
orient: QtCore.Qt.Horizontal
rangeType: float
start: '0'
step: '0.05'
stop: '1.5'
value: '0.3'
widget: counter_slider
states:
bus_sink: false
bus_source: false
bus_structure: null
coordinate: [480, 8.0]
rotation: 0
state: enabled
- name: analog_wfm_rcv_0
id: analog_wfm_rcv
parameters:
affinity: ''
alias: ''
audio_decimation: '2'
comment: Quadrature rate is the input rate
maxoutbuf: '0'
minoutbuf: '0'
quad_rate: audio_rate
states:
bus_sink: false
bus_source: false
bus_structure: null
coordinate: [864, 588.0]
rotation: 180
state: enabled
- name: audio_sink_0
id: audio_sink
parameters:
affinity: ''
alias: ''
comment: ''
device_name: ''
num_inputs: '1'
ok_to_block: 'True'
samp_rate: audio_rate
states:
bus_sink: false
bus_source: false
bus_structure: null
coordinate: [536, 660.0]
rotation: 0
state: enabled
- name: blocks_multiply_const_vxx_0
id: blocks_multiply_const_vxx
parameters:
affinity: ''
alias: ''
comment: ''
const: vol
maxoutbuf: '0'
minoutbuf: '0'
type: float
vlen: '1'
states:
bus_sink: false
bus_source: false
bus_structure: null
coordinate: [536, 596.0]
rotation: 180
state: enabled
- name: low_pass_filter_0
id: low_pass_filter
parameters:
affinity: ''
alias: ''
beta: '6.76'
comment: ''
cutoff_freq: 60e3
decim: '1'
gain: '1'
interp: '1'
maxoutbuf: '0'
minoutbuf: '0'
samp_rate: samp_rate
type: fir_filter_ccf
width: 10e3
win: window.WIN_HAMMING
states:
bus_sink: false
bus_source: false
bus_structure: null
coordinate: [480, 400.0]
rotation: 0
state: enabled
- name: pfb_arb_resampler_xxx_0
id: pfb_arb_resampler_xxx
parameters:
affinity: ''
alias: ''
atten: '100'
comment: ''
maxoutbuf: '0'
minoutbuf: '0'
nfilts: '32'
rrate: (audio_rate * 2) / samp_rate
samp_delay: '0'
taps: ''
type: ccf
states:
bus_sink: false
bus_source: false
bus_structure: null
coordinate: [784, 404.0]
rotation: 0
state: true
- name: qtgui_freq_sink_x_0
id: qtgui_freq_sink_x
parameters:
affinity: ''
alias: ''
alpha1: '1.0'
alpha10: '1.0'
alpha2: '1.0'
alpha3: '1.0'
alpha4: '1.0'
alpha5: '1.0'
alpha6: '1.0'
alpha7: '1.0'
alpha8: '1.0'
alpha9: '1.0'
autoscale: 'False'
average: '1.0'
axislabels: 'True'
bw: samp_rate
color1: '"blue"'
color10: '"dark blue"'
color2: '"red"'
color3: '"green"'
color4: '"black"'
color5: '"cyan"'
color6: '"magenta"'
color7: '"yellow"'
color8: '"dark red"'
color9: '"dark green"'
comment: ''
ctrlpanel: 'False'
fc: radio_freq
fftsize: '1024'
freqhalf: 'True'
grid: 'False'
gui_hint: 2,0,2,3
label: Relative Gain
label1: ''
label10: ''
label2: ''
label3: ''
label4: ''
label5: ''
label6: ''
label7: ''
label8: ''
label9: ''
legend: 'True'
maxoutbuf: '0'
minoutbuf: '0'
name: '"Input"'
nconnections: '1'
norm_window: 'False'
showports: 'True'
tr_chan: '0'
tr_level: '0.0'
tr_mode: qtgui.TRIG_MODE_FREE
tr_tag: '""'
type: complex
units: dB
update_time: '0.10'
width1: '1'
width10: '1'
width2: '1'
width3: '1'
width4: '1'
width5: '1'
width6: '1'
width7: '1'
width8: '1'
width9: '1'
wintype: window.WIN_BLACKMAN_hARRIS
ymax: '0'
ymin: '-90'
states:
bus_sink: false
bus_source: false
bus_structure: null
coordinate: [480, 172.0]
rotation: 0
state: enabled
- name: qtgui_freq_sink_x_1
id: qtgui_freq_sink_x
parameters:
affinity: ''
alias: ''
alpha1: '1.0'
alpha10: '1.0'
alpha2: '1.0'
alpha3: '1.0'
alpha4: '1.0'
alpha5: '1.0'
alpha6: '1.0'
alpha7: '1.0'
alpha8: '1.0'
alpha9: '1.0'
autoscale: 'False'
average: '1.0'
axislabels: 'True'
bw: audio_rate
color1: '"blue"'
color10: '"dark blue"'
color2: '"red"'
color3: '"green"'
color4: '"black"'
color5: '"cyan"'
color6: '"magenta"'
color7: '"yellow"'
color8: '"dark red"'
color9: '"dark green"'
comment: ''
ctrlpanel: 'False'
fc: radio_freq
fftsize: '1024'
freqhalf: 'True'
grid: 'False'
gui_hint: 2,3,2,3
label: Relative Gain
label1: ''
label10: ''
label2: ''
label3: ''
label4: ''
label5: ''
label6: ''
label7: ''
label8: ''
label9: ''
legend: 'True'
maxoutbuf: '0'
minoutbuf: '0'
name: Audio
nconnections: '1'
norm_window: 'False'
showports: 'True'
tr_chan: '0'
tr_level: '0.0'
tr_mode: qtgui.TRIG_MODE_FREE
tr_tag: '""'
type: float
units: dB
update_time: '0.10'
width1: '1'
width10: '1'
width2: '1'
width3: '1'
width4: '1'
width5: '1'
width6: '1'
width7: '1'
width8: '1'
width9: '1'
wintype: window.WIN_BLACKMAN_hARRIS
ymax: '10'
ymin: '-90'
states:
bus_sink: false
bus_source: false
bus_structure: null
coordinate: [536, 724.0]
rotation: 0
state: enabled
- name: qtgui_waterfall_sink_x_0
id: qtgui_waterfall_sink_x
parameters:
affinity: ''
alias: ''
alpha1: '1.0'
alpha10: '1.0'
alpha2: '1.0'
alpha3: '1.0'
alpha4: '1.0'
alpha5: '1.0'
alpha6: '1.0'
alpha7: '1.0'
alpha8: '1.0'
alpha9: '1.0'
axislabels: 'True'
bw: samp_rate
color1: '0'
color10: '0'
color2: '0'
color3: '0'
color4: '0'
color5: '0'
color6: '0'
color7: '0'
color8: '0'
color9: '0'
comment: ''
fc: radio_freq
fftsize: '1024'
freqhalf: 'True'
grid: 'False'
gui_hint: 4,0,2,3
int_max: '10'
int_min: '-80'
label1: ''
label10: ''
label2: ''
label3: ''
label4: ''
label5: ''
label6: ''
label7: ''
label8: ''
label9: ''
legend: 'True'
maxoutbuf: '0'
minoutbuf: '0'
name: '""'
nconnections: '1'
showports: 'True'
type: complex
update_time: '0.10'
wintype: window.WIN_BLACKMAN_hARRIS
states:
bus_sink: false
bus_source: false
bus_structure: null
coordinate: [480, 296.0]
rotation: 0
state: enabled
- name: soapy_source_0
id: soapy_source
parameters:
affinity: ''
agc0: 'False'
agc1: 'False'
alias: ''
amp_gain0: '0'
ant0: antenna
ant1: RX2
balance0: '0'
balance1: '0'
bw0: '0'
bw1: '0'
center_freq0: radio_freq
center_freq1: '0'
clock_rate: '0'
clock_source: ''
comment: 'Use SoapySDRServer --bind="0.0.0.0:1234"
or similar to the remote server'
correction0: '0'
correction1: '0'
dc_offset0: '0'
dc_offset1: '0'
dc_removal0: 'True'
dc_removal1: 'True'
dev: driver=remote
dev_args: ''
devname: custom
gain_mode0: Overall
gain_mode1: Overall
ifgr_gain: '59'
lna_gain0: '10'
lna_gain1: '10'
maxoutbuf: '0'
minoutbuf: '0'
mix_gain0: '10'
nchan: '1'
nco_freq0: '0'
nco_freq1: '0'
overall_gain0: gain
overall_gain1: '10'
pga_gain0: '24'
pga_gain1: '24'
rf_gain0: '18'
rfgr_gain: '9'
rxvga1_gain: '5'
rxvga2_gain: '0'
samp_rate: samp_rate
sdrplay_agc_setpoint: '-30'
sdrplay_biastee: 'True'
sdrplay_dabnotch: 'False'
sdrplay_if_mode: Zero-IF
sdrplay_rfnotch: 'False'
settings0: ''
settings1: ''
stream_args: ''
tia_gain0: '0'
tia_gain1: '0'
tune_args0: ''
tune_args1: ''
tuner_gain0: '10'
type: fc32
vga_gain0: '10'
states:
bus_sink: false
bus_source: false
bus_structure: null
coordinate: [56, 176.0]
rotation: 0
state: true
connections:
- [analog_wfm_rcv_0, '0', blocks_multiply_const_vxx_0, '0']
- [blocks_multiply_const_vxx_0, '0', audio_sink_0, '0']
- [blocks_multiply_const_vxx_0, '0', qtgui_freq_sink_x_1, '0']
- [low_pass_filter_0, '0', pfb_arb_resampler_xxx_0, '0']
- [pfb_arb_resampler_xxx_0, '0', analog_wfm_rcv_0, '0']
- [soapy_source_0, '0', low_pass_filter_0, '0']
- [soapy_source_0, '0', qtgui_freq_sink_x_0, '0']
- [soapy_source_0, '0', qtgui_waterfall_sink_x_0, '0']
metadata:
file_format: 1

Wyświetl plik

@ -0,0 +1,310 @@
options:
parameters:
author: ''
catch_exceptions: 'True'
category: '[GRC Hier Blocks]'
cmake_opt: ''
comment: ''
copyright: ''
description: ''
gen_cmake: 'On'
gen_linking: dynamic
generate_options: qt_gui
hier_block_src_path: '.:'
id: soapy_rcv
max_nouts: '0'
output_language: python
placement: (0,0)
qt_qss_theme: ''
realtime_scheduling: ''
run: 'True'
run_command: '{python} -u {filename}'
run_options: prompt
sizing_mode: fixed
thread_safe_setters: ''
title: SOAPY Receive Test
states:
bus_sink: false
bus_source: false
bus_structure: null
coordinate: [8, 8]
rotation: 0
state: enabled
blocks:
- name: antenna
id: variable
parameters:
comment: ''
value: '"RX"'
states:
bus_sink: false
bus_source: false
bus_structure: null
coordinate: [568, 12.0]
rotation: 0
state: enabled
- name: freq
id: variable
parameters:
comment: ''
value: 99.5e6
states:
bus_sink: false
bus_source: false
bus_structure: null
coordinate: [248, 92.0]
rotation: 0
state: true
- name: gain
id: variable_qtgui_range
parameters:
comment: ''
gui_hint: 0,0,1,1
label: ''
min_len: '200'
orient: QtCore.Qt.Horizontal
rangeType: float
start: '0'
step: '2'
stop: '50'
value: '0'
widget: counter_slider
states:
bus_sink: false
bus_source: false
bus_structure: null
coordinate: [400, 12.0]
rotation: 0
state: true
- name: samp_rate
id: variable
parameters:
comment: ''
value: 2e6
states:
bus_sink: false
bus_source: false
bus_structure: null
coordinate: [248, 12.0]
rotation: 0
state: enabled
- name: qtgui_freq_sink_x_0
id: qtgui_freq_sink_x
parameters:
affinity: ''
alias: ''
alpha1: '1.0'
alpha10: '1.0'
alpha2: '1.0'
alpha3: '1.0'
alpha4: '1.0'
alpha5: '1.0'
alpha6: '1.0'
alpha7: '1.0'
alpha8: '1.0'
alpha9: '1.0'
autoscale: 'False'
average: '1.0'
axislabels: 'True'
bw: samp_rate
color1: '"blue"'
color10: '"dark blue"'
color2: '"red"'
color3: '"green"'
color4: '"black"'
color5: '"cyan"'
color6: '"magenta"'
color7: '"yellow"'
color8: '"dark red"'
color9: '"dark green"'
comment: ''
ctrlpanel: 'False'
fc: freq
fftsize: '1024'
freqhalf: 'True'
grid: 'False'
gui_hint: 1,0,1,1
label: Relative Gain
label1: ''
label10: ''''''
label2: ''''''
label3: ''''''
label4: ''''''
label5: ''''''
label6: ''''''
label7: ''''''
label8: ''''''
label9: ''''''
legend: 'True'
maxoutbuf: '0'
minoutbuf: '0'
name: '""'
nconnections: '1'
norm_window: 'False'
showports: 'False'
tr_chan: '0'
tr_level: '0.0'
tr_mode: qtgui.TRIG_MODE_FREE
tr_tag: '""'
type: complex
units: dB
update_time: '0.10'
width1: '1'
width10: '1'
width2: '1'
width3: '1'
width4: '1'
width5: '1'
width6: '1'
width7: '1'
width8: '1'
width9: '1'
wintype: window.WIN_BLACKMAN_hARRIS
ymax: '0'
ymin: '-100'
states:
bus_sink: false
bus_source: false
bus_structure: null
coordinate: [528, 224.0]
rotation: 0
state: true
- name: qtgui_waterfall_sink_x_0
id: qtgui_waterfall_sink_x
parameters:
affinity: ''
alias: ''
alpha1: '1.0'
alpha10: '1.0'
alpha2: '1.0'
alpha3: '1.0'
alpha4: '1.0'
alpha5: '1.0'
alpha6: '1.0'
alpha7: '1.0'
alpha8: '1.0'
alpha9: '1.0'
axislabels: 'True'
bw: samp_rate
color1: '0'
color10: '0'
color2: '0'
color3: '0'
color4: '0'
color5: '0'
color6: '0'
color7: '0'
color8: '0'
color9: '0'
comment: ''
fc: '0'
fftsize: '1024'
freqhalf: 'True'
grid: 'False'
gui_hint: 2,0,1,1
int_max: '-10'
int_min: '-80'
label1: ''
label10: ''
label2: ''
label3: ''
label4: ''
label5: ''
label6: ''
label7: ''
label8: ''
label9: ''
legend: 'True'
maxoutbuf: '0'
minoutbuf: '0'
name: '""'
nconnections: '1'
showports: 'False'
type: complex
update_time: '0.10'
wintype: window.WIN_BLACKMAN_hARRIS
states:
bus_sink: false
bus_source: false
bus_structure: null
coordinate: [528, 352.0]
rotation: 0
state: true
- name: soapy_source_0
id: soapy_source
parameters:
affinity: ''
agc0: 'False'
agc1: 'False'
alias: ''
amp_gain0: '0'
ant0: antenna
ant1: RX2
balance0: '0'
balance1: '0'
bw0: '0'
bw1: '0'
center_freq0: freq
center_freq1: '0'
clock_rate: '0'
clock_source: ''
comment: ''
correction0: '0'
correction1: '0'
dc_offset0: '0'
dc_offset1: '0'
dc_removal0: 'False'
dc_removal1: 'True'
dev: driver=rtlsdr
dev_args: ''
devname: rtlsdr
gain_mode0: Overall
gain_mode1: Overall
ifgr_gain: '59'
lna_gain0: '10'
lna_gain1: '10'
maxoutbuf: '0'
minoutbuf: '0'
mix_gain0: '10'
nchan: '1'
nco_freq0: '0'
nco_freq1: '0'
overall_gain0: gain
overall_gain1: '10'
pga_gain0: '24'
pga_gain1: '24'
rf_gain0: '18'
rfgr_gain: '9'
rxvga1_gain: '5'
rxvga2_gain: '0'
samp_rate: samp_rate
sdrplay_agc_setpoint: '-30'
sdrplay_biastee: 'True'
sdrplay_dabnotch: 'False'
sdrplay_if_mode: Zero-IF
sdrplay_rfnotch: 'False'
settings0: ''
settings1: ''
stream_args: ''
tia_gain0: '0'
tia_gain1: '0'
tune_args0: ''
tune_args1: ''
tuner_gain0: '10'
type: fc32
vga_gain0: '10'
states:
bus_sink: false
bus_source: false
bus_structure: null
coordinate: [112, 228.0]
rotation: 0
state: true
connections:
- [soapy_source_0, '0', qtgui_freq_sink_x_0, '0']
- [soapy_source_0, '0', qtgui_waterfall_sink_x_0, '0']
metadata:
file_format: 1

Wyświetl plik

@ -0,0 +1,352 @@
options:
parameters:
author: ''
catch_exceptions: 'True'
category: '[GRC Hier Blocks]'
cmake_opt: ''
comment: ''
copyright: ''
description: ''
gen_cmake: 'On'
gen_linking: dynamic
generate_options: qt_gui
hier_block_src_path: '.:'
id: soapy_rcv2
max_nouts: '0'
output_language: python
placement: (0,0)
qt_qss_theme: ''
realtime_scheduling: ''
run: 'True'
run_command: '{python} -u {filename}'
run_options: prompt
sizing_mode: fixed
thread_safe_setters: ''
title: SOAPY Receive Test
states:
bus_sink: false
bus_source: false
bus_structure: null
coordinate: [8, 8]
rotation: 0
state: enabled
blocks:
- name: antenna
id: variable
parameters:
comment: ''
value: '"RX"'
states:
bus_sink: false
bus_source: false
bus_structure: null
coordinate: [240, 172.0]
rotation: 0
state: enabled
- name: freq
id: variable
parameters:
comment: ''
value: 905e6
states:
bus_sink: false
bus_source: false
bus_structure: null
coordinate: [240, 92.0]
rotation: 0
state: true
- name: lna
id: variable_qtgui_range
parameters:
comment: ''
gui_hint: ''
label: VGA Gain
min_len: '200'
orient: QtCore.Qt.Horizontal
rangeType: float
start: '0'
step: '0.5'
stop: '50'
value: '0'
widget: counter_slider
states:
bus_sink: false
bus_source: false
bus_structure: null
coordinate: [368, 12.0]
rotation: 0
state: true
- name: mix
id: variable_qtgui_range
parameters:
comment: ''
gui_hint: ''
label: MIX Gain
min_len: '200'
orient: QtCore.Qt.Horizontal
rangeType: float
start: '0'
step: '0.5'
stop: '50'
value: '0'
widget: counter_slider
states:
bus_sink: false
bus_source: false
bus_structure: null
coordinate: [528, 16.0]
rotation: 0
state: true
- name: samp_rate
id: variable
parameters:
comment: ''
value: 2.5e6
states:
bus_sink: false
bus_source: false
bus_structure: null
coordinate: [240, 12.0]
rotation: 0
state: enabled
- name: vga
id: variable_qtgui_range
parameters:
comment: ''
gui_hint: ''
label: VGA Gain
min_len: '200'
orient: QtCore.Qt.Horizontal
rangeType: float
start: '0'
step: '0.5'
stop: '50'
value: '0'
widget: counter_slider
states:
bus_sink: false
bus_source: false
bus_structure: null
coordinate: [688, 24.0]
rotation: 0
state: true
- name: qtgui_freq_sink_x_0
id: qtgui_freq_sink_x
parameters:
affinity: ''
alias: ''
alpha1: '1.0'
alpha10: '1.0'
alpha2: '1.0'
alpha3: '1.0'
alpha4: '1.0'
alpha5: '1.0'
alpha6: '1.0'
alpha7: '1.0'
alpha8: '1.0'
alpha9: '1.0'
autoscale: 'False'
average: '1.0'
axislabels: 'True'
bw: samp_rate
color1: '"blue"'
color10: '"dark blue"'
color2: '"red"'
color3: '"green"'
color4: '"black"'
color5: '"cyan"'
color6: '"magenta"'
color7: '"yellow"'
color8: '"dark red"'
color9: '"dark green"'
comment: ''
ctrlpanel: 'False'
fc: freq
fftsize: '1024'
freqhalf: 'True'
grid: 'False'
gui_hint: 1,0,1,2
label: Relative Gain
label1: ''
label10: ''''''
label2: ''''''
label3: ''''''
label4: ''''''
label5: ''''''
label6: ''''''
label7: ''''''
label8: ''''''
label9: ''''''
legend: 'True'
maxoutbuf: '0'
minoutbuf: '0'
name: '""'
nconnections: '1'
norm_window: 'False'
showports: 'False'
tr_chan: '0'
tr_level: '0.0'
tr_mode: qtgui.TRIG_MODE_FREE
tr_tag: '""'
type: complex
units: dB
update_time: '0.10'
width1: '1'
width10: '1'
width2: '1'
width3: '1'
width4: '1'
width5: '1'
width6: '1'
width7: '1'
width8: '1'
width9: '1'
wintype: window.WIN_BLACKMAN_hARRIS
ymax: '0'
ymin: '-100'
states:
bus_sink: false
bus_source: false
bus_structure: null
coordinate: [480, 248.0]
rotation: 0
state: true
- name: qtgui_waterfall_sink_x_0
id: qtgui_waterfall_sink_x
parameters:
affinity: ''
alias: ''
alpha1: '1.0'
alpha10: '1.0'
alpha2: '1.0'
alpha3: '1.0'
alpha4: '1.0'
alpha5: '1.0'
alpha6: '1.0'
alpha7: '1.0'
alpha8: '1.0'
alpha9: '1.0'
axislabels: 'True'
bw: samp_rate
color1: '0'
color10: '0'
color2: '0'
color3: '0'
color4: '0'
color5: '0'
color6: '0'
color7: '0'
color8: '0'
color9: '0'
comment: ''
fc: freq
fftsize: '1024'
freqhalf: 'True'
grid: 'False'
gui_hint: 2,0,1,2
int_max: '-10'
int_min: '-80'
label1: ''
label10: ''
label2: ''
label3: ''
label4: ''
label5: ''
label6: ''
label7: ''
label8: ''
label9: ''
legend: 'True'
maxoutbuf: '0'
minoutbuf: '0'
name: '""'
nconnections: '1'
showports: 'False'
type: complex
update_time: '0.10'
wintype: window.WIN_BLACKMAN_hARRIS
states:
bus_sink: false
bus_source: false
bus_structure: null
coordinate: [480, 360.0]
rotation: 0
state: true
- name: soapy_source_0
id: soapy_source
parameters:
affinity: ''
agc0: 'False'
agc1: 'False'
alias: ''
amp_gain0: '0'
ant0: antenna
ant1: RX2
balance0: '0'
balance1: '0'
bw0: '0'
bw1: '0'
center_freq0: freq
center_freq1: '0'
clock_rate: '0'
clock_source: ''
comment: ''
correction0: '0'
correction1: '0'
dc_offset0: '0'
dc_offset1: '0'
dc_removal0: 'True'
dc_removal1: 'True'
dev: driver=rtlsdr
dev_args: ''
devname: airspy
gain_mode0: Overall
gain_mode1: Overall
ifgr_gain: '59'
lna_gain0: lna
lna_gain1: '10'
maxoutbuf: '0'
minoutbuf: '0'
mix_gain0: mix
nchan: '1'
nco_freq0: '0'
nco_freq1: '0'
overall_gain0: '0'
overall_gain1: '10'
pga_gain0: '24'
pga_gain1: '24'
rf_gain0: '18'
rfgr_gain: '9'
rxvga1_gain: '5'
rxvga2_gain: '0'
samp_rate: samp_rate
sdrplay_agc_setpoint: '-30'
sdrplay_biastee: 'True'
sdrplay_dabnotch: 'False'
sdrplay_if_mode: Zero-IF
sdrplay_rfnotch: 'False'
settings0: ''
settings1: ''
stream_args: ''
tia_gain0: '0'
tia_gain1: '0'
tune_args0: ''
tune_args1: ''
tuner_gain0: '10'
type: fc32
vga_gain0: vga
states:
bus_sink: false
bus_source: false
bus_structure: null
coordinate: [96, 264.0]
rotation: 0
state: true
connections:
- [soapy_source_0, '0', qtgui_freq_sink_x_0, '0']
- [soapy_source_0, '0', qtgui_waterfall_sink_x_0, '0']
metadata:
file_format: 1

Wyświetl plik

@ -0,0 +1,339 @@
options:
parameters:
author: ''
catch_exceptions: 'True'
category: '[GRC Hier Blocks]'
cmake_opt: ''
comment: ''
copyright: ''
description: ''
gen_cmake: 'On'
gen_linking: dynamic
generate_options: qt_gui
hier_block_src_path: '.:'
id: soapy_xmit
max_nouts: '0'
output_language: python
placement: (0,0)
qt_qss_theme: ''
realtime_scheduling: ''
run: 'True'
run_command: '{python} -u {filename}'
run_options: prompt
sizing_mode: fixed
thread_safe_setters: ''
title: Soapy Test Transmit
states:
bus_sink: false
bus_source: false
bus_structure: null
coordinate: [8, 8]
rotation: 0
state: enabled
blocks:
- name: freq
id: variable
parameters:
comment: ''
value: 905e6
states:
bus_sink: false
bus_source: false
bus_structure: null
coordinate: [248, 92.0]
rotation: 0
state: enabled
- name: gain
id: variable_qtgui_range
parameters:
comment: ''
gui_hint: 0,0,1,1
label: ''
min_len: '200'
orient: QtCore.Qt.Horizontal
rangeType: float
start: '0'
step: '2'
stop: '80'
value: '40'
widget: counter_slider
states:
bus_sink: false
bus_source: false
bus_structure: null
coordinate: [384, 12.0]
rotation: 0
state: true
- name: samp_rate
id: variable
parameters:
comment: ''
value: 500e3
states:
bus_sink: false
bus_source: false
bus_structure: null
coordinate: [248, 12.0]
rotation: 0
state: enabled
- name: xmit_rate
id: variable
parameters:
comment: ''
value: 2e6
states:
bus_sink: false
bus_source: false
bus_structure: null
coordinate: [248, 172.0]
rotation: 0
state: enabled
- name: analog_sig_source_x_0
id: analog_sig_source_x
parameters:
affinity: ''
alias: ''
amp: '1'
comment: ''
freq: '1000'
maxoutbuf: '0'
minoutbuf: '0'
offset: '0'
phase: '0'
samp_rate: samp_rate
type: complex
waveform: analog.GR_COS_WAVE
states:
bus_sink: false
bus_source: false
bus_structure: null
coordinate: [80, 264.0]
rotation: 0
state: true
- name: pfb_arb_resampler_xxx_0
id: pfb_arb_resampler_xxx
parameters:
affinity: ''
alias: ''
atten: '100'
comment: ''
maxoutbuf: '0'
minoutbuf: '0'
nfilts: '32'
rrate: xmit_rate / samp_rate
samp_delay: '0'
taps: ''
type: ccf
states:
bus_sink: false
bus_source: false
bus_structure: null
coordinate: [392, 244.0]
rotation: 0
state: true
- name: qtgui_freq_sink_x_0
id: qtgui_freq_sink_x
parameters:
affinity: ''
alias: ''
alpha1: '1.0'
alpha10: '1.0'
alpha2: '1.0'
alpha3: '1.0'
alpha4: '1.0'
alpha5: '1.0'
alpha6: '1.0'
alpha7: '1.0'
alpha8: '1.0'
alpha9: '1.0'
autoscale: 'False'
average: '1.0'
axislabels: 'True'
bw: xmit_rate
color1: '"blue"'
color10: '"dark blue"'
color2: '"red"'
color3: '"green"'
color4: '"black"'
color5: '"cyan"'
color6: '"magenta"'
color7: '"yellow"'
color8: '"dark red"'
color9: '"dark green"'
comment: ''
ctrlpanel: 'False'
fc: freq
fftsize: '1024'
freqhalf: 'True'
grid: 'False'
gui_hint: 1,0,1,2
label: Relative Gain
label1: ''
label10: ''''''
label2: ''''''
label3: ''''''
label4: ''''''
label5: ''''''
label6: ''''''
label7: ''''''
label8: ''''''
label9: ''''''
legend: 'True'
maxoutbuf: '0'
minoutbuf: '0'
name: '""'
nconnections: '1'
norm_window: 'False'
showports: 'False'
tr_chan: '0'
tr_level: '0.0'
tr_mode: qtgui.TRIG_MODE_FREE
tr_tag: '""'
type: complex
units: dB
update_time: '0.10'
width1: '1'
width10: '1'
width2: '1'
width3: '1'
width4: '1'
width5: '1'
width6: '1'
width7: '1'
width8: '1'
width9: '1'
wintype: window.WIN_BLACKMAN_hARRIS
ymax: '0'
ymin: '-100'
states:
bus_sink: false
bus_source: false
bus_structure: null
coordinate: [824, 312.0]
rotation: 0
state: true
- name: qtgui_waterfall_sink_x_0
id: qtgui_waterfall_sink_x
parameters:
affinity: ''
alias: ''
alpha1: '1.0'
alpha10: '1.0'
alpha2: '1.0'
alpha3: '1.0'
alpha4: '1.0'
alpha5: '1.0'
alpha6: '1.0'
alpha7: '1.0'
alpha8: '1.0'
alpha9: '1.0'
axislabels: 'True'
bw: xmit_rate
color1: '0'
color10: '0'
color2: '0'
color3: '0'
color4: '0'
color5: '0'
color6: '0'
color7: '0'
color8: '0'
color9: '0'
comment: ''
fc: freq
fftsize: '1024'
freqhalf: 'True'
grid: 'False'
gui_hint: 2,0,1,2
int_max: '-10'
int_min: '-80'
label1: ''
label10: ''
label2: ''
label3: ''
label4: ''
label5: ''
label6: ''
label7: ''
label8: ''
label9: ''
legend: 'True'
maxoutbuf: '0'
minoutbuf: '0'
name: '""'
nconnections: '1'
showports: 'False'
type: complex
update_time: '0.10'
wintype: window.WIN_BLACKMAN_hARRIS
states:
bus_sink: false
bus_source: false
bus_structure: null
coordinate: [824, 416.0]
rotation: 0
state: true
- name: soapy_sink_0
id: soapy_sink
parameters:
affinity: ''
alias: ''
amp_gain0: '0'
ant0: TX/RX
ant1: ''
args: ''
balance0: '0'
balance1: '0'
bw0: '0'
bw1: '0'
center_freq0: freq
center_freq1: 100.0e6
clock_rate: '0'
clock_source: ''
comment: ''
correction0: '0'
correction1: '0'
dc_offset0: '0'
dc_offset1: '0'
dc_offset_auto_mode0: 'False'
dc_offset_auto_mode1: 'False'
dev: driver=uhd
devname: uhd
gain_auto_mode0: 'False'
gain_auto_mode1: 'False'
iamp_gain0: '0'
iamp_gain1: '0'
length_tag_name: ''
manual_gain0: 'True'
manual_gain1: 'True'
nchan: '1'
nco_freq0: '0'
nco_freq1: '0'
overall_gain0: gain
overall_gain1: '0'
pad_gain0: '0'
pad_gain1: '0'
pga_gain0: gain
pga_gain1: '0'
samp_rate: xmit_rate
txvga1_gain: '-35'
txvga2_gain: '0'
type: fc32
vga_gain0: '10'
states:
bus_sink: false
bus_source: false
bus_structure: null
coordinate: [824, 136.0]
rotation: 0
state: true
connections:
- [analog_sig_source_x_0, '0', pfb_arb_resampler_xxx_0, '0']
- [pfb_arb_resampler_xxx_0, '0', qtgui_freq_sink_x_0, '0']
- [pfb_arb_resampler_xxx_0, '0', qtgui_waterfall_sink_x_0, '0']
- [pfb_arb_resampler_xxx_0, '0', soapy_sink_0, '0']
metadata:
file_format: 1

Wyświetl plik

@ -0,0 +1,11 @@
prefix=@prefix@
exec_prefix=@exec_prefix@
libdir=@libdir@
includedir=@includedir@
Name: gnuradio-cariboulite
Description: GNU Radio blocks for CaribouLite
Requires: gnuradio-runtime
Version: @LIBVER@
Libs: -L${libdir} -lgnuradio-cariboulite
Cflags: -I${includedir}

Wyświetl plik

@ -0,0 +1,14 @@
# Copyright 2021 Free Software Foundation, Inc.
#
# This file was generated by gr_modtool, a tool from the GNU Radio framework
# This file is a part of gr-cariboulite
#
# SPDX-License-Identifier: GPL-3.0-or-later
#
install(FILES
cariboulite.tree.yml
cariboulite_source.block.yml
cariboulite_sink.block.yml
DESTINATION share/gnuradio/grc/blocks
)

Wyświetl plik

@ -0,0 +1,6 @@
'[Core]':
- CaribouLite:
- Source:
- cariboulite_source
- Sink:
- cariboulite_sink

Wyświetl plik

@ -0,0 +1,84 @@
id: soapy_hackrf_sink
label: Soapy HackRF Sink
flags: [python, throttle]
parameters:
- id: type
label: Input Type
dtype: enum
options: [fc32, sc16, sc8]
option_labels: [Complex Float32, Complex Int16, Complex Byte]
option_attributes:
type: [fc32, sc16, sc8]
hide: part
- id: dev_args
label: Device arguments
dtype: string
hide: ${'part' if not dev_args else 'none'}
- id: samp_rate
label: Sample Rate
dtype: float
default: 'samp_rate'
- id: bandwidth
label: Bandwidth (0=auto)
category: RF Options
dtype: float
default: '0'
hide: part
- id: center_freq
label: 'Center Freq (Hz)'
category: RF Options
dtype: real
default: 'freq'
- id: amp
label: 'Amp On (+14 dB)'
category: RF Options
dtype: bool
default: 'False'
hide: part
- id: vga
label: VGA Gain (0dB - 47dB)'
category: RF Options
dtype: real
default: '16'
hide: part
inputs:
- domain: stream
dtype: ${ type.type }
multiplicity: 1
- domain: message
id: cmd
optional: true
templates:
imports: from gnuradio import soapy
make: |
None
dev = 'driver=hackrf'
stream_args = ''
tune_args = ['']
settings = ['']
self.${id} = soapy.sink(dev, "${type}", 1, ${dev_args},
stream_args, tune_args, settings)
self.${id}.set_sample_rate(0, ${samp_rate})
self.${id}.set_bandwidth(0, ${bandwidth})
self.${id}.set_frequency(0, ${center_freq})
self.${id}.set_gain(0, 'AMP', ${amp})
self.${id}.set_gain(0, 'VGA', min(max(${vga}, 0.0), 47.0))
callbacks:
- set_sample_rate(0, ${samp_rate})
- set_bandwidth(0, ${bandwidth})
- set_frequency(0, ${center_freq})
- set_gain(0, 'AMP', ${amp})
- set_gain(0, 'VGA', min(max(${vga}, 0.0), 47.0))
file_format: 1

Wyświetl plik

@ -0,0 +1,94 @@
id: cariboulite_source
label: CaribouLite Source
flags: [python, throttle]
parameters:
- id: type
label: Output Type
dtype: enum
options: [fc32, sc16, sc8]
option_labels: [Complex Float32, Complex Int16, Complex Byte]
option_attributes:
type: [fc32, sc16, sc8]
hide: part
- id: dev_args
label: Device arguments
dtype: string
hide: ${'part' if not dev_args else 'none'}
- id: samp_rate
label: Sample Rate
dtype: float
default: 'samp_rate'
- id: bandwidth
label: Bandwidth (0=auto)
category: RF Options
dtype: float
default: '0'
hide: part
- id: center_freq
label: 'Center Freq (Hz)'
category: RF Options
dtype: real
default: 'freq'
- id: amp
label: 'Amp On (+14 dB)'
category: RF Options
dtype: bool
default: 'False'
hide: part
- id: gain
label: 'IF Gain (0dB - 40dB)'
category: RF Options
dtype: real
default: '16'
hide: part
- id: vga
label: VGA Gain (0dB - 62dB)'
category: RF Options
dtype: real
default: '16'
hide: part
inputs:
- domain: message
id: cmd
optional: true
outputs:
- domain: stream
dtype: ${ type.type }
multiplicity: 1
templates:
imports: from gnuradio import soapy
make: |
None
dev = 'driver=hackrf'
stream_args = ''
tune_args = ['']
settings = ['']
self.${id} = soapy.source(dev, "${type}", 1, ${dev_args},
stream_args, tune_args, settings)
self.${id}.set_sample_rate(0, ${samp_rate})
self.${id}.set_bandwidth(0, ${bandwidth})
self.${id}.set_frequency(0, ${center_freq})
self.${id}.set_gain(0, 'AMP', ${amp})
self.${id}.set_gain(0, 'LNA', min(max(${gain}, 0.0), 40.0))
self.${id}.set_gain(0, 'VGA', min(max(${vga}, 0.0), 62.0))
callbacks:
- set_sample_rate(0, ${samp_rate})
- set_bandwidth(0, ${bandwidth})
- set_frequency(0, ${center_freq})
- set_gain(0, 'AMP', ${amp})
- set_gain(0, 'LNA', min(max(${gain}, 0.0), 40.0))
- set_gain(0, 'VGA', min(max(${vga}, 0.0), 62.0))
file_format: 1

Wyświetl plik

@ -0,0 +1,20 @@
# Copyright 2011-2021 Free Software Foundation, Inc.
#
# This file was generated by gr_modtool, a tool from the GNU Radio framework
# This file is a part of gr-soapy
#
# SPDX-License-Identifier: GPL-3.0-or-later
#
########################################################################
# Install public header files
########################################################################
install(FILES
api.h
block.h
soapy_types.h
source.h
sink.h
DESTINATION ${GR_INCLUDE_DIR}/gnuradio/soapy
)

Wyświetl plik

@ -0,0 +1,22 @@
/*
* gr-soapy: Soapy SDR Radio Module
*
* Copyright (C) 2018
* Libre Space Foundation <http://librespacefoundation.org/>
*
* SPDX-License-Identifier: GPL-3.0-or-later
*
*/
#ifndef INCLUDED_CARIBOULITE_API_H
#define INCLUDED_CARIBOULITE_API_H
#include <gnuradio/attributes.h>
#ifdef gnuradio_cariboulite_EXPORTS
#define CARIBOULITE_API __GR_ATTR_EXPORT
#else
#define CARIBOULITE_API __GR_ATTR_IMPORT
#endif
#endif /* INCLUDED_CARIBOULITE_API_H */

Wyświetl plik

@ -0,0 +1,729 @@
/* -*- c++ -*- */
/*
* Copyright 2021 Jeff Long
* Copyright 2018-2021 Libre Space Foundation <http://libre.space/>
*
* SPDX-License-Identifier: GPL-3.0-or-later
*/
#ifndef INCLUDED_GR_SOAPY_BLOCK_H
#define INCLUDED_GR_SOAPY_BLOCK_H
#include <gnuradio/block.h>
#include <gnuradio/cariboulite/api.h>
#include <gnuradio/cariboulite/cariboulite_types.h>
#include <cstdint>
#include <string>
#include <vector>
namespace gr {
namespace cariboulite {
class CARIBOULITE_API block : virtual public gr::block
{
public:
/*!
* A key that uniquely identifies the device driver.
* This key identifies the underlying implementation.
* Several variants of a product may share a driver.
*/
virtual std::string get_driver_key() const = 0;
/*!
* A key that uniquely identifies the hardware.
* This key should be meaningful to the user
* to optimize for the underlying hardware.
*/
virtual std::string get_hardware_key() const = 0;
/*!
* Query a dictionary of available device information.
* This dictionary can any number of values like
* vendor name, product name, revisions, serials...
* This information can be displayed to the user
* to help identify the instantiated device.
*/
virtual kwargs_t get_hardware_info() const = 0;
/*!
* Set the frontend mapping of available DSP units to RF frontends.
* This mapping controls channel mapping and channel availability.
* \param frontend_mapping a vendor-specific mapping string
*/
virtual void set_frontend_mapping(const std::string& frontend_mapping) = 0;
/*!
* Get the frontend mapping of available DSP units to RF frontends.
* This mapping describes channel mapping and channel availability.
* \return a vendor-specific mapping string
*/
virtual std::string get_frontend_mapping() const = 0;
/*!
* Query a dictionary of available channel information.
* This dictionary can any number of values like
* decoder type, version, available functions...
* This information can be displayed to the user
* to help identify the instantiated channel.
* \param channel an available channel on the device
* \return channel information
*/
virtual kwargs_t get_channel_info(size_t channel) const = 0;
/*!
* Set sample rate
* \param channel an available channel
* \param sample_rate samples per second
*/
virtual void set_sample_rate(size_t channel, double sample_rate) = 0;
/*!
* Get the baseband sample rate of the RX chain.
* \param channel an available channel on the device
* \return the sample rate in samples per second
*/
virtual double get_sample_rate(size_t channel) const = 0;
/*!
* Get the range of possible baseband sample rates.
* \param channel an available channel on the device
* \return a list of sample rate ranges in samples per second
*/
virtual range_list_t get_sample_rate_range(size_t channel) const = 0;
/*!
* Set device center frequency
* \param channel an available channel
* \param freq frequency in Hz
*/
virtual void set_frequency(size_t channel, double freq) = 0;
/*!
* Set center frequency of a tunable element
* \param channel an available channel
* \param name an available element name
* \param freq frequency in Hz
*/
virtual void set_frequency(size_t channel, const std::string& name, double freq) = 0;
/*!
* Get the down conversion frequency of the chain.
* \param channel an available channel on the device
* \return the center frequency in Hz
*/
virtual double get_frequency(size_t channel) const = 0;
/*!
* Get the frequency of a tunable element in the chain.
* \param channel an available channel on the device
* \param name the name of a tunable element
* \return the tunable element's frequency in Hz
*/
virtual double get_frequency(size_t channel, const std::string& name) const = 0;
/*!
* List available tunable elements in the chain.
* Elements should be in order RF to baseband.
* \param channel an available channel
* \return a list of tunable elements by name
*/
virtual std::vector<std::string> list_frequencies(size_t channel) const = 0;
/*!
* Get the range of overall frequency values.
* \param channel an available channel on the device
* \return a list of frequency ranges in Hz
*/
virtual range_list_t get_frequency_range(size_t channel) const = 0;
/*!
* Get the range of tunable values for the specified element.
* \param channel an available channel on the device
* \param name the name of a tunable element
* \return a list of frequency ranges in Hz
*/
virtual range_list_t get_frequency_range(size_t channel,
const std::string& name) const = 0;
/*!
* Query the argument info description for stream args.
* \param channel an available channel on the device
* \return a list of argument info structures
*/
virtual arginfo_list_t get_frequency_args_info(size_t channel) const = 0;
/*!
* Set filter bandwidth
* \param channel an available channel
* \param bandwidth filter width in Hz
*/
virtual void set_bandwidth(size_t channel, double bandwidth) = 0;
/*!
* Get baseband filter width of the RX chain.
* \param channel an available channel on the device
* \return the baseband filter width in Hz
*/
virtual double get_bandwidth(size_t channel) const = 0;
/*!
* Get the range of possible baseband filter widths.
* \param channel an available channel on the device
* \return a list of bandwidth ranges in Hz
*/
virtual range_list_t get_bandwidth_range(size_t channel) const = 0;
/*!
* List available antennas for a channel
* @param channel channel index
* @return available antenna names
*/
virtual std::vector<std::string> list_antennas(int channel) const = 0;
/*!
* Set antenna for channel
* \param channel an available channel
* \param name an available antenna string name
*/
virtual void set_antenna(size_t channel, const std::string& name) = 0;
/*!
* Get the selected antenna on RX chain.
* \param channel an available channel on the device
* \return the name of the selected antenna
*/
virtual std::string get_antenna(size_t channel) const = 0;
/*!
* Return whether automatic gain control (AGC) is supported
* \param channel an available channel
*/
virtual bool has_gain_mode(size_t channel) const = 0;
/*!
* Set automatic gain control (AGC)
* \param channel an available channel
* \param enable true to enable AGC
*/
virtual void set_gain_mode(size_t channel, bool enable) = 0;
/*!
* Get the automatic gain mode on the RX chain.
* \param channel an available channel on the device
* \return true for automatic gain setting
*/
virtual bool get_gain_mode(size_t channel) const = 0;
/*!
* List available amplification elements.
* Elements should be in order RF to baseband.
* \param channel an available channel
* \return a list of gain string names
*/
virtual std::vector<std::string> list_gains(size_t channel) const = 0;
/*!
* Set overall gain
* The gain will be distributed automatically across available
* elements according to Soapy API.
* \param channel an available channel
* \param gain overall gain value
*/
virtual void set_gain(size_t channel, double gain) = 0;
/*!
* Set specific gain value
* \param channel an available channel
* \param name gain name to set
* \param gain gain value
*/
virtual void set_gain(size_t channel, const std::string& name, double gain) = 0;
/*!
* Get the overall value of the gain elements in a chain
* \param channel an available channel on the device
* \return the value of the gain in dB
*/
virtual double get_gain(size_t channel) const = 0;
/*!
* Get the value of an individual amplification element in a chain.
* \param channel an available channel on the device
* \param name the name of an amplification element
* \return the value of the gain in dB
*/
virtual double get_gain(size_t channel, const std::string& name) const = 0;
/*!
* Get the overall range of possible gain values.
* \param channel an available channel on the device
* \return a list of gain ranges in dB
*/
virtual range_t get_gain_range(size_t channel) const = 0;
/*!
* Get the range of possible gain values for a specific element.
* \param channel an available channel on the device
* \param name the name of an amplification element
* \return a list of gain ranges in dB
*/
virtual range_t get_gain_range(size_t channel, const std::string& name) const = 0;
/*!
* Return whether frequency correction is supported
* \param channel an available channel
*/
virtual bool has_frequency_correction(size_t channel) const = 0;
/*!
* Set frequency correction
* \param channel an available channel
* \param freq_correction in PPM
*/
virtual void set_frequency_correction(size_t channel, double freq_correction) = 0;
/*!
* Get the frequency correction value.
* \param channel an available channel on the device
* \return the correction value in PPM
*/
virtual double get_frequency_correction(size_t channel) const = 0;
/*!
* Return whether DC offset mode can be set
* \param channel an available channel
*/
virtual bool has_dc_offset_mode(size_t channel) const = 0;
/*!
* Set DC offset mode
* \param channel an available channel
* \param automatic true to set automatic DC removal
*/
virtual void set_dc_offset_mode(size_t channel, bool automatic) = 0;
/*!
* Get the automatic DC offset correction mode.
* \param channel an available channel on the device
* \return true for automatic offset correction
*/
virtual bool get_dc_offset_mode(size_t channel) const = 0;
/*!
* Return whether manual dc offset correction is supported
* \param channel an available channel
*/
virtual bool has_dc_offset(size_t channel) const = 0;
/*!
* Set dc offset correction
* \param channel an available channel
* \param dc_offset complex dc offset correction
*/
virtual void set_dc_offset(size_t channel, const gr_complexd& dc_offset) = 0;
/*!
* Get the DC offset correction.
* \param channel an available channel on the device
* \return the relative correction (1.0 max)
*/
virtual gr_complexd get_dc_offset(size_t channel) const = 0;
/*!
* Return whether manual IQ balance correction is supported
* \param channel an available channel
*/
virtual bool has_iq_balance(size_t channel) const = 0;
/*!
* Set IQ balance correction
* \param channel an available channel
* \param iq_balance complex iq balance correction
*/
virtual void set_iq_balance(size_t channel, const gr_complexd& iq_balance) = 0;
/*!
* Get the IQ balance correction.
* \param channel an available channel on the device
* \return the relative correction (1.0 max)
*/
virtual gr_complexd get_iq_balance(size_t channel) const = 0;
/*!
* Does the device support automatic frontend IQ balance correction?
* \param channel an available channel on the device
* \return true if IQ balance corrections are supported
*/
virtual bool has_iq_balance_mode(size_t channel) const = 0;
/*!
* Set the automatic frontend IQ balance correction.
* \param channel an available channel on the device
* \param automatic true for automatic correction
*/
virtual void set_iq_balance_mode(size_t channel, bool automatic) = 0;
/*!
* Get the automatic IQ balance corrections mode.
* \param channel an available channel on the device
* \return true for automatic correction
*/
virtual bool get_iq_balance_mode(size_t channel) const = 0;
/*!
* Set master clock rate
* \param clock_rate clock rate in Hz
*/
virtual void set_master_clock_rate(double clock_rate) = 0;
/*!
* Get the master clock rate of the device.
* \return the clock rate in Hz
*/
virtual double get_master_clock_rate() const = 0;
/*!
* Get the range of available master clock rates.
* \return a list of clock rate ranges in Hz
*/
virtual range_list_t get_master_clock_rates() const = 0;
/*!
* Set the reference clock rate of the device.
* \param rate the clock rate in Hz
*/
virtual void set_reference_clock_rate(double rate) = 0;
/*!
* Get the reference clock rate of the device.
* \return the clock rate in Hz
*/
virtual double get_reference_clock_rate() const = 0;
/*!
* Get the range of available reference clock rates.
* \return a list of clock rate ranges in Hz
*/
virtual range_list_t get_reference_clock_rates() const = 0;
/*!
* Get the list of available clock sources.
* \return a list of clock source names
*/
virtual std::vector<std::string> list_clock_sources() const = 0;
/*!
* Set the clock source
* \param clock_source an available clock source
*/
virtual void set_clock_source(const std::string& clock_source) = 0;
/*!
* Get the clock source of the device
* \return the name of the clock source
*/
virtual std::string get_clock_source() const = 0;
/*!
* Get the list of available time sources.
* \return a list of time source names
*/
virtual std::vector<std::string> list_time_sources() const = 0;
/*!
* Set the time source on the device
* \param source the name of a time source
*/
virtual void set_time_source(const std::string& source) = 0;
/*!
* Get the time source of the device
* \return the name of a time source
*/
virtual std::string get_time_source() const = 0;
/*!
* Does this device have a hardware clock?
* \param what optional argument
* \return true if the hardware clock exists
*/
virtual bool has_hardware_time(const std::string& what = "") const = 0;
/*!
* Read the time from the hardware clock on the device.
* The what argument can refer to a specific time counter.
* \param what optional argument
* \return the time in nanoseconds
*/
virtual long long get_hardware_time(const std::string& what = "") const = 0;
/*!
* Write the time to the hardware clock on the device.
* The what argument can refer to a specific time counter.
* \param timeNs time in nanoseconds
* \param what optional argument
*/
virtual void set_hardware_time(long long timeNs, const std::string& what = "") = 0;
/*!
* List the available global readback sensors.
* A sensor can represent a reference lock, RSSI, temperature.
* \return a list of available sensor string names
*/
virtual std::vector<std::string> list_sensors() const = 0;
/*!
* Get meta-information about a sensor.
* Example: displayable name, type, range.
* \param key the ID name of an available sensor
* \return meta-information about a sensor
*/
virtual arginfo_t get_sensor_info(const std::string& key) const = 0;
/*!
* Readback a global sensor given the name.
* The value returned is a string which can represent
* a boolean ("true"/"false"), an integer, or float.
* \param key the ID name of an available sensor
* \return the current value of the sensor
*/
virtual std::string read_sensor(const std::string& key) const = 0;
/*!
* List the available channel readback sensors.
* A sensor can represent a reference lock, RSSI, temperature.
* \param channel an available channel on the device
* \return a list of available sensor string names
*/
virtual std::vector<std::string> list_sensors(size_t channel) const = 0;
/*!
* Get meta-information about a channel sensor.
* Example: displayable name, type, range.
* \param channel an available channel on the device
* \param key the ID name of an available sensor
* \return meta-information about a sensor
*/
virtual arginfo_t get_sensor_info(size_t channel, const std::string& key) const = 0;
/*!
* Readback a channel sensor given the name.
* The value returned is a string which can represent
* a boolean ("true"/"false"), an integer, or float.
* \param channel an available channel on the device
* \param key the ID name of an available sensor
* \return the current value of the sensor
*/
virtual std::string read_sensor(size_t channel, const std::string& key) const = 0;
/*!
* Get a list of available register interfaces by name.
* \return a list of available register interfaces
*/
virtual std::vector<std::string> list_register_interfaces() const = 0;
/*!
* Write a register on the device given the interface name.
* This can represent a register on a soft CPU, FPGA, IC;
* the interpretation is up the implementation to decide.
* \param name the name of a available register interface
* \param addr the register address
* \param value the register value
*/
virtual void
write_register(const std::string& name, unsigned addr, unsigned value) = 0;
/*!
* Read a register on the device given the interface name.
* \param name the name of a available register interface
* \param addr the register address
* \return the register value
*/
virtual unsigned read_register(const std::string& name, unsigned addr) const = 0;
/*!
* Write a memory block on the device given the interface name.
* This can represent a memory block on a soft CPU, FPGA, IC;
* the interpretation is up the implementation to decide.
* \param name the name of a available memory block interface
* \param addr the memory block start address
* \param value the memory block content
*/
virtual void write_registers(const std::string& name,
unsigned addr,
const std::vector<unsigned>& value) = 0;
/*!
* Read a memory block on the device given the interface name.
* \param name the name of a available memory block interface
* \param addr the memory block start address
* \param length number of words to be read from memory block
* \return the memory block content
*/
virtual std::vector<unsigned>
read_registers(const std::string& name, unsigned addr, size_t length) const = 0;
/*!
* Describe the allowed keys and values used for settings.
* \return a list of argument info structures
*/
virtual arginfo_list_t get_setting_info() const = 0;
/*!
* Write an arbitrary setting on the device.
* The interpretation is up the implementation.
* \param key the setting identifier
* \param value the setting value
*/
virtual void write_setting(const std::string& key, const std::string& value) = 0;
/*!
* Read an arbitrary setting on the device.
* \param key the setting identifier
* \return the setting value
*/
virtual std::string read_setting(const std::string& key) const = 0;
/*!
* Describe the allowed keys and values used for channel settings.
* \param channel an available channel on the device
* \return a list of argument info structures
*/
virtual arginfo_list_t get_setting_info(size_t channel) const = 0;
/*!
* Write an arbitrary channel setting on the device.
* The interpretation is up the implementation.
* \param channel an available channel on the device
* \param key the setting identifier
* \param value the setting value
*/
virtual void
write_setting(size_t channel, const std::string& key, const std::string& value) = 0;
/*!
* Read an arbitrary channel setting on the device.
* \param channel an available channel on the device
* \param key the setting identifier
* \return the setting value
*/
virtual std::string read_setting(size_t channel, const std::string& key) const = 0;
/*!
* Get a list of available GPIO banks by name.
*/
virtual std::vector<std::string> list_gpio_banks() const = 0;
/*!
* Write the value of a GPIO bank.
* \param bank the name of an available bank
* \param value an integer representing GPIO bits
*/
virtual void write_gpio(const std::string& bank, unsigned value) = 0;
/*!
* Write the value of a GPIO bank with modification mask.
* \param bank the name of an available bank
* \param value an integer representing GPIO bits
* \param mask a modification mask where 1 = modify
*/
virtual void write_gpio(const std::string& bank, unsigned value, unsigned mask) = 0;
/*!
* Readback the value of a GPIO bank.
* \param bank the name of an available bank
* \return an integer representing GPIO bits
*/
virtual unsigned read_gpio(const std::string& bank) const = 0;
/*!
* Write the data direction of a GPIO bank.
* 1 bits represent outputs, 0 bits represent inputs.
* \param bank the name of an available bank
* \param dir an integer representing data direction bits
*/
virtual void write_gpio_dir(const std::string& bank, unsigned dir) = 0;
/*!
* Write the data direction of a GPIO bank with modification mask.
* 1 bits represent outputs, 0 bits represent inputs.
* \param bank the name of an available bank
* \param dir an integer representing data direction bits
* \param mask a modification mask where 1 = modify
*/
virtual void write_gpio_dir(const std::string& bank, unsigned dir, unsigned mask) = 0;
/*!
* Read the data direction of a GPIO bank.
* 1 bits represent outputs, 0 bits represent inputs.
* \param bank the name of an available bank
* \return an integer representing data direction bits
*/
virtual unsigned read_gpio_dir(const std::string& bank) const = 0;
/*!
* Write to an available I2C slave.
* If the device contains multiple I2C masters,
* the address bits can encode which master.
* \param addr the address of the slave
* \param data an array of bytes write out
*/
virtual void write_i2c(int addr, const std::string& data) = 0;
/*!
* Read from an available I2C slave.
* If the device contains multiple I2C masters,
* the address bits can encode which master.
* \param addr the address of the slave
* \param num_bytes the number of bytes to read
* \return an array of bytes read from the slave
*/
virtual std::string read_i2c(int addr, size_t num_bytes) = 0;
/*!
* Perform a SPI transaction and return the result.
* Its up to the implementation to set the clock rate,
* and read edge, and the write edge of the SPI core.
* SPI slaves without a readback pin will return 0.
*
* If the device contains multiple SPI masters,
* the address bits can encode which master.
*
* \param addr an address of an available SPI slave
* \param data the SPI data, num_bits-1 is first out
* \param num_bits the number of bits to clock out
* \return the readback data, num_bits-1 is first in
*/
virtual unsigned transact_spi(int addr, unsigned data, size_t num_bits) = 0;
/*!
* Enumerate the available UART devices.
* \return a list of names of available UARTs
*/
virtual std::vector<std::string> list_uarts() const = 0;
/*!
* Write data to a UART device.
* Its up to the implementation to set the baud rate,
* carriage return settings, flushing on newline.
* \param which the name of an available UART
* \param data an array of bytes to write out
*/
virtual void write_uart(const std::string& which, const std::string& data) = 0;
/*!
* Read bytes from a UART until timeout or newline.
* Its up to the implementation to set the baud rate,
* carriage return settings, flushing on newline.
* \param which the name of an available UART
* \param timeout_us a timeout in microseconds
* \return an array of bytes read from the UART
*/
virtual std::string read_uart(const std::string& which,
long timeout_us = 100000) const = 0;
};
} // namespace soapy
} // namespace gr
#endif /* INCLUDED_GR_SOAPY_BLOCK_H */

Wyświetl plik

@ -0,0 +1,80 @@
/* -*- c++ -*- */
/*
* Copyright 2021 Jeff Long
* Copyright 2018-2021 Libre Space Foundation <http://libre.space/>
*
* SPDX-License-Identifier: GPL-3.0-or-later
*/
#ifndef INCLUDED_GR_SOAPY_SINK_H
#define INCLUDED_GR_SOAPY_SINK_H
#include <gnuradio/soapy/api.h>
#include <gnuradio/soapy/block.h>
#include <gnuradio/sync_block.h>
#include <cstdint>
#include <string>
#include <vector>
namespace gr {
namespace soapy {
/*!
* \addtogroup block
* \brief <b>Sink</b> block implements SoapySDR functionality for RX.
* \ingroup soapy
* \section sink Soapy Sink
* The soapy sink block receives samples and writes to a stream.
* The sink block also provides Soapy API calls for receiver settings.
* Includes all parameters for full RX implementation.
* Device is a string containing the driver and type name of the
* device the user wants to use according to the Soapy* module
* documentation.
* Make parameters are passed through the xml block.
* Some of the available parameters can be seen at Figure 2
* Antenna and clock source can be left empty and default values
* will be used.
* This block has a message port, which consumes PMT messages.
* For a description of the command syntax, see \ref cmd_handler_t.
*/
class SOAPY_API sink : virtual public block
{
public:
using sptr = std::shared_ptr<sink>;
/*!
* \brief Return a shared_ptr to a new instance of soapy::sink.
*
* To avoid accidental use of raw pointers, soapy::sink's
* constructor is in a private implementation
* class. soapy::sink::make is the public interface for
* creating new instances.
* \param device the device driver and type
* \param type output stream format
* \param nchan number of channels
* \param dev_args device specific arguments
* \param stream_args stream arguments. Same for all enabled channels
* \param tune_args list with tuning specific arguments, one entry for every
* enabled channel, or a single entry to apply to all
* \param other_settings list with general settings, one entry for every
* enabled channel, or a single entry to apply to all. Supports also specific
* gain settings.
*
* Driver name can be any of "uhd", "lime", "airspy",
* "rtlsdr" or others
*/
static sptr make(const std::string& device,
const std::string& type,
size_t nchan,
const std::string& dev_args = "",
const std::string& stream_args = "",
const std::vector<std::string>& tune_args = { "" },
const std::vector<std::string>& other_settings = { "" });
virtual void set_length_tag_name(const std::string& length_tag_name) = 0;
};
} // namespace soapy
} // namespace gr
#endif /* INCLUDED_GR_SOAPY_SINK_H */

Wyświetl plik

@ -0,0 +1,34 @@
/* -*- c++ -*- */
/*
* Copyright 2021 Free Software Foundation, Inc.
*
* This file is part of GNU Radio
*
* SPDX-License-Identifier: GPL-3.0-or-later
*
*/
/* GR-style type aliases for Soapy types exposed in gr-soapy blocks */
#ifndef INCLUDED_GR_SOAPY_TYPES_H
#define INCLUDED_GR_SOAPY_TYPES_H
#include <CaribouLite/Types.hpp>
namespace gr {
namespace soapy {
using arginfo_t = SoapySDR::ArgInfo;
using arginfo_list_t = SoapySDR::ArgInfoList;
using argtype_t = SoapySDR::ArgInfo::Type;
using kwargs_t = SoapySDR::Kwargs;
using kwargs_list_t = SoapySDR::KwargsList;
using range_t = SoapySDR::Range;
using range_list_t = SoapySDR::RangeList;
} // namespace soapy
} // namespace gr
#endif

Wyświetl plik

@ -0,0 +1,78 @@
/* -*- c++ -*- */
/*
* Copyright 2021 Jeff Long
* Copyright 2018-2021 Libre Space Foundation <http://libre.space/>
*
* SPDX-License-Identifier: GPL-3.0-or-later
*/
#ifndef INCLUDED_GR_SOAPY_SOURCE_H
#define INCLUDED_GR_SOAPY_SOURCE_H
#include <gnuradio/soapy/api.h>
#include <gnuradio/soapy/block.h>
#include <gnuradio/sync_block.h>
#include <cstdint>
#include <string>
#include <vector>
namespace gr {
namespace cariboulite {
/*!
* \addtogroup block
* \brief <b>Source</b> block implements SoapySDR functionality for RX.
* \ingroup soapy
* \section source Soapy Source
* The soapy source block receives samples and writes to a stream.
* The source block also provides Soapy API calls for receiver settings.
* Includes all parameters for full RX implementation.
* Device is a string containing the driver and type name of the
* device the user wants to use according to the Soapy* module
* documentation.
* Make parameters are passed through the xml block.
* Some of the available parameters can be seen at Figure 2
* Antenna and clock source can be left empty and default values
* will be used.
* This block has a message port, which consumes PMT messages.
* For a description of the command syntax, see \ref cmd_handler_t.
*/
class CARIBOULITE_API source : virtual public block
{
public:
using sptr = std::shared_ptr<source>;
/*!
* \brief Return a shared_ptr to a new instance of soapy::source.
*
* To avoid accidental use of raw pointers, soapy::source's
* constructor is in a private implementation
* class. soapy::source::make is the public interface for
* creating new instances.
* \param device the device driver and type
* \param type output stream format
* \param nchan number of channels
* \param dev_args device specific arguments
* \param stream_args stream arguments. Same for all enabled channels
* \param tune_args list with tuning specific arguments, one entry for every
* enabled channel, or a single entry to apply to all
* \param other_settings list with general settings, one entry for every
* enabled channel, or a single entry to apply to all. Supports also specific
* gain settings.
*
* Driver name can be any of "uhd", "lime", "airspy",
* "rtlsdr" or others
*/
static sptr make(const std::string& device,
const std::string& type,
size_t nchan,
const std::string& dev_args = "",
const std::string& stream_args = "",
const std::vector<std::string>& tune_args = { "" },
const std::vector<std::string>& other_settings = { "" });
};
} // namespace soapy
} // namespace gr
#endif /* INCLUDED_GR_SOAPY_SOURCE_H */

Wyświetl plik

@ -0,0 +1,73 @@
# Copyright 2011-2021 Free Software Foundation, Inc.
#
# This file was generated by gr_modtool, a tool from the GNU Radio framework
# This file is a part of gr-cariboulite
#
# SPDX-License-Identifier: GPL-3.0-or-later
#
########################################################################
# Setup library
########################################################################
add_library(gnuradio-cariboulite
block_impl.cc
source_impl.cc
sink_impl.cc
)
target_compile_features(gnuradio-soapy PRIVATE ${GR_CXX_VERSION_FEATURE})
target_link_libraries(gnuradio-cariboulite PUBLIC
gnuradio-runtime
${CARIBOULITR_LIBRARIES}
)
if(ENABLE_COMMON_PCH)
target_link_libraries(gnuradio-cariboulite PRIVATE common-precompiled-headers)
endif()
target_include_directories(gnuradio-cariboulite PUBLIC
$<INSTALL_INTERFACE:include>
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/../include>
)
#Add Windows DLL resource file if using MSVC
if (MSVC)
include(${CMAKE_SOURCE_DIR}/cmake/Modules/GrVersion.cmake)
configure_file(
${CMAKE_CURRENT_SOURCE_DIR}/gnuradio-cariboulite.rc.in
${CMAKE_CURRENT_BINARY_DIR}/gnuradio-cariboulite.rc
@ONLY)
target_sources(gnuradio-cariboulite PRIVATE
${CMAKE_CURRENT_BINARY_DIR}/gnuradio-cariboulite.rc
)
endif (MSVC)
if(BUILD_SHARED_LIBS)
GR_LIBRARY_FOO(gnuradio-cariboulite CaribouLite)
endif()
if(ENABLE_TESTING)
include(GrTest)
# If your unit tests require special include paths, add them here
#include_directories()
# List all files that contain Boost.UTF unit tests here
list(APPEND test_cariboulite_sources)
# Anything we need to link to for the unit tests go here
list(APPEND GR_TEST_TARGET_DEPS gnuradio-cariboulite)
if(NOT test_cariboulite_sources)
MESSAGE(STATUS "No C++ unit tests... skipping")
return()
endif(NOT test_cariboulite_sources)
foreach(qa_file ${test_cariboulite_sources})
GR_ADD_CPP_TEST("cariboulite_${qa_file}"
${CMAKE_CURRENT_SOURCE_DIR}/${qa_file}
)
endforeach(qa_file)
endif()

Wyświetl plik

@ -0,0 +1,297 @@
/* -*- c++ -*- */
/*
* Copyright 2021 Jeff Long
* Copyright 2018-2021 Libre Space Foundation <http://libre.space>
*
* SPDX-License-Identifier: GPL-3.0-or-later
*/
#ifndef INCLUDED_GR_SOAPY_BLOCK_IMPL_H
#define INCLUDED_GR_SOAPY_BLOCK_IMPL_H
#include <mutex>
#include <gnuradio/cariboulite/block.h>
#include <SoapySDR/Device.hpp>
#include <SoapySDR/Modules.hpp>
#include <SoapySDR/Registry.hpp>
#include <SoapySDR/Version.hpp>
namespace gr {
namespace soapy {
using cmd_handler_t = std::function<void(pmt::pmt_t, size_t)>;
struct device_deleter {
void operator()(SoapySDR::Device* d) { SoapySDR::Device::unmake(d); }
};
using device_ptr_t = std::unique_ptr<SoapySDR::Device, device_deleter>;
/*!
* \brief Base block implementation for SDR devices.
*/
class block_impl : virtual public block
{
private:
const int d_direction;
const std::string d_dev_str;
const std::string d_args;
size_t d_mtu = 0;
size_t d_nchan;
std::string d_stream_args;
std::vector<size_t> d_channels;
std::string d_soapy_type;
std::map<pmt::pmt_t, cmd_handler_t> d_cmd_handlers;
kwargs_list_t d_tune_args;
void register_msg_cmd_handler(const pmt::pmt_t& cmd, cmd_handler_t handler);
/*!
* \brief Raise std::invalid_argument if channel is invalid
*/
void validate_channel(size_t channel) const;
protected:
block_impl(int direction,
const std::string& device,
const std::string& type,
size_t nchan,
const std::string& dev_args,
const std::string& stream_args,
const std::vector<std::string>& tune_args,
const std::vector<std::string>& other_settings);
block_impl(const block_impl&) = delete;
block_impl(block_impl&&) = delete;
block_impl& operator=(const block_impl&) = delete;
block_impl& operator=(block_impl&&) = delete;
virtual ~block_impl();
std::mutex d_device_mutex;
device_ptr_t d_device;
SoapySDR::Stream* d_stream = nullptr;
static io_signature::sptr args_to_io_sig(const std::string& type, size_t nchan)
{
size_t size = 0;
if (type == "fc32") {
size = 8;
} else if (type == "sc16") {
size = 4;
} else if (type == "sc8") {
size = 2;
} else {
size = 1; /* TODO: this is an error */
}
return io_signature::make(nchan, nchan, size);
}
public:
bool start() override;
bool stop() override;
/*** Begin public API implementation ***/
std::string get_driver_key() const override;
std::string get_hardware_key() const override;
kwargs_t get_hardware_info() const override;
void set_frontend_mapping(const std::string& frontend_mapping) override;
std::string get_frontend_mapping() const override;
kwargs_t get_channel_info(size_t channel) const override;
void set_sample_rate(size_t channel, double sample_rate) override;
double get_sample_rate(size_t channel) const override;
range_list_t get_sample_rate_range(size_t channel) const override;
void set_frequency(size_t channel, double frequency) override;
void
set_frequency(size_t channel, const std::string& name, double frequency) override;
double get_frequency(size_t channel) const override;
double get_frequency(size_t channel, const std::string& name) const override;
std::vector<std::string> list_frequencies(size_t channel) const override;
range_list_t get_frequency_range(size_t channel) const override;
range_list_t get_frequency_range(size_t channel,
const std::string& name) const override;
arginfo_list_t get_frequency_args_info(size_t channel) const override;
void set_bandwidth(size_t channel, double bandwidth) override;
double get_bandwidth(size_t channel) const override;
range_list_t get_bandwidth_range(size_t channel) const override;
std::vector<std::string> list_antennas(int channel) const override;
void set_antenna(size_t channel, const std::string& name) override;
std::string get_antenna(size_t channel) const override;
bool has_gain_mode(size_t channel) const override;
void set_gain_mode(size_t channel, bool enable) override;
bool get_gain_mode(size_t channel) const override;
std::vector<std::string> list_gains(size_t channel) const override;
void set_gain(size_t channel, double gain) override;
void set_gain(size_t channel, const std::string& name, double gain) override;
double get_gain(size_t channel) const override;
double get_gain(size_t channel, const std::string& name) const override;
range_t get_gain_range(size_t channel) const override;
range_t get_gain_range(size_t channel, const std::string& name) const override;
bool has_frequency_correction(size_t channel) const override;
void set_frequency_correction(size_t channel, double freq_correction) override;
double get_frequency_correction(size_t channel) const override;
bool has_dc_offset_mode(size_t channel) const override;
void set_dc_offset_mode(size_t channel, bool automatic) override;
bool get_dc_offset_mode(size_t channel) const override;
bool has_dc_offset(size_t channel) const override;
void set_dc_offset(size_t channel, const gr_complexd& dc_offset) override;
gr_complexd get_dc_offset(size_t channel) const override;
bool has_iq_balance(size_t channel) const override;
void set_iq_balance(size_t channel, const gr_complexd& iq_balance) override;
gr_complexd get_iq_balance(size_t channel) const override;
bool has_iq_balance_mode(size_t channel) const override;
void set_iq_balance_mode(size_t channel, bool automatic) override;
bool get_iq_balance_mode(size_t channel) const override;
void set_master_clock_rate(double clock_rate) override;
double get_master_clock_rate() const override;
range_list_t get_master_clock_rates() const override;
void set_reference_clock_rate(double rate) override;
double get_reference_clock_rate() const override;
range_list_t get_reference_clock_rates() const override;
std::vector<std::string> list_clock_sources() const override;
void set_clock_source(const std::string& clock_source) override;
std::string get_clock_source() const override;
std::vector<std::string> list_time_sources() const override;
void set_time_source(const std::string& source) override;
std::string get_time_source() const override;
bool has_hardware_time(const std::string& what) const override;
long long get_hardware_time(const std::string& what) const override;
void set_hardware_time(long long timeNs, const std::string& what) override;
std::vector<std::string> list_sensors() const override;
arginfo_t get_sensor_info(const std::string& key) const override;
std::string read_sensor(const std::string& key) const override;
std::vector<std::string> list_sensors(size_t channel) const override;
arginfo_t get_sensor_info(size_t channel, const std::string& key) const override;
std::string read_sensor(size_t channel, const std::string& key) const override;
std::vector<std::string> list_register_interfaces() const override;
void write_register(const std::string& name, unsigned addr, unsigned value) override;
unsigned read_register(const std::string& name, unsigned addr) const override;
void write_registers(const std::string& name,
unsigned addr,
const std::vector<unsigned>& value) override;
std::vector<unsigned>
read_registers(const std::string& name, unsigned addr, size_t length) const override;
virtual arginfo_list_t get_setting_info() const override;
virtual void write_setting(const std::string& key, const std::string& value) override;
virtual std::string read_setting(const std::string& key) const override;
virtual arginfo_list_t get_setting_info(size_t channel) const override;
virtual void write_setting(size_t channel,
const std::string& key,
const std::string& value) override;
virtual std::string read_setting(size_t channel,
const std::string& key) const override;
std::vector<std::string> list_gpio_banks() const override;
void write_gpio(const std::string& bank, unsigned value) override;
void write_gpio(const std::string& bank, unsigned value, unsigned mask) override;
unsigned read_gpio(const std::string& bank) const override;
void write_gpio_dir(const std::string& bank, unsigned dir) override;
void write_gpio_dir(const std::string& bank, unsigned dir, unsigned mask) override;
unsigned read_gpio_dir(const std::string& bank) const override;
void write_i2c(int addr, const std::string& data) override;
std::string read_i2c(int addr, size_t num_bytes) override;
unsigned transact_spi(int addr, unsigned data, size_t num_bits) override;
std::vector<std::string> list_uarts() const override;
void write_uart(const std::string& which, const std::string& data) override;
std::string read_uart(const std::string& which, long timeout_us) const override;
/*** End public API implementation ***/
protected:
/*** Begin message handlers ***/
/*!
* Calls the correct message handler according to the received message symbol.
* A dictionary with key the handler name is used in order to call the
* corresponding handler.
* \param msg a PMT dictionary
*/
void msg_handler_cmd(pmt::pmt_t msg);
/*!
* Set the center frequency of the RX chain.
* @param val center frequency in Hz
* @param channel an available channel on the device
*/
void cmd_handler_frequency(pmt::pmt_t val, size_t channel);
/*!
* Set the overall gain for the specified chain.
* The gain will be distributed automatically across available
* elements according to Soapy API.
* @param val the new amplification value in dB
* @param channel an available channel on the device
*/
void cmd_handler_gain(pmt::pmt_t val, size_t channel);
/*!
* Set the baseband sample rate for the RX chain.
* @param val the sample rate samples per second
* @param channel an available channel on the device
*/
void cmd_handler_samp_rate(pmt::pmt_t val, size_t channel);
/*!
* Set the baseband filter width for the RX chain.
* @param val baseband filter width in Hz
* @param channel an available channel on the device
*/
void cmd_handler_bw(pmt::pmt_t val, size_t channel);
/*!
* Set the anntena element for the RX chain.
* @param val name of the anntena
* @param channel an available channel on the device
*/
void cmd_handler_antenna(pmt::pmt_t val, size_t channel);
void cmd_handler_gain_mode(pmt::pmt_t val, size_t channel);
void cmd_handler_frequency_correction(pmt::pmt_t val, size_t channel);
void cmd_handler_dc_offset_mode(pmt::pmt_t val, size_t channel);
void cmd_handler_dc_offset(pmt::pmt_t val, size_t channel);
void cmd_handler_iq_balance(pmt::pmt_t val, size_t channel);
void cmd_handler_iq_balance_mode(pmt::pmt_t val, size_t channel);
void cmd_handler_master_clock_rate(pmt::pmt_t val, size_t);
void cmd_handler_reference_clock_rate(pmt::pmt_t val, size_t);
void cmd_handler_clock_source(pmt::pmt_t val, size_t);
void cmd_handler_time_source(pmt::pmt_t val, size_t);
void cmd_handler_hardware_time(pmt::pmt_t val, size_t);
void cmd_handler_register(pmt::pmt_t val, size_t);
void cmd_handler_registers(pmt::pmt_t val, size_t);
void cmd_handler_setting(pmt::pmt_t val, size_t channel);
void cmd_handler_gpio(pmt::pmt_t val, size_t);
void cmd_handler_gpio_dir(pmt::pmt_t val, size_t);
void cmd_handler_i2c(pmt::pmt_t val, size_t);
void cmd_handler_uart(pmt::pmt_t val, size_t);
/*** End message handlers ***/
};
} // namespace soapy
} // namespace gr
#endif /* INCLUDED_GR_SOAPY_BLOCK_IMPL_H */

Wyświetl plik

@ -0,0 +1,43 @@
/* -*- c++ -*- */
/*
* Copyright 2013 Free Software Foundation, Inc.
*
* This file is part of GNU Radio
*
* SPDX-License-Identifier: GPL-3.0-or-later
*
*/
#include <afxres.h>
VS_VERSION_INFO VERSIONINFO
FILEVERSION @MAJOR_VERSION@,@API_COMPAT@,@RC_MINOR_VERSION@,@RC_MAINT_VERSION@
PRODUCTVERSION @MAJOR_VERSION@,@API_COMPAT@,@RC_MINOR_VERSION@,@RC_MAINT_VERSION@
FILEFLAGSMASK 0x3fL
#ifndef NDEBUG
FILEFLAGS 0x0L
#else
FILEFLAGS 0x1L
#endif
FILEOS VOS__WINDOWS32
FILETYPE VFT_DLL
FILESUBTYPE VFT2_DRV_INSTALLABLE
BEGIN
BLOCK "StringFileInfo"
BEGIN
BLOCK "040904b0"
BEGIN
VALUE "FileDescription", "gnuradio-cariboulite"
VALUE "FileVersion", "@VERSION@"
VALUE "InternalName", "gnuradio-cariboulite.dll"
VALUE "LegalCopyright", "Licensed under GPLv3 or any later version"
VALUE "OriginalFilename", "gnuradio-cariboulite.dll"
VALUE "ProductName", "gnuradio-cariboulite"
VALUE "ProductVersion", "@VERSION@"
END
END
BLOCK "VarFileInfo"
BEGIN
VALUE "Translation", 0x409, 1200
END
END

Wyświetl plik

@ -0,0 +1,87 @@
/*
* Copyright 2021 Nicholas Corgan
* SPDX-License-Identifier: GPL-3.0-or-later
*/
#ifndef INCLUDED_GR_SOAPY_SETTING_STRING_CONVERSION_H
#define INCLUDED_GR_SOAPY_SETTING_STRING_CONVERSION_H
#include <SoapySDR/Types.hpp>
#include <SoapySDR/Version.h>
#include <sstream>
namespace gr {
namespace soapy {
// SoapySDR doesn't have an API define for SettingToString, so we need
// to check the version. 0.8 is the first tagged version to have this
// functionality.
#if SOAPY_SDR_API_VERSION >= 0x080000
template <typename T>
static inline T string_to_setting(const std::string& str)
{
return SoapySDR::StringToSetting<T>(str);
}
template <typename T>
static inline std::string setting_to_string(const T& setting)
{
return SoapySDR::SettingToString<T>(setting);
}
#else
// Copied from SoapySDR 0.8
#define SOAPY_SDR_TRUE "true"
#define SOAPY_SDR_FALSE "false"
template <typename T>
static inline T string_to_setting(const std::string& str)
{
std::stringstream sstream(str);
T setting;
sstream >> setting;
return setting;
}
// Copied from SoapySDR 0.8
//! convert empty and "false" strings to false, integers to their truthness
template <>
inline bool string_to_setting<bool>(const std::string& str)
{
if (str.empty() || str == SOAPY_SDR_FALSE) {
return false;
}
if (str == SOAPY_SDR_TRUE) {
return true;
}
try {
return static_cast<bool>(std::stod(str));
} catch (std::invalid_argument& e) {
}
// other values are true
return true;
}
template <typename T>
static inline std::string setting_to_string(const T& setting)
{
return std::to_string(setting);
}
template <>
inline std::string setting_to_string<bool>(const bool& setting)
{
return setting ? SOAPY_SDR_TRUE : SOAPY_SDR_FALSE;
}
#endif
} // namespace soapy
} // namespace gr
#endif /* INCLUDED_GR_SOAPY_SETTING_STRING_CONVERSION_H */

Wyświetl plik

@ -0,0 +1,137 @@
/* -*- c++ -*- */
/*
* Copyright 2021 Jeff Long
* Copyright 2018-2021 Libre Space Foundation <http://libre.space>
*
* SPDX-License-Identifier: GPL-3.0-or-later
*/
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include "sink_impl.h"
#include <SoapySDR/Errors.hpp>
#include <iostream>
namespace gr {
namespace soapy {
sink::sptr sink::make(const std::string& device,
const std::string& type,
size_t nchan,
const std::string& dev_args,
const std::string& stream_args,
const std::vector<std::string>& tune_args,
const std::vector<std::string>& other_settings)
{
return gnuradio::make_block_sptr<sink_impl>(
device, type, nchan, dev_args, stream_args, tune_args, other_settings);
}
sink_impl::sink_impl(const std::string& device,
const std::string& type,
size_t nchan,
const std::string& dev_args,
const std::string& stream_args,
const std::vector<std::string>& tune_args,
const std::vector<std::string>& other_settings)
: gr::block("sink", args_to_io_sig(type, nchan), gr::io_signature::make(0, 0, 0)),
block_impl(SOAPY_SDR_TX,
device,
type,
nchan,
dev_args,
stream_args,
tune_args,
other_settings)
{
}
void sink_impl::set_length_tag_name(const std::string& length_tag_name)
{
d_length_tag_key = pmt::mp(length_tag_name);
}
int sink_impl::general_work(__GR_ATTR_UNUSED int noutput_items,
gr_vector_int& ninput_items,
gr_vector_const_void_star& input_items,
__GR_ATTR_UNUSED gr_vector_void_star& output_items)
{
int nin = ninput_items[0];
long long int time_ns = 0;
int nconsumed = 0;
int nwrite = nin;
int flags = 0;
// TODO: optimization: add loop to handle portions of more than one burst
// per call.
// If using tagged bursts
if (!pmt::is_null(d_length_tag_key)) {
// If there are any length tags in the window, look at the first one only.
std::vector<tag_t> length_tags;
get_tags_in_window(length_tags, 0, 0, nin, d_length_tag_key);
auto tag = length_tags.begin();
if (tag != length_tags.end()) {
long offset = tag->offset - nitems_read(0);
// Current burst is done, new tag follows immediately.
if (d_burst_remaining == 0 && offset == 0) {
d_burst_remaining = pmt::to_long(tag->value);
}
// A length tag appears before the end of the current burst, alert
// user of tag preemption. This may mean that samples have been
// dropped somewhere. Adjust d_burst_remaining to end before tag.
// The remaining samples in the current burst will still be written.
else if (offset < d_burst_remaining) {
std::cerr << "tP" << std::flush;
d_burst_remaining = offset;
}
}
// No samples remaining in burst means there was a tag gap. Alert user
// and consume samples.
if (d_burst_remaining == 0) {
std::cerr << "tG" << std::flush;
nconsumed += nin;
}
nwrite = std::min<long>(d_burst_remaining, nin);
// If a burst is active, check if we finish it on this call
if (d_burst_remaining == nwrite) {
flags |= SOAPY_SDR_END_BURST;
}
}
int result = 0;
if (nwrite != 0) {
// No command handlers while writing
std::lock_guard<std::mutex> l(d_device_mutex);
result =
d_device->writeStream(d_stream, input_items.data(), nwrite, flags, time_ns);
}
if (result >= 0) {
nconsumed += result;
if (d_burst_remaining > 0) {
d_burst_remaining -= result;
}
} else if (result == SOAPY_SDR_UNDERFLOW) {
std::cerr << "sU" << std::flush;
} else {
d_logger->warn("Soapy sink error: {:s}", SoapySDR::errToStr(result));
}
consume_each(nconsumed);
return 0;
}
} /* namespace soapy */
} /* namespace gr */

Wyświetl plik

@ -0,0 +1,57 @@
/* -*- c++ -*- */
/*
* Copyright 2021 Jeff Long
* Copyright 2018-2021 Libre Space Foundation <http://libre.space>
*
* SPDX-License-Identifier: GPL-3.0-or-later
*/
#ifndef INCLUDED_SOAPY_GR_SINK_IMPL_H
#define INCLUDED_SOAPY_GR_SINK_IMPL_H
#include <functional>
#include "block_impl.h"
#include <gnuradio/io_signature.h>
#include <gnuradio/soapy/sink.h>
#include <SoapySDR/Device.hpp>
#include <SoapySDR/Modules.hpp>
#include <SoapySDR/Registry.hpp>
#include <SoapySDR/Version.hpp>
namespace gr {
namespace soapy {
/*!
* \brief Sink block implementation for SDR devices.
*/
class sink_impl : public sink, public block_impl
{
public:
sink_impl(const std::string& device,
const std::string& type,
size_t nchan,
const std::string& dev_args,
const std::string& stream_args,
const std::vector<std::string>& tune_args,
const std::vector<std::string>& other_settings);
~sink_impl() override{};
int general_work(int noutput_items,
gr_vector_int& ninput_items,
gr_vector_const_void_star& input_items,
gr_vector_void_star& output_items) override;
void set_length_tag_name(const std::string& length_tag_name) override;
private:
pmt::pmt_t d_length_tag_key = pmt::get_PMT_NIL();
long d_burst_remaining;
};
} // namespace soapy
} // namespace gr
#endif /* INCLUDED_SOAPY_GR_SINK_IMPL_H */

Wyświetl plik

@ -0,0 +1,100 @@
/* -*- c++ -*- */
/*
* Copyright 2021 Jeff Long
* Copyright 2018-2021 Libre Space Foundation <http://libre.space>
*
* SPDX-License-Identifier: GPL-3.0-or-later
*/
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include "source_impl.h"
#include <SoapySDR/Errors.hpp>
#include <iostream>
namespace gr {
namespace soapy {
source::sptr source::make(const std::string& device,
const std::string& type,
size_t nchan,
const std::string& dev_args,
const std::string& stream_args,
const std::vector<std::string>& tune_args,
const std::vector<std::string>& other_settings)
{
return gnuradio::make_block_sptr<source_impl>(
device, type, nchan, dev_args, stream_args, tune_args, other_settings);
}
source_impl::source_impl(const std::string& device,
const std::string& type,
size_t nchan,
const std::string& dev_args,
const std::string& stream_args,
const std::vector<std::string>& tune_args,
const std::vector<std::string>& other_settings)
: gr::block("source", gr::io_signature::make(0, 0, 0), args_to_io_sig(type, nchan)),
block_impl(SOAPY_SDR_RX,
device,
type,
nchan,
dev_args,
stream_args,
tune_args,
other_settings)
{
}
int source_impl::general_work(int noutput_items,
__GR_ATTR_UNUSED gr_vector_int& ninput_items,
__GR_ATTR_UNUSED gr_vector_const_void_star& input_items,
gr_vector_void_star& output_items)
{
long long int time_ns = 0;
int flags = 0;
const long timeout_us = 500000; // 0.5 sec
int nout = 0;
for (;;) {
// No command handlers while reading
int result;
{
std::lock_guard<std::mutex> l(d_device_mutex);
result = d_device->readStream(
d_stream, output_items.data(), noutput_items, flags, time_ns, timeout_us);
}
if (result >= 0) {
nout = result;
break;
}
switch (result) {
// Retry on overflow. Data has been lost.
case SOAPY_SDR_OVERFLOW:
std::cerr << "sO" << std::flush;
continue;
// Yield back to scheduler on timeout.
case SOAPY_SDR_TIMEOUT:
break;
// Report and yield back to scheduler on other errors.
default:
d_logger->warn("Soapy source error: {:s}", SoapySDR::errToStr(result));
break;
}
break;
};
return nout;
}
} /* namespace soapy */
} /* namespace gr */

Wyświetl plik

@ -0,0 +1,51 @@
/* -*- c++ -*- */
/*
* Copyright 2021 Jeff Long
* Copyright 2018-2021 Libre Space Foundation <http://libre.space>
*
* SPDX-License-Identifier: GPL-3.0-or-later
*/
#ifndef INCLUDED_GR_SOAPY_SOURCE_IMPL_H
#define INCLUDED_GR_SOAPY_SOURCE_IMPL_H
#include <functional>
#include "block_impl.h"
#include <gnuradio/io_signature.h>
#include <gnuradio/soapy/source.h>
#include <SoapySDR/Device.hpp>
#include <SoapySDR/Modules.hpp>
#include <SoapySDR/Registry.hpp>
#include <SoapySDR/Version.hpp>
namespace gr {
namespace soapy {
/*!
* \brief Source block implementation for SDR devices.
*/
class source_impl : public source, public block_impl
{
public:
source_impl(const std::string& device,
const std::string& type,
size_t nchan,
const std::string& dev_args,
const std::string& stream_args,
const std::vector<std::string>& tune_args,
const std::vector<std::string>& other_settings);
~source_impl() override{};
int general_work(int noutput_items,
gr_vector_int& ninput_items,
gr_vector_const_void_star& input_items,
gr_vector_void_star& output_items) override;
};
} // namespace soapy
} // namespace gr
#endif /* INCLUDED_GR_SOAPY_SOURCE_IMPL_H */

Wyświetl plik

@ -0,0 +1,41 @@
# Copyright 2011-2021 Free Software Foundation, Inc.
#
# This file was generated by gr_modtool, a tool from the GNU Radio framework
# This file is a part of gr-cariboulite
#
# SPDX-License-Identifier: GPL-3.0-or-later
#
########################################################################
# Include python install macros
########################################################################
include(GrPython)
########################################################################
# Install python sources
########################################################################
GR_PYTHON_INSTALL(
FILES
__init__.py
DESTINATION ${GR_PYTHON_DIR}/gnuradio/cariboulite
)
########################################################################
# Handle the unit tests
########################################################################
if(ENABLE_TESTING)
set(GR_TEST_TARGET_DEPS "")
set(GR_TEST_LIBRARY_DIRS "")
set(GR_TEST_PYTHON_DIRS
${CMAKE_BINARY_DIR}/gnuradio-runtime/python
)
include(GrTest)
file(GLOB py_qa_test_files "qa_*.py")
foreach(py_qa_test_file ${py_qa_test_files})
get_filename_component(py_qa_test_name ${py_qa_test_file} NAME_WE)
GR_ADD_TEST(${py_qa_test_name} ${QA_PYTHON_EXECUTABLE} -B ${py_qa_test_file})
endforeach(py_qa_test_file)
endif(ENABLE_TESTING)
add_subdirectory(bindings)

Wyświetl plik

@ -0,0 +1,24 @@
#
# Copyright 2008-2021 Free Software Foundation, Inc.
#
# SPDX-License-Identifier: GPL-3.0-or-later
#
# The presence of this file turns this directory into a Python package
'''
This is the GNU Radio CaribouLite module. Place your Python package
description here (python/__init__.py).
'''
import os
# import pybind11 generated symbols into the soapy namespace
try:
from .cariboulite_python import *
except ImportError:
dirname, filename = os.path.split(os.path.abspath(__file__))
__path__.append(os.path.join(dirname, "bindings"))
from .cariboulite_python import *
# import any pure python here
#

Wyświetl plik

@ -0,0 +1,32 @@
# Copyright 2020-2021 Free Software Foundation, Inc.
#
# This file is part of GNU Radio
#
# SPDX-License-Identifier: GPL-3.0-or-later
#
include(GrPybind)
########################################################################
# Python Bindings
########################################################################
# For setting string conversions
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/../../../lib)
list(APPEND soapy_python_files
block_python.cc
soapy_common.cc
soapy_types_python.cc
source_python.cc
sink_python.cc
python_bindings.cc)
GR_PYBIND_MAKE_CHECK_HASH(soapy
../../..
gr::soapy
"${soapy_python_files}")
target_compile_features(soapy_python PRIVATE ${GR_CXX_VERSION_FEATURE})
install(TARGETS soapy_python DESTINATION ${GR_PYTHON_DIR}/gnuradio/soapy COMPONENT pythonapi)

Wyświetl plik

@ -0,0 +1,644 @@
/* -*- c++ -*- */
/*
* Copyright 2020-2021 Free Software Foundation, Inc.
*
* This file is part of GNU Radio
*
* SPDX-License-Identifier: GPL-3.0-or-later
*
*/
/***********************************************************************************/
/* This file is automatically generated using bindtool and can be manually edited */
/* The following lines can be configured to regenerate this file during cmake */
/* If manual edits are made, the following tags should be modified accordingly. */
/* BINDTOOL_GEN_AUTOMATIC(0) */
/* BINDTOOL_USE_PYGCCXML(0) */
/* BINDTOOL_HEADER_FILE(block.h) */
/* BINDTOOL_HEADER_FILE_HASH(6326cce2f22e30ab332ef966343f4a50) */
/***********************************************************************************/
#include "soapy_common.h"
#include <pybind11/complex.h>
#include <pybind11/pybind11.h>
#include <pybind11/stl.h>
namespace py = pybind11;
#include <gnuradio/soapy/block.h>
// pydoc.h is automatically generated in the build directory
#include <block_pydoc.h>
#include <algorithm>
#include <cassert>
// Assumption: we've validated that this key exists,
// probably through get_setting_info.
static gr::soapy::arginfo_t
get_specific_arginfo(const gr::soapy::arginfo_list_t& arginfo_list,
const std::string& key)
{
auto iter = std::find_if(
arginfo_list.begin(),
arginfo_list.end(),
[&key](const gr::soapy::arginfo_t& arginfo) { return (arginfo.key == key); });
assert(iter != arginfo_list.end());
return (*iter);
}
void bind_block(py::module& m)
{
using block = ::gr::soapy::block;
py::class_<block, gr::block, gr::basic_block, std::shared_ptr<block>>(
m, "block", D(block))
.def("set_frontend_mapping",
&block::set_frontend_mapping,
py::arg("frontend_mapping"),
D(block, set_frontend_mapping))
.def("get_frontend_mapping",
&block::get_frontend_mapping,
D(block, get_frontend_mapping))
.def("get_channel_info",
&block::get_channel_info,
py::arg("channel"),
D(block, get_channel_info))
.def("set_sample_rate",
&block::set_sample_rate,
py::arg("channel"),
py::arg("sample_rate"),
D(block, set_sample_rate))
.def("get_sample_rate",
&block::get_sample_rate,
py::arg("channel"),
D(block, get_sample_rate))
.def("get_sample_rate_range",
&block::get_sample_rate_range,
py::arg("channel"),
D(block, get_sample_rate_range))
.def("set_frequency",
(void (block::*)(size_t, double)) & block::set_frequency,
py::arg("channel"),
py::arg("freq"),
D(block, set_frequency, 0))
.def("set_frequency",
(void (block::*)(size_t, const std::string&, double)) & block::set_frequency,
py::arg("channel"),
py::arg("name"),
py::arg("freq"),
D(block, set_frequency, 1))
.def("get_frequency",
(double (block::*)(size_t) const) & block::get_frequency,
py::arg("channel"),
D(block, get_frequency, 0))
.def("get_frequency",
(double (block::*)(size_t, const std::string&) const) & block::get_frequency,
py::arg("channel"),
py::arg("name"),
D(block, get_frequency, 1))
.def("list_frequencies",
&block::list_frequencies,
py::arg("channel"),
D(block, list_frequencies))
.def("get_frequency_range",
(gr::soapy::range_list_t(block::*)(size_t) const) &
block::get_frequency_range,
py::arg("channel"),
D(block, get_frequency_range, 0))
.def("get_frequency_range",
(gr::soapy::range_list_t(block::*)(size_t, const std::string&) const) &
block::get_frequency_range,
py::arg("channel"),
py::arg("name"),
D(block, get_frequency_range, 1))
.def("get_frequency_args_info",
&block::get_frequency_args_info,
py::arg("channel"),
D(block, get_frequency_args_info))
.def("set_bandwidth",
&block::set_bandwidth,
py::arg("channel"),
py::arg("bandwidth"),
D(block, set_bandwidth))
.def("get_bandwidth",
&block::get_bandwidth,
py::arg("channel"),
D(block, get_bandwidth))
.def("get_bandwidth_range",
&block::get_bandwidth_range,
py::arg("channel"),
D(block, get_bandwidth_range))
.def("list_antennas",
&block::list_antennas,
py::arg("channel"),
D(block, list_antennas))
.def("set_antenna",
&block::set_antenna,
py::arg("channel"),
py::arg("name"),
D(block, set_antenna))
.def(
"get_antenna", &block::get_antenna, py::arg("channel"), D(block, get_antenna))
.def("has_gain_mode",
&block::has_gain_mode,
py::arg("channel"),
D(block, has_gain_mode))
.def("set_gain_mode",
&block::set_gain_mode,
py::arg("channel"),
py::arg("automatic"),
D(block, set_gain_mode))
.def("get_gain_mode",
&block::get_gain_mode,
py::arg("channel"),
D(block, get_gain_mode))
.def("list_gains", &block::list_gains, py::arg("channel"), D(block, list_gains))
.def("set_gain",
(void (block::*)(size_t, double)) & block::set_gain,
py::arg("channel"),
py::arg("gain"),
D(block, set_gain, 0))
.def("set_gain",
(void (block::*)(size_t, const std::string&, double)) & block::set_gain,
py::arg("channel"),
py::arg("name"),
py::arg("gain"),
D(block, set_gain, 1))
.def("get_gain",
(double (block::*)(size_t) const) & block::get_gain,
py::arg("channel"),
D(block, get_gain, 0))
.def("get_gain",
(double (block::*)(size_t, const std::string&) const) & block::get_gain,
py::arg("channel"),
py::arg("name"),
D(block, get_gain, 1))
.def("get_gain_range",
(gr::soapy::range_t(block::*)(size_t) const) & block::get_gain_range,
py::arg("channel"),
D(block, get_gain_range, 0))
.def("get_gain_range",
(gr::soapy::range_t(block::*)(size_t, const std::string&) const) &
block::get_gain_range,
py::arg("channel"),
py::arg("name"),
D(block, get_gain_range, 1))
.def("has_frequency_correction",
&block::has_frequency_correction,
py::arg("channel"),
D(block, has_frequency_correction))
.def("set_frequency_correction",
&block::set_frequency_correction,
py::arg("channel"),
py::arg("freq_correction"),
D(block, set_frequency_correction))
.def("get_frequency_correction",
&block::get_frequency_correction,
py::arg("channel"),
D(block, get_frequency_correction))
.def("has_dc_offset_mode",
&block::has_dc_offset_mode,
py::arg("channel"),
D(block, has_dc_offset_mode))
.def("set_dc_offset_mode",
&block::set_dc_offset_mode,
py::arg("channel"),
py::arg("automatic"),
D(block, set_dc_offset_mode))
.def("get_dc_offset_mode",
&block::get_dc_offset_mode,
py::arg("channel"),
D(block, get_dc_offset_mode))
.def("has_dc_offset",
&block::has_dc_offset,
py::arg("channel"),
D(block, has_dc_offset))
.def("set_dc_offset",
&block::set_dc_offset,
py::arg("channel"),
py::arg("dc_offset"),
D(block, set_dc_offset))
.def("get_dc_offset",
&block::get_dc_offset,
py::arg("channel"),
D(block, get_dc_offset))
.def("has_iq_balance",
&block::has_iq_balance,
py::arg("channel"),
D(block, has_iq_balance))
.def("set_iq_balance",
&block::set_iq_balance,
py::arg("channel"),
py::arg("iq_balance"),
D(block, set_iq_balance))
.def("get_iq_balance",
&block::get_iq_balance,
py::arg("channel"),
D(block, get_iq_balance))
.def("has_iq_balance_mode",
&block::has_iq_balance_mode,
py::arg("channel"),
D(block, has_iq_balance_mode))
.def("set_iq_balance_mode",
&block::set_iq_balance_mode,
py::arg("channel"),
py::arg("automatic"),
D(block, set_iq_balance_mode))
.def("get_iq_balance_mode",
&block::get_iq_balance_mode,
py::arg("channel"),
D(block, get_iq_balance_mode))
.def("set_master_clock_rate",
&block::set_master_clock_rate,
py::arg("clock_rate"),
D(block, set_master_clock_rate))
.def("get_master_clock_rate",
&block::get_master_clock_rate,
D(block, get_master_clock_rate))
.def("get_master_clock_rates",
&block::get_master_clock_rates,
D(block, get_master_clock_rate))
.def("set_reference_clock_rate",
&block::set_reference_clock_rate,
py::arg("clock_rate"),
D(block, set_reference_clock_rate))
.def("get_reference_clock_rate",
&block::get_reference_clock_rate,
D(block, get_reference_clock_rate))
.def("get_reference_clock_rates",
&block::get_reference_clock_rates,
D(block, get_reference_clock_rate))
.def("list_clock_sources",
&block::list_clock_sources,
D(block, list_clock_sources))
.def("set_clock_source",
&block::set_clock_source,
py::arg("clock_source"),
D(block, set_clock_source))
.def("get_clock_source", &block::get_clock_source, D(block, get_clock_source))
.def("list_time_sources", &block::list_time_sources, D(block, list_time_sources))
.def("set_time_source",
&block::set_time_source,
py::arg("time_source"),
D(block, set_time_source))
.def("get_time_source", &block::get_time_source, D(block, get_time_source))
.def("has_hardware_time",
&block::has_hardware_time,
py::arg("what") = "",
D(block, has_hardware_time))
.def("set_hardware_time",
&block::set_hardware_time,
py::arg("what") = "",
py::arg("time_ns"),
D(block, set_hardware_time))
.def("get_hardware_time",
&block::get_hardware_time,
py::arg("what") = "",
D(block, get_hardware_time))
.def("list_sensors",
(std::vector<std::string>(block::*)() const) & block::list_sensors,
D(block, list_sensors, 0))
.def("get_sensor_info",
(gr::soapy::arginfo_t(block::*)(const std::string&) const) &
block::get_sensor_info,
py::arg("key"),
D(block, get_sensor_info, 0))
.def(
"read_sensor",
[](const block& self, const std::string& key) -> py::object {
const auto arginfo = self.get_sensor_info(key);
return cast_string_to_arginfo_type(arginfo.type, arginfo.value);
},
py::arg("key"),
D(block, read_sensor, 0))
.def("list_sensors",
(std::vector<std::string>(block::*)(size_t) const) & block::list_sensors,
py::arg("channel"),
D(block, list_sensors, 1))
.def("get_sensor_info",
(gr::soapy::arginfo_t(block::*)(size_t, const std::string&) const) &
block::get_sensor_info,
py::arg("channel"),
py::arg("key"),
D(block, get_sensor_info, 1))
.def(
"read_sensor",
[](const block& self, size_t channel, const std::string& key) -> py::object {
const auto arginfo = self.get_sensor_info(channel, key);
return cast_string_to_arginfo_type(arginfo.type, arginfo.value);
},
py::arg("channel"),
py::arg("key"),
D(block, read_sensor, 1))
.def("list_register_interfaces",
&block::list_register_interfaces,
D(block, list_register_interfaces))
.def("write_register",
&block::write_register,
py::arg("name"),
py::arg("addr"),
py::arg("value"),
D(block, write_register))
.def("read_register",
&block::read_register,
py::arg("name"),
py::arg("addr"),
D(block, read_register))
.def("write_registers",
&block::write_registers,
py::arg("name"),
py::arg("addr"),
py::arg("value"),
D(block, write_registers))
.def("read_registers",
&block::read_registers,
py::arg("name"),
py::arg("addr"),
py::arg("length"),
D(block, read_registers))
.def("get_setting_info",
(gr::soapy::arginfo_list_t(block::*)() const) & block::get_setting_info,
D(block, get_setting_info, 0))
.def(
"write_setting",
[](block& self, const std::string& key, py::object value) -> void {
auto setting_info = cast_pyobject_to_arginfo_string(value);
self.write_setting(key, setting_info.value);
},
py::arg("key"),
py::arg("value"),
D(block, write_setting, 0))
.def(
"read_setting",
[](const block& self, const std::string& key) -> py::object {
const auto setting_info =
get_specific_arginfo(self.get_setting_info(), key);
return cast_string_to_arginfo_type(setting_info.type, setting_info.value);
},
py::arg("key"),
D(block, read_setting, 0))
.def("get_setting_info",
(gr::soapy::arginfo_list_t(block::*)(size_t) const) &
block::get_setting_info,
py::arg("channel"),
D(block, get_setting_info, 0))
.def(
"write_setting",
[](block& self, size_t channel, const std::string& key, py::object value)
-> void {
auto setting_info = cast_pyobject_to_arginfo_string(value);
self.write_setting(channel, key, setting_info.value);
},
py::arg("channel"),
py::arg("key"),
py::arg("value"),
D(block, write_setting, 0))
.def(
"read_setting",
[](const block& self, size_t channel, const std::string& key) -> py::object {
const auto setting_info =
get_specific_arginfo(self.get_setting_info(channel), key);
return cast_string_to_arginfo_type(setting_info.type, setting_info.value);
},
py::arg("channel"),
py::arg("key"),
D(block, read_setting, 0))
.def("list_gpio_banks", &block::list_gpio_banks, D(block, list_gpio_banks))
.def("write_gpio",
(void (block::*)(const std::string&, unsigned)) & block::write_gpio,
py::arg("bank"),
py::arg("value"),
D(block, write_gpio, 0))
.def("write_gpio",
(void (block::*)(const std::string&, unsigned, unsigned)) &
block::write_gpio,
py::arg("bank"),
py::arg("value"),
py::arg("mask"),
D(block, write_gpio, 1))
.def("read_gpio", &block::read_gpio, py::arg("bank"), D(block, read_gpio))
.def("write_gpio_dir",
(void (block::*)(const std::string&, unsigned)) & block::write_gpio_dir,
py::arg("bank"),
py::arg("value"),
D(block, write_gpio_dir, 0))
.def("write_gpio_dir",
(void (block::*)(const std::string&, unsigned, unsigned)) &
block::write_gpio_dir,
py::arg("bank"),
py::arg("value"),
py::arg("mask"),
D(block, write_gpio_dir, 1))
.def("read_gpio_dir",
&block::read_gpio_dir,
py::arg("bank"),
D(block, read_gpio_dir))
.def("write_i2c",
&block::write_i2c,
py::arg("addr"),
py::arg("data"),
D(block, write_i2c))
.def("read_i2c",
&block::read_i2c,
py::arg("addr"),
py::arg("length"),
D(block, read_i2c))
.def("transact_spi",
&block::transact_spi,
py::arg("addr"),
py::arg("data"),
py::arg("num_bits"),
D(block, transact_spi))
.def("list_uarts", &block::list_uarts, D(block, list_uarts))
.def("write_uart",
&block::write_uart,
py::arg("which"),
py::arg("data"),
D(block, write_uart))
.def("read_uart",
&block::read_uart,
py::arg("which"),
py::arg("timeout_us") = 100000,
D(block, read_uart))
;
}

Wyświetl plik

@ -0,0 +1,306 @@
/*
* Copyright 2020-2021 Free Software Foundation, Inc.
*
* This file is part of GNU Radio
*
* SPDX-License-Identifier: GPL-3.0-or-later
*
*/
#include "pydoc_macros.h"
#define D(...) DOC(gr, soapy, __VA_ARGS__)
/*
This file contains placeholders for docstrings for the Python bindings.
Do not edit! These were automatically extracted during the binding process
and will be overwritten during the build process
*/
static const char* __doc_gr_soapy_block = R"doc()doc";
static const char* __doc_gr_soapy_block_block_0 = R"doc()doc";
static const char* __doc_gr_soapy_block_block_1 = R"doc()doc";
static const char* __doc_gr_soapy_block_make = R"doc()doc";
static const char* __doc_gr_soapy_block_get_driver_key = R"doc()doc";
static const char* __doc_gr_soapy_block_get_hardware_key = R"doc()doc";
static const char* __doc_gr_soapy_block_get_hardware_info = R"doc()doc";
static const char* __doc_gr_soapy_block_set_frontend_mapping = R"doc()doc";
static const char* __doc_gr_soapy_block_get_frontend_mapping = R"doc()doc";
static const char* __doc_gr_soapy_block_get_channel_info = R"doc()doc";
static const char* __doc_gr_soapy_block_set_sample_rate = R"doc()doc";
static const char* __doc_gr_soapy_block_get_sample_rate = R"doc()doc";
static const char* __doc_gr_soapy_block_get_sample_rate_range = R"doc()doc";
static const char* __doc_gr_soapy_block_set_frequency_0 = R"doc()doc";
static const char* __doc_gr_soapy_block_set_frequency_1 = R"doc()doc";
static const char* __doc_gr_soapy_block_get_frequency_0 = R"doc()doc";
static const char* __doc_gr_soapy_block_get_frequency_1 = R"doc()doc";
static const char* __doc_gr_soapy_block_list_frequencies = R"doc()doc";
static const char* __doc_gr_soapy_block_get_frequency_range_0 = R"doc()doc";
static const char* __doc_gr_soapy_block_get_frequency_range_1 = R"doc()doc";
static const char* __doc_gr_soapy_block_get_frequency_args_info = R"doc()doc";
static const char* __doc_gr_soapy_block_set_bandwidth = R"doc()doc";
static const char* __doc_gr_soapy_block_get_bandwidth = R"doc()doc";
static const char* __doc_gr_soapy_block_get_bandwidth_range = R"doc()doc";
static const char* __doc_gr_soapy_block_list_antennas = R"doc()doc";
static const char* __doc_gr_soapy_block_set_antenna = R"doc()doc";
static const char* __doc_gr_soapy_block_get_antenna = R"doc()doc";
static const char* __doc_gr_soapy_block_has_gain_mode = R"doc()doc";
static const char* __doc_gr_soapy_block_set_gain_mode = R"doc()doc";
static const char* __doc_gr_soapy_block_get_gain_mode = R"doc()doc";
static const char* __doc_gr_soapy_block_list_gains = R"doc()doc";
static const char* __doc_gr_soapy_block_set_gain_0 = R"doc()doc";
static const char* __doc_gr_soapy_block_set_gain_1 = R"doc()doc";
static const char* __doc_gr_soapy_block_get_gain_0 = R"doc()doc";
static const char* __doc_gr_soapy_block_get_gain_1 = R"doc()doc";
static const char* __doc_gr_soapy_block_get_gain_range_0 = R"doc()doc";
static const char* __doc_gr_soapy_block_get_gain_range_1 = R"doc()doc";
static const char* __doc_gr_soapy_block_has_frequency_correction = R"doc()doc";
static const char* __doc_gr_soapy_block_set_frequency_correction = R"doc()doc";
static const char* __doc_gr_soapy_block_get_frequency_correction = R"doc()doc";
static const char* __doc_gr_soapy_block_has_dc_offset_mode = R"doc()doc";
static const char* __doc_gr_soapy_block_set_dc_offset_mode = R"doc()doc";
static const char* __doc_gr_soapy_block_get_dc_offset_mode = R"doc()doc";
static const char* __doc_gr_soapy_block_has_dc_offset = R"doc()doc";
static const char* __doc_gr_soapy_block_set_dc_offset = R"doc()doc";
static const char* __doc_gr_soapy_block_get_dc_offset = R"doc()doc";
static const char* __doc_gr_soapy_block_has_iq_balance = R"doc()doc";
static const char* __doc_gr_soapy_block_set_iq_balance = R"doc()doc";
static const char* __doc_gr_soapy_block_get_iq_balance = R"doc()doc";
static const char* __doc_gr_soapy_block_has_iq_balance_mode = R"doc()doc";
static const char* __doc_gr_soapy_block_set_iq_balance_mode = R"doc()doc";
static const char* __doc_gr_soapy_block_get_iq_balance_mode = R"doc()doc";
static const char* __doc_gr_soapy_block_set_master_clock_rate = R"doc()doc";
static const char* __doc_gr_soapy_block_get_master_clock_rate = R"doc()doc";
static const char* __doc_gr_soapy_block_get_master_clock_rates = R"doc()doc";
static const char* __doc_gr_soapy_block_set_reference_clock_rate = R"doc()doc";
static const char* __doc_gr_soapy_block_get_reference_clock_rate = R"doc()doc";
static const char* __doc_gr_soapy_block_get_reference_clock_rates = R"doc()doc";
static const char* __doc_gr_soapy_block_list_clock_sources = R"doc()doc";
static const char* __doc_gr_soapy_block_set_clock_source = R"doc()doc";
static const char* __doc_gr_soapy_block_get_clock_source = R"doc()doc";
static const char* __doc_gr_soapy_block_list_time_sources = R"doc()doc";
static const char* __doc_gr_soapy_block_set_time_source = R"doc()doc";
static const char* __doc_gr_soapy_block_get_time_source = R"doc()doc";
static const char* __doc_gr_soapy_block_has_hardware_time = R"doc()doc";
static const char* __doc_gr_soapy_block_get_hardware_time = R"doc()doc";
static const char* __doc_gr_soapy_block_set_hardware_time = R"doc()doc";
static const char* __doc_gr_soapy_block_list_sensors_0 = R"doc()doc";
static const char* __doc_gr_soapy_block_get_sensor_info_0 = R"doc()doc";
static const char* __doc_gr_soapy_block_read_sensor_0 = R"doc()doc";
static const char* __doc_gr_soapy_block_list_sensors_1 = R"doc()doc";
static const char* __doc_gr_soapy_block_get_sensor_info_1 = R"doc()doc";
static const char* __doc_gr_soapy_block_read_sensor_1 = R"doc()doc";
static const char* __doc_gr_soapy_block_list_register_interfaces = R"doc()doc";
static const char* __doc_gr_soapy_block_write_register = R"doc()doc";
static const char* __doc_gr_soapy_block_read_register = R"doc()doc";
static const char* __doc_gr_soapy_block_write_registers = R"doc()doc";
static const char* __doc_gr_soapy_block_read_registers = R"doc()doc";
static const char* __doc_gr_soapy_block_get_setting_info_0 = R"doc()doc";
static const char* __doc_gr_soapy_block_write_setting_0 = R"doc()doc";
static const char* __doc_gr_soapy_block_read_setting_0 = R"doc()doc";
static const char* __doc_gr_soapy_block_get_setting_info_1 = R"doc()doc";
static const char* __doc_gr_soapy_block_write_setting_1 = R"doc()doc";
static const char* __doc_gr_soapy_block_read_setting_1 = R"doc()doc";
static const char* __doc_gr_soapy_block_list_gpio_banks = R"doc()doc";
static const char* __doc_gr_soapy_block_write_gpio_0 = R"doc()doc";
static const char* __doc_gr_soapy_block_write_gpio_1 = R"doc()doc";
static const char* __doc_gr_soapy_block_read_gpio = R"doc()doc";
static const char* __doc_gr_soapy_block_write_gpio_dir_0 = R"doc()doc";
static const char* __doc_gr_soapy_block_write_gpio_dir_1 = R"doc()doc";
static const char* __doc_gr_soapy_block_read_gpio_dir = R"doc()doc";
static const char* __doc_gr_soapy_block_write_i2c = R"doc()doc";
static const char* __doc_gr_soapy_block_read_i2c = R"doc()doc";
static const char* __doc_gr_soapy_block_transact_spi = R"doc()doc";
static const char* __doc_gr_soapy_block_list_uarts = R"doc()doc";
static const char* __doc_gr_soapy_block_write_uart = R"doc()doc";
static const char* __doc_gr_soapy_block_read_uart = R"doc()doc";

Wyświetl plik

@ -0,0 +1,30 @@
/*
* Copyright 2020-2021 Free Software Foundation, Inc.
*
* This file is part of GNU Radio
*
* SPDX-License-Identifier: GPL-3.0-or-later
*
*/
#include "pydoc_macros.h"
#define D(...) DOC(gr, soapy, __VA_ARGS__)
/*
This file contains placeholders for docstrings for the Python bindings.
Do not edit! These were automatically extracted during the binding process
and will be overwritten during the build process
*/
static const char* __doc_gr_soapy_sink = R"doc()doc";
static const char* __doc_gr_soapy_sink_sink_0 = R"doc()doc";
static const char* __doc_gr_soapy_sink_sink_1 = R"doc()doc";
static const char* __doc_gr_soapy_sink_make = R"doc()doc";
static const char* __doc_gr_soapy_sink_set_length_tag_name = R"doc()doc";

Wyświetl plik

@ -0,0 +1,27 @@
/*
* Copyright 2020-2021 Free Software Foundation, Inc.
*
* This file is part of GNU Radio
*
* SPDX-License-Identifier: GPL-3.0-or-later
*
*/
#include "pydoc_macros.h"
#define D(...) DOC(gr, soapy, __VA_ARGS__)
/*
This file contains placeholders for docstrings for the Python bindings.
Do not edit! These were automatically extracted during the binding process
and will be overwritten during the build process
*/
static const char* __doc_gr_soapy_source = R"doc()doc";
static const char* __doc_gr_soapy_source_source_0 = R"doc()doc";
static const char* __doc_gr_soapy_source_source_1 = R"doc()doc";
static const char* __doc_gr_soapy_source_make = R"doc()doc";

Wyświetl plik

@ -0,0 +1,45 @@
/*
* Copyright 2020-2021 Free Software Foundation, Inc.
*
* This file is part of GNU Radio
*
* SPDX-License-Identifier: GPL-3.0-or-later
*
*/
#include <pybind11/pybind11.h>
#define NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION
#include <numpy/arrayobject.h>
namespace py = pybind11;
void bind_soapy_types(py::module& m);
void bind_block(py::module& m);
void bind_source(py::module& m);
void bind_sink(py::module& m);
// We need this hack because import_array() returns NULL
// for newer Python versions.
// This function is also necessary because it ensures access to the C API
// and removes a warning.
void* init_numpy()
{
import_array();
return NULL;
}
PYBIND11_MODULE(soapy_python, m)
{
// Initialize the numpy C API
// (otherwise we will see segmentation faults)
init_numpy();
// Allow access to base block methods
py::module::import("gnuradio.gr");
bind_soapy_types(m);
bind_block(m);
bind_source(m);
bind_sink(m);
}

Wyświetl plik

@ -0,0 +1,55 @@
/* -*- c++ -*- */
/*
* Copyright 2020-2021 Free Software Foundation, Inc.
*
* This file is part of GNU Radio
*
* SPDX-License-Identifier: GPL-3.0-or-later
*
*/
/***********************************************************************************/
/* This file is automatically generated using bindtool and can be manually edited */
/* The following lines can be configured to regenerate this file during cmake */
/* If manual edits are made, the following tags should be modified accordingly. */
/* BINDTOOL_GEN_AUTOMATIC(0) */
/* BINDTOOL_USE_PYGCCXML(0) */
/* BINDTOOL_HEADER_FILE(sink.h) */
/* BINDTOOL_HEADER_FILE_HASH(07be73e41abcd1f8a128bd1ba153ab32) */
/***********************************************************************************/
#include <pybind11/complex.h>
#include <pybind11/pybind11.h>
#include <pybind11/stl.h>
namespace py = pybind11;
#include <gnuradio/soapy/block.h>
#include <gnuradio/soapy/sink.h>
// pydoc.h is automatically generated in the build directory
#include <sink_pydoc.h>
void bind_sink(py::module& m)
{
using sink = ::gr::soapy::sink;
py::class_<sink, gr::soapy::block, gr::block, gr::basic_block, std::shared_ptr<sink>>(
m, "sink", D(sink))
.def(py::init(&sink::make),
py::arg("device"),
py::arg("type"),
py::arg("nchan"),
py::arg("dev_args"),
py::arg("stream_args"),
py::arg("tune_args"),
py::arg("other_settings"),
D(sink, make))
.def("set_length_tag_name",
&sink::set_length_tag_name,
py::arg("length_tag_name"),
D(sink, set_length_tag_name));
}

Wyświetl plik

@ -0,0 +1,61 @@
/*
* Copyright 2021 Free Software Foundation, Inc.
*
* This file is part of GNU Radio
*
* SPDX-License-Identifier: GPL-3.0-or-later
*
*/
#include "setting_string_conversion.h"
#include "soapy_common.h"
#include <SoapySDR/Types.hpp>
#include <SoapySDR/Version.h>
#include <string>
py::object cast_string_to_arginfo_type(gr::soapy::argtype_t argtype,
const std::string& str)
{
py::object ret;
switch (argtype) {
case SoapySDR::ArgInfo::BOOL:
ret = py::bool_(gr::soapy::string_to_setting<bool>(str));
break;
case SoapySDR::ArgInfo::INT:
ret = py::int_(gr::soapy::string_to_setting<int>(str));
break;
case SoapySDR::ArgInfo::FLOAT:
ret = py::float_(gr::soapy::string_to_setting<double>(str));
break;
default:
ret = py::str(str);
break;
}
return ret;
}
setting_info cast_pyobject_to_arginfo_string(py::object obj)
{
setting_info info;
if (py::isinstance<py::bool_>(obj)) {
info.value = gr::soapy::setting_to_string(bool(py::cast<py::bool_>(obj)));
info.type = SoapySDR::ArgInfo::BOOL;
} else if (py::isinstance<py::int_>(obj)) {
info.value = gr::soapy::setting_to_string(int(py::cast<py::int_>(obj)));
info.type = SoapySDR::ArgInfo::INT;
} else if (py::isinstance<py::float_>(obj)) {
info.value = gr::soapy::setting_to_string(double(py::cast<py::float_>(obj)));
info.type = SoapySDR::ArgInfo::FLOAT;
} else {
info.value = py::str(obj);
info.type = SoapySDR::ArgInfo::STRING;
}
return info;
}

Wyświetl plik

@ -0,0 +1,29 @@
/*
* Copyright 2021 Free Software Foundation, Inc.
*
* This file is part of GNU Radio
*
* SPDX-License-Identifier: GPL-3.0-or-later
*
*/
#pragma once
#include <pybind11/complex.h>
#include <pybind11/operators.h>
#include <pybind11/pybind11.h>
#include <pybind11/stl.h>
namespace py = pybind11;
#include <gnuradio/soapy/soapy_types.h>
py::object cast_string_to_arginfo_type(gr::soapy::argtype_t argtype,
const std::string& str);
struct setting_info {
std::string value;
gr::soapy::argtype_t type;
};
setting_info cast_pyobject_to_arginfo_string(py::object obj);

Wyświetl plik

@ -0,0 +1,83 @@
/*
* Copyright 2021 Free Software Foundation, Inc.
*
* This file is part of GNU Radio
*
* SPDX-License-Identifier: GPL-3.0-or-later
*
*/
#include "soapy_common.h"
#include <pybind11/complex.h>
#include <pybind11/operators.h>
#include <pybind11/pybind11.h>
#include <pybind11/stl.h>
namespace py = pybind11;
#include <gnuradio/soapy/soapy_types.h>
void bind_soapy_types(py::module& m)
{
py::class_<gr::soapy::range_t>(m, "range_t")
// Constructors
.def(py::init<>())
.def(py::init<double, double>())
.def(py::init<double, double, double>())
// Methods
.def("minimum", &gr::soapy::range_t::minimum)
.def("maximum", &gr::soapy::range_t::maximum)
.def("step", &gr::soapy::range_t::step)
.def("__str__", [](const gr::soapy::range_t& range) -> std::string {
std::string ret = "(minimum: ";
ret += std::to_string(range.minimum());
ret += ", maximum: ";
ret += std::to_string(range.maximum());
ret += ", step: ";
ret += std::to_string(range.step());
ret += ")";
return ret;
});
py::enum_<gr::soapy::argtype_t>(m, "argtype_t")
.value("BOOL", gr::soapy::arginfo_t::BOOL)
.value("INT", gr::soapy::arginfo_t::INT)
.value("FLOAT", gr::soapy::arginfo_t::FLOAT)
.value("STRING", gr::soapy::arginfo_t::STRING)
.export_values();
py::class_<gr::soapy::arginfo_t>(m, "arginfo_t")
// Constructors
.def(py::init<>())
// Properties
.def_readwrite("key", &gr::soapy::arginfo_t::key)
.def_property(
"value",
[](const gr::soapy::arginfo_t& arginfo) -> py::object {
return cast_string_to_arginfo_type(arginfo.type, arginfo.value);
},
// So we can implicitly convert to Soapy's convention
[](gr::soapy::arginfo_t& arginfo, py::object obj) -> void {
const auto info = cast_pyobject_to_arginfo_string(obj);
arginfo.value = info.value;
arginfo.type = info.type;
})
.def_readwrite("name", &gr::soapy::arginfo_t::name)
.def_readwrite("description", &gr::soapy::arginfo_t::description)
.def_readwrite("units", &gr::soapy::arginfo_t::units)
.def_readwrite("type", &gr::soapy::arginfo_t::type)
.def_readwrite("range", &gr::soapy::arginfo_t::range)
.def_readwrite("options", &gr::soapy::arginfo_t::options)
.def_readwrite("option_names", &gr::soapy::arginfo_t::optionNames)
.def("__str__", [](const gr::soapy::arginfo_t& arginfo) -> std::string {
return (arginfo.key + "=" + arginfo.value);
});
}

Wyświetl plik

@ -0,0 +1,56 @@
/* -*- c++ -*- */
/*
* Copyright 2020-2021 Free Software Foundation, Inc.
*
* This file is part of GNU Radio
*
* SPDX-License-Identifier: GPL-3.0-or-later
*
*/
/***********************************************************************************/
/* This file is automatically generated using bindtool and can be manually edited */
/* The following lines can be configured to regenerate this file during cmake */
/* If manual edits are made, the following tags should be modified accordingly. */
/* BINDTOOL_GEN_AUTOMATIC(0) */
/* BINDTOOL_USE_PYGCCXML(0) */
/* BINDTOOL_HEADER_FILE(source.h) */
/* BINDTOOL_HEADER_FILE_HASH(2ae3163aea8bce7c6a687dda4356f09e) */
/***********************************************************************************/
#include <pybind11/complex.h>
#include <pybind11/pybind11.h>
#include <pybind11/stl.h>
namespace py = pybind11;
#include <gnuradio/soapy/block.h>
#include <gnuradio/soapy/source.h>
// pydoc.h is automatically generated in the build directory
#include <source_pydoc.h>
void bind_source(py::module& m)
{
using source = ::gr::soapy::source;
py::class_<source,
gr::soapy::block,
gr::block,
gr::basic_block,
std::shared_ptr<source>>(m, "source", D(source))
.def(py::init(&source::make),
py::arg("device"),
py::arg("type"),
py::arg("nchan"),
py::arg("dev_args"),
py::arg("stream_args"),
py::arg("tune_args"),
py::arg("other_settings"),
D(source, make))
;
}

Wyświetl plik

@ -0,0 +1,93 @@
#!/usr/bin/env python
#
# Copyright 2021 Free Software Foundation, Inc.
#
# This file is part of GNU Radio
#
# SPDX-License-Identifier: GPL-3.0-or-later
from gnuradio import gr, gr_unittest, blocks
from gnuradio import cariboulite
class test_soapy_types(gr_unittest.TestCase):
def test_range(self):
test_range = cariboulite.range_t()
self.assertAlmostEqual(test_range.minimum(), 0.0, 9)
self.assertAlmostEqual(test_range.maximum(), 0.0, 9)
# Don't check step, uninitialized in old Soapy versions
test_range = cariboulite.range_t(-1.23456, 1.23456)
self.assertAlmostEqual(test_range.minimum(), -1.23456, 9)
self.assertAlmostEqual(test_range.maximum(), 1.23456, 9)
self.assertAlmostEqual(test_range.step(), 0.0, 9)
test_range = cariboulite.range_t(-7.89012, 7.89012, 0.2468)
self.assertAlmostEqual(test_range.minimum(), -7.89012, 9)
self.assertAlmostEqual(test_range.maximum(), 7.89012, 9)
self.assertAlmostEqual(test_range.step(), 0.2468, 9)
def test_arginfo(self):
test_arginfo = cariboulite.arginfo_t()
test_arginfo.key = "testkey"
self.assertEqual(test_arginfo.key, "testkey")
test_arginfo.name = "testname"
self.assertEqual(test_arginfo.name, "testname")
test_arginfo.description = "testdescription"
self.assertEqual(test_arginfo.description, "testdescription")
test_arginfo.units = "testunits"
self.assertEqual(test_arginfo.units, "testunits")
for val in [cariboulite.argtype_t.BOOL, cariboulite.argtype_t.INT, cariboulite.argtype_t.FLOAT, cariboulite.argtype_t.STRING]:
test_arginfo.type = val
self.assertEqual(test_arginfo.type, val)
test_arginfo.range = cariboulite.range_t(1, 2, 0.5)
self.assertAlmostEqual(test_arginfo.range.minimum(), 1, 9)
self.assertAlmostEqual(test_arginfo.range.maximum(), 2, 9)
self.assertAlmostEqual(test_arginfo.range.step(), 0.5, 9)
test_arginfo.options = ["opt1", "opt2", "opt3"]
self.assertEqual(len(test_arginfo.options), 3)
self.assertEqual(test_arginfo.options[0], "opt1")
self.assertEqual(test_arginfo.options[1], "opt2")
self.assertEqual(test_arginfo.options[2], "opt3")
test_arginfo.option_names = ["Option1", "Option2", "Option3"]
self.assertEqual(len(test_arginfo.option_names), 3)
self.assertEqual(test_arginfo.option_names[0], "Option1")
self.assertEqual(test_arginfo.option_names[1], "Option2")
self.assertEqual(test_arginfo.option_names[2], "Option3")
#
# Test all value types
#
test_arginfo.value = "testvalue"
self.assertEqual(test_arginfo.type, cariboulite.argtype_t.STRING)
self.assertEqual(type(test_arginfo.value), str)
self.assertEqual(test_arginfo.value, "testvalue")
test_arginfo.value = False
self.assertEqual(test_arginfo.type, cariboulite.argtype_t.BOOL)
self.assertEqual(type(test_arginfo.value), bool)
self.assertFalse(test_arginfo.value)
test_arginfo.value = 100
self.assertEqual(test_arginfo.type, cariboulite.argtype_t.INT)
self.assertEqual(type(test_arginfo.value), int)
self.assertEqual(test_arginfo.value, 100)
test_arginfo.value = 1.23
self.assertEqual(test_arginfo.type, cariboulite.argtype_t.FLOAT)
self.assertEqual(type(test_arginfo.value), float)
self.assertAlmostEqual(test_arginfo.value, 1.23, 6)
if __name__ == '__main__':
gr_unittest.run(test_soapy_types)