Skip to content

Instantly share code, notes, and snippets.

@vindolin
Last active August 29, 2015 14:01
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 vindolin/208bf7bce63350fb72f4 to your computer and use it in GitHub Desktop.
Save vindolin/208bf7bce63350fb72f4 to your computer and use it in GitHub Desktop.
class SerialThreadTX(SerialThread):
def run(self):
self.msggen.directdisplay('==== Started TX Thread')
self.tracemanager.start_trace()
while(True):
if self.timeToQuit.isSet():
break
# The maximum TX buffer for the COM-port driver set in w32Serial.py.
serial_bytes = self.port.read(50000000)
if serial_bytes:
pkt = Packet(serial_bytes, self.config)
# Get representation of the packet that can be printed to the
# user.
readable_pkt = pkt.get_readable_repr()
self.do_something_to_packet(readale_pkt, pkt.timestamp...)
self.msggen.displayMessages()
self.port.close()
class SerialThreadTX_final(SerialThreadTX):
def do_something_to_packet(self, parameters...):
pass # ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment