Closed LoicGRENON closed 2 years ago
BTW, I implemented this following the same way get_usint/set_usint was done. I think it might be maybe clearer and easier to maintain to just add an "unsigned" parameter to get_int, get_dint, getsint and their respective set* functions and to set the struct format character (signed or unsigned) accordingly rather than copying the same lines multiple time.
Thus, for example, get_uint(bytearray_: bytearray, byte_index: int, _int: int)
would call get_int(bytearray_: bytearray, byte_index: int, _int: int, unsigned: Optional[bool]=True)
Do you want me to do such reformating of the functions ?
Hello,
I added get_uint/set_uint and get_udint/set_udint to add support for read/write for respectively uint (2bytes) and udint (4 bytes) values from bytearray.
get_usint/set_usint already exists.