inspect() Function¶
-
metlinkpid.inspect(bytes_in: bytes) → metlinkpid.Message¶ The
inspect()function is used to determine how the display would interpret an arbitrary sequence of bytes.It de-frames & CRC-checks the data (if a DLE/STX/ETX packet is provided), then compares the header against the headers of all known
Messagetypes, then constructs an object of the matching type.The
inspect()function is used internally byPID.send()to ensure that a validResponseMessageis received after each transmission.- Returns
a
DisplayMessageobject, aPingMessageobject, or aResponseMessageobject.- Raises
ValueError – if a DLE/STX/ETX packet is provided with a bad CRC checksum, or if the bytes can’t be understood.