Suggestion for a small change in line 205 ('section' #PINGRESP in function wait_msg):
return res[0]
instead of:
return None
This allows you to check in your own consumer code that called check_msg() or wait_msg(), that the ping response came by and was valid:
if(oReply == 0xD0): # valid ping response
Thanks!