Skip to content

Instantly share code, notes, and snippets.

@ampledata
Last active November 10, 2015 20:35
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ampledata/433345814a119cada270 to your computer and use it in GitHub Desktop.
Save ampledata/433345814a119cada270 to your computer and use it in GitHub Desktop.
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