libgs.hardware.GR_XMLRPCRadio¶
-
class
libgs.hardware.GR_XMLRPCRadio(name, stream, rpcaddr, rpc_varmap={}, iqbufflen=1024, connect=True)[source]¶ Class for driving radios over RPC (mainly Gnu radio flowgraphs that include an XMLRPC block)
GNU radio flowgraphs with an XMLRPC block will expose all variables through get_<varname> and set_<varname> rpc calls.
This class uses those calls to set/get spectrum parameters and set/get the range_rate.
- The flowgraph therefore needs to include variables for
- range rate (in m/s)
- centre frequency (in Hz)
- bandwidth (in Hz)
They can be called anything as the variable names can be mapped using the rpc_varmap parameter.
Additionally, the flowgraph needs to publish the raw IQ samples (complex64 type) on a ZMQ port, which can be mapped using this class’s stream parameter
Parameters: - name (string) – A descriptive name for the radio
- stream (string) – The IP:PORT on which to listen for published IQ samples
- rpcaddr (string) – The RPC address (in format http://ip:port) to connect the XMLRPC proxy to
- rpc_varmap – A dict mapping between freq, sample_rate and range_rate to whatever those variables are called in the Gnu Radio flowgraph.
Methods
connect()disconnect()get_range_rate()get_range_rate shoudl return the currently set range_rate get_spectrum([old])get_spectrum should return the latest spectrum from the radio as well as an associated frequency vecgor record_spectrum([dt, N, fdec, add_zeroes])Record N spectra then return them. send_bytes()send_bytes should send a byte sequence to the radio for modulation and transmission set_range_rate(range_rate)set_range_rate should set frequency adjustment for a specific range_rate set_recv_callback(callable)det_recv_callback should set a callable to be invoked when radio receives a packet. Attributes
err_range_rate_geterr_range_rate_setnamerange_rate