class Frame(Structure): version = UBInt8() operation = UBInt8() result = UBInt16() reserved_0 = Magic('\x00\x00\x00\x00') _host_mac = UBInt8Sequence(6) host_mac = FieldProperty(_host_mac, onget=lambda v: unpack_mac(''.join(map(chr, v))), onset=lambda v: tuple(map(ord, pack_mac(v)))) _device_mac = UBInt8Sequence(6) device_mac = FieldProperty( _device_mac, onget=lambda v: unpack_mac(''.join(map(chr, v))), onset=lambda v: tuple(map(ord, pack_mac(v)))) reserved_1 = Magic('\x00\x00') sequence = UBInt16() signature = Magic('NSDP') reserved_2 = Magic('\x00\x00\x00\x00') messages = FieldArray(Message)
class CommandInfo(Structure): commands = FieldArray(SplitCommandInfo)
class TypedArray(Structure): array = FieldArray(TypedArrayElement)
class ConditionalArrayGreedyAfter(Structure): length = LengthField(UBInt8()) array = FieldArray(ConditionalArrayElement, length) greedy = Payload()
class ConditionalArrayGreedy(Structure): array = FieldArray(ConditionalArrayElement)
class BasicMessageArrayNumElements(Structure): count = LengthField(UBInt8()) array = FieldArray(BasicMessage, num_elements_provider=count)
class BasicMessageArrayAfter(Structure): count = LengthField(UBInt8(), multiplier=2) array = FieldArray(BasicMessage, count) after = UBInt8()