Skip to content

Commit

Permalink
standardize infinite loops
Browse files Browse the repository at this point in the history
  • Loading branch information
morrme committed May 4, 2017
1 parent 2ba04ca commit b94cd04
Show file tree
Hide file tree
Showing 20 changed files with 21 additions and 21 deletions.
2 changes: 1 addition & 1 deletion Applications/Hermes/hermesflaskexample_rx.py
Expand Up @@ -39,7 +39,7 @@ def main():
"""

print "Receiver Started On: ", localcallsign.upper() + '-' + str(localnodeid)
while 1:
while True:
# Sleep to release python process
time.sleep(0.1)

Expand Down
2 changes: 1 addition & 1 deletion Applications/Hermes/hermesflaskexample_tx.py
Expand Up @@ -19,7 +19,7 @@ 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.
"""
while 1:
while True:
message = raw_input("Enter Message: ")
payload = {'localcallsign': localcallsign, 'localnodeid': localnodeid,
'destinationcallsign': destinationcallsign, 'destinationnodeid': destinationnodeid, 'data': message}
Expand Down
2 changes: 1 addition & 1 deletion Applications/deviceconfiguration/simpleconfig.py
Expand Up @@ -107,7 +107,7 @@

print "************************************"
print "\nQuit with ctrl+c"
while(True):
while True:
#Loop until user presses ctrl+c so they can read response
time.sleep(1)
pass
2 changes: 1 addition & 1 deletion Applications/simplemessage/A_Test_Rx.py
Expand Up @@ -14,7 +14,7 @@
faraday_rx_msg_object = faraday_msg.MessageAppRx()

# Loop continuously through the faraday experimental RF command message application RX routine
while 1:
while True:
rx_message_dict = faraday_rx_msg_object.rxmsgloop(local_device_callsign, local_device_node_id, uart_service_port_application_number, GETWAIT_TIMEOUT)
if rx_message_dict is not None:
print '***************************************'
Expand Down
2 changes: 1 addition & 1 deletion Applications/simplemessage/B_Test_Tx_User_Input.py
Expand Up @@ -20,7 +20,7 @@
message = ''

# Loop while waiting for user input text to transmit
while 1:
while True:
# Get user input text
message = raw_input("Message: ")

Expand Down
2 changes: 1 addition & 1 deletion Debug/Proxy_DEBUG_RX.py
Expand Up @@ -31,7 +31,7 @@
data = None

#While loop to wait for reception of data packet from experimental message application
while(1):
while True:
#Wait until there is new data on the message application port OR timout
for i in range(0, 255, 1):
try:
Expand Down
Expand Up @@ -109,7 +109,7 @@

print "\n************************************"
print "\nQuit with ctrl+c"
while (True):
while True:
# Loop until user presses ctrl+c so they can read response
time.sleep(1)
pass
Expand Up @@ -64,7 +64,7 @@

print "************************************"
print "\nQuit with ctrl+c"
while(True):
while True:
#Loop until user presses ctrl+c so they can read response
time.sleep(1)
pass
Expand Up @@ -99,7 +99,7 @@ print "Receiver operating TCP Localhost port:", faraday_1.FLASK_PORT
data = None

#While loop to wait for reception of data packet from experimental message application
while(1):
while True:
#Wait until there is new data on the message application port OR timout
data = faraday_1.GETWait(local_device_callsign, local_device_node_id, PROXY_MESSAGE_EXPERIMENTAL_PORT, 2)

Expand Down
Expand Up @@ -35,7 +35,7 @@
data = None

#While loop to wait for reception of data packet from experimental message application
while(1):
while True:
#Wait until there is new data on the message application port OR timout
data = faraday_1.GETWait(local_device_callsign, local_device_node_id, PROXY_MESSAGE_EXPERIMENTAL_PORT, 2)

Expand Down
Expand Up @@ -20,7 +20,7 @@
print "Faraday Simple Messaging Receiver Started!"

