def switch_to_rx(self): # shutdown any existing flowgraphs self.shutdown() # instance an rx flowgraph with current settings self.fg_rx = rx_top.RxTop(rf_params=self.rx_rf_params, bb_params=self.rx_bb_params, tcp_addr=self.tcp.rx, tcp_test=self.tcp.test_rx, sdr_sel=self.sdr_sel) # open zmq socket for payload xfr from rx flowgraph self.rx_zmq = zmu.ZmqPullMsgSocket(self.tcp.rx) self.fg_rx.start()
def __init__(self, init_rf_params, init_bb_params, tcp_tx, tcp_rx): # build flowgraph object with initial params self.fg_tx = tx_top.TxTop(rf_params=init_rf_params, bb_params=init_bb_params, tcp_addr=tcp_tx, tcp_test=zmu.TCP_TEST) # start the flowgraph self.fg_tx.start() # open zmq socket for payload xfr to flowgraph self.tx_zmq = zmu.ZmqPushMsgSocket(tcp_tx) # open zmq socket for payload xfr from rx flowgraph self.rx_zmq = zmu.ZmqPullMsgSocket(tcp_rx) self.downlink_rf_params = init_rf_params self.downlink_bb_params = init_bb_params self.uplink_rf_params = None self.uplink_bb_params = None self.tcp_tx = tcp_tx self.tcp_rx = tcp_rx self.verbose = False
def __init__(self, init_rf_params, init_bb_params, tcp_rx, tcp_tx): # build flowgraph object with initial params self.fg_rx = rx_top.RxTop(init_rf_params, init_bb_params, tcp_rx, zmu.TCP_TEST) # start the flowgraph self.fg_rx.start() # open zmq socket for payload xfr from rx flowgraph self.rx_zmq = zmu.ZmqPullMsgSocket(tcp_rx) # instance a socket for sending tx data to tx flowgraph self.tx_zmq = zmu.ZmqPushMsgSocket(tcp_tx) self.downlink_rf_params = init_rf_params self.downlink_bb_params = init_bb_params self.uplink_rf_params = None self.uplink_bb_params = None self.tcp_rx = tcp_rx self.tcp_tx = tcp_tx self.verbose = False self.cmd_count = 0
################################################## self.msg_connect((self.blocks_tagged_stream_to_pdu_0, 'pdus'), (self.zeromq_push_msg_sink_0, 'in')) self.connect((self.blocks_packed_to_unpacked_xx_0, 0), (self.digital_correlate_access_code_xx_ts_0, 0)) self.connect((self.blocks_repack_bits_bb_0, 0), (self.blocks_tagged_stream_to_pdu_0, 0)) self.connect((self.blocks_throttle_0, 0), (self.blocks_packed_to_unpacked_xx_0, 0)) self.connect((self.blocks_vector_source_x_0, 0), (self.blocks_throttle_0, 0)) self.connect((self.digital_correlate_access_code_xx_ts_0, 0), (self.blocks_repack_bits_bb_0, 0)) if __name__ == "__main__": # instance and start the flowgraph fg = TestFlowgraph() fg.start() # setup the zmq socket socket = zmu.ZmqPullMsgSocket(zmu.TCP_RX_XFIL) # poll the socket and acquire the data for _ in xrange(3): time.sleep(1) read_str = socket.poll_str() print read_str data = socket.poll_bytes() print data
tx_gain=50) bb_params = rfm.BbParams(encoding=rfm.ENC_NRZ, preamble=PREAMBLE_BYTES, symbol_time=SYMBOL_TIME) # instance and start the tx flowgraph fg_tx = tx_top.TxTop(rf_params, bb_params, zmu.TCP_TX_HOST) fg_tx.start() # setup the zmq socket to feed the transmitter tx_zmq = zmu.ZmqPushMsgSocket(zmu.TCP_TX_HOST) # instance and start the rx flowgraph fg_rx = rx_top.RxTop(rf_params, bb_params, zmu.TCP_RX_XFIL) fg_rx.start() # setup the zmq socket to grab data from the receiver rx_zmq = zmu.ZmqPullMsgSocket(zmu.TCP_RX_XFIL) # priming the zmq receive socket (don't understand this fully...) # send some dead air #tx_zmq.send_raw_bytes(10000 * [0]) for i in xrange(8): tx_zmq.send_framed_bytes(preamble=bb_params.preamble_bytes, byte_list=raw_bytes, verbose=False) # send string and byte data while True: time.sleep(1) # transmit the bytes tx_zmq.send_framed_bytes(preamble=bb_params.preamble_bytes, byte_list=raw_bytes,