#NEWLINE# @ staticmethod #NEWLINE# def rawmessage_to_message( rawmsg ) : #NEWLINE# #INDENT# rawmsg = [ ord ( b ) for b in rawmsg ] #NEWLINE# message = ControlMessage ( cdc = rawmsg [ 0 ] , source = rawmsg [ 1 ] , destination = rawmsg [ 2 ] , ack = ( ( rawmsg [ 3 ] & 128 ) > 0 ) , ttl = ( ( rawmsg [ 3 ] & 120 ) >> 3 ) , data = ( rawmsg [ 5 : ] if rawmsg [ 4 ] else None ) ) #NEWLINE# return message