ODrive icon indicating copy to clipboard operation
ODrive copied to clipboard

Incoherent Serial Number Type

Open blauertee opened this issue 3 years ago • 3 comments

Describe the bug odrv0.serial_number is an int whereas in discover_any(serial_number) the serial number is expected as a hex string. I think this should be coherent. Somewhere there should be a line like int(serial_number, 16) or hex(serial_number) depending on what you prefer.

blauertee avatar Feb 22 '22 10:02 blauertee

The string variant is the correct one. However the Fibre protocol currently does not support string properties. Therefore fixing this would either be fairly hacky or non-trivial.

samuelsadok avatar Feb 22 '22 12:02 samuelsadok

Okay that makes sense, maybe name it serial_int then? Add a odrive.dump_serial_nr(odrv0) method. Anyway I guess it's not that pressing.

blauertee avatar Feb 22 '22 12:02 blauertee

Well odrive.dump_serial_nr(odrv0) would be equivalent to hex(odrv0.serial_number). But yeah it's not a huge priority at the moment.

samuelsadok avatar Feb 25 '22 10:02 samuelsadok