a lot more will need to be added as we go on..
This was pulled from heltec's PingPong example, but all licenses
are free.. Also, the files were cleaned up, that is CRs removed,
and trailing white space removed from lines...
This can be useful for doing trial receptions of messages, and
if they work, update the state when successful... Setting the
state on the old object is best as it's hard to change all references
to the new object..
copyof = strb.copy()
try:
copyof.recv_enc(msg)
copyof.recv_mac(mac)
except AuthenticationFailed: # failed, ignore message
return
else: # it worked
strb.set_state_from(copyof)
<process msg>