Skip to content

Instantly share code, notes, and snippets.

@ampledata
Last active Nov 10, 2015
Embed
What would you like to do?
Threading APRS
#!/usr/bin/env python
import threading
import aprs
class APRSMessage(object):
def __init__(self):
self.message = None
def set_message(self, message):
self.message = message
print "Received message: %s" % message
def message_timer(self):
if self.message is None:
print 'No message received!'
else:
self.message = None
am = APRSMessage()
ap = aprs.APRS('W2GMD', '12345')
at = threading.Timer(10.0, am.message_timer)
at.start()
ap.connect()
ap.receive(callback=am.set_message)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment