You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
bytes() is its own type in python3, and is common enough IMHO that pySerialTransfer should support it. Since bytes() do not need packing with struct.pack(), the proposed solution is to change the logic in txObj to check for type(val) == bytes and not attempt to pack it.
Currently, byte strings must be unpacked into ints then passed in with one call to txObj per byte, giving val_type_override as:
send_size = link.tx_obj(self.left_drive_pct, val_type_override='b')
The alternative - to send values as ints and convert them to bytes on the Arduino side, would consume 4X the bandwidth on the serial link.
Thoughts? I am willing to contribute this fix in a pull request if you support the idea.
The text was updated successfully, but these errors were encountered:
bytes() is its own type in python3, and is common enough IMHO that pySerialTransfer should support it. Since bytes() do not need packing with struct.pack(), the proposed solution is to change the logic in txObj to check for type(val) == bytes and not attempt to pack it.
Currently, byte strings must be unpacked into ints then passed in with one call to txObj per byte, giving val_type_override as:
send_size = link.tx_obj(self.left_drive_pct, val_type_override='b')
The alternative - to send values as ints and convert them to bytes on the Arduino side, would consume 4X the bandwidth on the serial link.
Thoughts? I am willing to contribute this fix in a pull request if you support the idea.
The text was updated successfully, but these errors were encountered: