Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
tx_rxtestproxyqueue.put(data)
def rx_receiveroutine():
if rx_testproxyqueue.empty():
return None
else:
return rx_testproxyqueue.get_nowait()
####################################
## Receive
##################################
# Create object
testrxsm = arq.ReceiveArqStateMachine(rx_transmitroutine, rx_receiveroutine)
# Set state machine to START
testrxsm.updatestate(arq.STATE_START)
####################################
## Transmit
##################################
# Create object
testtxsm = arq.TransmitArqStateMachine(tx_transmitroutine, tx_receiveroutine)
####################################
## Operations
##################################
print "Sleeping prior to transmit"
listdata = ['this ', 'is', ' a', ' test', '.']
def transmitroutine(data):
print "Transmitting: ", data
def receiveroutine():
if testrxproxyqueue.empty():
return None
else:
return testrxproxyqueue.get_nowait()
# Create object
testrxsm = arq.ReceiveArqStateMachine(transmitroutine, receiveroutine)
# Set state machine to START
print "Updating to START State"
testrxsm.updatestate(arq.STATE_START)
# Add data to Fake RX Proxy queue
testrxproxyqueue.put_nowait("This")
time.sleep(2)
testrxproxyqueue.put_nowait("is")
time.sleep(1)
testrxproxyqueue.put_nowait("a")
time.sleep(3)
testrxproxyqueue.put_nowait("test")
time.sleep(1)
testrxproxyqueue.put_nowait(".")
def main():
"""
Main function of the transmit example of Hermes messaging application using Flask. This function loops continuously
getting user input text to transmit to the Flask server for wireless transmission to the intended remote device.
"""
# Create ARQ Receive object
testrxsm = arq.ReceiveArqStateMachine(rx_transmitroutine, rx_receiveroutine)
# Set state machine to START
testrxsm.updatestate(arq.STATE_START)