def switch_to_tx(self): # shutdown receive flowgraph self.shutdown() # instance a tx flowgraph with current uplink settings self.fg_tx = tx_top.TxTop(rf_params=self.tx_rf_params, bb_params=self.tx_bb_params, tcp_addr=self.tcp.tx, tcp_test=self.tcp.test_tx, sdr_sel=self.sdr_sel) # open zmq socket for payload xfr to tx flowgraph self.tx_zmq = zmu.ZmqPushMsgSocket(self.tcp.tx) self.fg_tx.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
fsk_dev=0, psk_const_num=0, rx_gain=50, tx_gain=50 ) bb_params = rfm.BbParams(encoding=rfm.ENC_NRZ, preamble=PREAMBLE_BYTES, symbol_time=SYMBOL_TIME ) # instance and start the flowgraph fg = tx_top.TxTop(rf_params, bb_params, zmu.TCP_TX_HOST) fg.start() # setup the zmq socket msg_push = zmu.ZmqPushMsgSocket(zmu.TCP_TX_HOST) # send string and byte data while True: time.sleep(1) msg_push.send_framed_bytes(preamble=bb_params.preamble_bytes, byte_list=raw_bytes, verbose=True) time.sleep(1) msg_push.send_framed_str(preamble=bb_params.preamble_bytes, in_str="Testing now...", verbose=True) # stop the flowgraph and exit fg.stop() print "Finished Full RX Unit Test"
mod_scheme=rfm.MOD_OOK, threshold=0.5, agc_enable=True, fsk_dev=0, psk_const_num=0, rx_gain=50, 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)