@classmethod<EOL><INDENT>def parse_message(cls, message):<DEDENT>
length = struct.unpack_from('<STR_LIT>', message, <NUM_LIT:0>)[<NUM_LIT:0>] + <NUM_LIT:4><EOL>if len(message) < length:<EOL><INDENT>raise IncompleteMessage()<EOL><DEDENT>command, = struct.unpack_from('<STR_LIT>', message, <NUM_LIT:2>)<EOL>if command in _PacketRegistry:<EOL><INDENT>return _PacketRegistry[command].parse(message[<NUM_LIT:4>:length])[<NUM_LIT:0>], length<EOL><DEDENT>else:<EOL><INDENT>return None, length<EOL><DEDENT>
Parses a message received from the Pebble. Uses Pebble Protocol framing to figure out what sort of packet
it is. If the packet is registered (has been defined and imported), returns the deserialised packet, which will
not necessarily be the same class as this. Otherwise returns ``None``.

Also returns the length of the message consumed during deserialisation.

:param message: A serialised message received from the Pebble.
:type message: bytes
:return: ``(decoded_message, decoded length)``
:rtype: (:class:`PebblePacket`, :any:`int`)