_Emitter._build_register doesn't currently propagate the register's length onto the class it builds:
|
return _new_class( |
|
class_name, |
|
(RegisterBase,), |
|
{ |
|
"address": reg.address, |
|
"payload_type": ProtoPayloadType[reg.type.name], |
|
"payload_class": payload_cls, |
|
}, |
|
) |
This breaks Device.read() and Device.write() for registers with length > 1, such as the struct-typed settings registers used on the Quac.
Changing the return value to this seems to fix things:
return _new_class(
class_name,
(RegisterBase,),
{
"address": reg.address,
"payload_type": ProtoPayloadType[reg.type.name],
"payload_class": payload_cls,
"length": length if length > 1 else None,
},
)
_Emitter._build_registerdoesn't currently propagate the register's length onto the class it builds:python/src/packages/harp-device/src/harp/device/schema/_emit.py
Lines 482 to 490 in 5991c3f
This breaks
Device.read()andDevice.write()for registers with length > 1, such as the struct-typed settings registers used on the Quac.Changing the return value to this seems to fix things: