This commit is contained in:
Stuart Feichtinger 2016-01-31 18:57:31 -06:00
parent bdf3e427cc
commit f84dd400ed
1 changed files with 6 additions and 1 deletions

View File

@ -85,11 +85,16 @@ def parseMsg(payload):
https://docs.python.org/2/library/struct.html
'''
charAry, val1, val2, val3 = parsedStruct.unpack_from(arr)
charAry, val1, val2, val3 = parsedStruct.unpack_from(arr) #convert byte array to formatted struct
charAry = charAry.rstrip(' \t\r\n\0') #remove trailing white space from buffer
return charAry, val1, val2, val3
def main():
"""Wait for incoming message published by Adafruit MQTT client"""
global args