Skip to content

Command ID sign mismatch #8

Open
@kierdavis

Description

Command IDs sent to the Arduino which are greater than 32767 will be returned as negative values instead (i.e. Arduino is implicitly casting an unsigned 16-bit int to a signed 16-bit int).

robotd log:

: Sending to servo assembly: b'@64015 gpio-read 10\n'
: Got back from servo: b'# @64015 gpio-read 10\n'
: Got back from servo: b'@-1521 > low\r\n'
: Got back from servo: b'@-1521 + OK\r\n'

robotd works around this because it bitwise ANDs returned command IDs with 0xFFFF before examining them, but it would be nice if servo-firmware didn't do this in the first place.

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions