How to use the arq.ReceiveArqStateMachine function in arq

To help you get started, we’ve selected a few arq examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github FaradayRF / Faraday-Software / Applications / Hermes / arqtest-tx_rx-threaded.py View on Github external
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"
github FaradayRF / Faraday-Software / Applications / Hermes / arqtest-rx-threaded.py View on Github external
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(".")
github FaradayRF / Faraday-Software / Applications / Hermes / arqtest-rx-hermesflask.py View on Github external
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)