# Loop continuously through the faraday experimental RF command message application RX routine
while 1:
while True:
rx_message_dict = faraday_rx_msg_object.rxmsgloop(local_device_callsign, local_device_node_id, rx_uart_service_port_application_number, GETWAIT_TIMEOUT)
if rx_message_dict is not None:
print '***************************************'
Expand Down
Expand Up @@ -22,7 +22,7 @@
message = ''

# Loop while waiting for user input text to transmit
while 1:
while True:
# Get user input text
message = raw_input("Message: ")

Expand Down
Expand Up @@ -112,7 +112,7 @@ class ReceiveObject(threading.Thread):

def run(self):
# Loop continuously through the faraday experimental RF command message application RX routine
while 1:
while True:
rx_message_dict = self.faraday_rx_msg_object.rxmsgloop(self.local_device_callsign,
self.local_device_node_id,
self.rx_uart_service_port_application_number,
Expand Down
Expand Up @@ -18,7 +18,7 @@
print "Unit 1 Queue Size:", unit_1.receive.getqueuesize()
print "Unit 2 Queue Size:", unit_2.receive.getqueuesize()

while 1:
while True:
print "\n *** Transmit Message ***"
# Send user input from Unit #1 to Unit #2
user_input = raw_input("Enter message: ")
Expand Down
Expand Up @@ -67,7 +67,7 @@ def run(self):
the proxy interface. Received data packets are saved in to FIFO for later retrieval.
"""
# Loop continuously through the faraday experimental RF command message application RX routine
while 1:
while True:
rx_message_dict = self.faraday_rx_msg_object.rxmsgloop(self.local_device_callsign,
self.local_device_node_id,
self.rx_uart_service_port_application_number,
Expand Down
2 changes: 1 addition & 1 deletion Tutorials/start/hello-world.md
Expand Up @@ -38,7 +38,7 @@ from faraday.proxyio import faradaycommands
faraday_1 = faradaybasicproxyio.proxyio() #default proxy port
faraday_cmd = faradaycommands.faraday_commands()
while(1):
while True:
#Turn LED 1 ON (GREEN)
print "Turning LED 1 ON"
command = faraday_cmd.CommandLocalGPIOLED1On()
Expand Down
2 changes: 1 addition & 1 deletion Tutorials/start/hello-world.py
Expand Up @@ -18,7 +18,7 @@
callsign = 'REPLACEME'
node_id = 0

while(1):
while True:
#Turn LED 1 ON (GREEN)
print "Turning LED 1 ON"
command = faraday_cmd.CommandLocalGPIOLED1On()
Expand Down
4 changes: 2 additions & 2 deletions faraday/aprs.py
Expand Up @@ -44,7 +44,7 @@ def aprs_worker(config, sock):
telemSequence = 0

# Start infinite loop to send station data to APRS-IS
while(True):
while True:
# Query telemetry database for station data
stations = getStations()
stationData = getStationData(stations)
Expand Down Expand Up @@ -628,7 +628,7 @@ def connectAPRSIS():
sleep(10) # Try to reconnect every 10 seconds
return aprssock
else:
while(True):
while True:
logger.error("APRS-IS LOGIN ERROR!")
sleep(1)

Expand Down
2 changes: 1 addition & 1 deletion faraday/hermes/hermesobject.py
Expand Up @@ -71,7 +71,7 @@ def run(self):
the proxy interface. Received data packets are saved in to FIFO for later retrieval.
"""
# Loop continuously through the faraday experimental RF command message application RX routine
while 1:
while True:
time.sleep(0.005)
rx_message_dict = self.faraday_rx_msg_object.rxmsgloop(self.local_device_callsign,
self.local_device_node_id,
Expand Down
2 changes: 1 addition & 1 deletion faraday/proxy.py
Expand Up @@ -58,7 +58,7 @@ def uart_worker(modem, getDicts, units, log):
getDicts[modem['unit']] = {}

# Loop through each unit checking for data, if True place into deque
while(1):
while True:
# Place data into the FIFO coming from UART
try:
for port in modem['com'].RxPortListOpen():
Expand Down

0 comments on commit b94cd04

Please sign in to comment.