class documentation
Represents a tag with rail information and version.
Class Method | unpack |
Unpacks a bytes sequence into a tagWithL object. |
Method | pack |
Packs the tagWithL object into a bytes sequence. |
Class Variable | is |
Undocumented |
Class Variable | version |
Undocumented |
Unpacks a bytes sequence into a tagWithL object.
Parameters | |
data:bytes | The bytes to unpack, expected to be 2 bytes. |
Returns | |
tagWithL | A tagWithL object. |
Raises | |
struct.error | If the input bytes are not the expected size (2 bytes). |
ValueError | If the unpacked version value does not correspond to a valid tagVersionRail enum member. |
Packs the tagWithL object into a bytes sequence.
Packs a boolean (as a byte) and the version value (as a byte) into a byte string. Uses little-endian byte order.
Returns | |
bytes | A bytes object representing the packed data (2 bytes). |