Skip to content

fix(control)!: unify response frame format#20

Open
rkuester wants to merge 3 commits into
256foundation:mainfrom
rkuester:fix-response
Open

fix(control)!: unify response frame format#20
rkuester wants to merge 3 commits into
256foundation:mainfrom
rkuester:fix-response

Conversation

@rkuester

Copy link
Copy Markdown
Contributor

Add an explicit status code byte to all responses and make the length field mean total packet length, matching commands.

  1. There was no way to distinguish a success response from an error response on the wire. The error code occupied the same position as the first data byte.

  2. The length field had different semantics depending on whether the response was success or error. Success used payload-only length while error used total packet length.

Both are resolved by giving every response a status code at byte 3: 0x00 for success, existing codes for errors.

Bumps firmware version to v5.1.0 so the host can distinguish protocol versions via bcdDevice.

BREAKING CHANGE: response format adds a status byte at offset 3

Add response packet format for both success and error cases,
per-command response payloads, the framing recovery mechanism,
and the undocumented I2C SetFrequency (0x10) command.
Add an explicit status code byte to all responses and make the
length field mean total packet length, matching commands.

1) There was no way to distinguish a success response from an
error response on the wire. The error code occupied the same
position as the first data byte. For example, an I2C read
returning 0x10 was indistinguishable from a Timeout error, or
a red LED response (R=0xFF) from an error with message.

2) The length field had different semantics depending on whether
the response was success or error. Success used payload-only
length while error used total packet length. A host parser
could not use the length to frame a read without first knowing
the response type.

Both are resolved by giving every response a status code at
byte 3: 0x00 for success, existing codes for errors.

BREAKING CHANGE: response format adds a status byte at offset 3
The previous commit changed the response frame format. Bump the
firmware version so the host can distinguish protocol versions
via bcdDevice.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant