def _handle_watch_message(self, message):
if self.log_protocol_level is not None:<EOL><INDENT>logger.log(self.log_protocol_level, "<STR_LIT>", hexlify(message).decode())<EOL><DEDENT>message = self.pending_bytes + message<EOL>while len(message) >= <NUM_LIT:4>:<EOL><INDENT>try:<EOL><INDENT>packet, length = PebblePacket.parse_message(message)<EOL><DEDENT>except IncompleteMessage:<EOL><INDENT>self.pending_bytes = message<EOL>break<EOL><DEDENT>except:<EOL><INDENT>expected_length, = struct.unpack('<STR_LIT>', message[:<NUM_LIT:2>])<EOL>if expected_length == <NUM_LIT:0>:<EOL><INDENT>self.pending_bytes = b'<STR_LIT>'<EOL><DEDENT>else:<EOL><INDENT>self.pending_bytes = message[expected_length + <NUM_LIT:4>:]<EOL><DEDENT>raise<EOL><DEDENT>self.event_handler.broadcast_event("<STR_LIT>", message[:length])<EOL>if self.log_packet_level is not None:<EOL><INDENT>logger.log(self.log_packet_level, "<STR_LIT>", packet)<EOL><DEDENT>message = message[length:]<EOL>self.event_handler.broadcast_event((_EventType.Watch, type(packet)), packet)<EOL>if length == <NUM_LIT:0>:<EOL><INDENT>break<EOL><DEDENT><DEDENT>self.pending_bytes = message<EOL>
Processes a binary message received from the watch and broadcasts the relevant events.

:param message: A raw message from the watch, without any transport framing.
:type message: bytes