Skip to content

AutoPub and the example decode through RaftCore's shared poll decode and value reader - #4

Merged
robdobsn merged 1 commit into
mainfrom
feature/shared-poll-decode
Nov 9, 2026
Merged

robdobsn merged 1 commit into
mainfrom
feature/shared-poll-decode

Conversation

@robdobsn

@robdobsn robdobsn commented Nov 9, 2026

Copy link
Copy Markdown
Owner

Change

  • AutoPub:
    • Decodes with RaftCore's DeviceTypeRecords::decodeNewestPollRecord (the static overload, with the context's own working space, so nothing is allocated on the bus task for a full-length poll). It padded short polls itself before; now every on-device consumer (DeviceManager named values, RaftI2C, RaftMicroPy, RaftROS) does it in one place.
    • The working space now holds up to 32 records within 1 KB (it was 8). An LSM6DS FIFO read holds up to 20 samples, and with 8 the newest samples of a full read were dropped.
  • ExampleDiscoverable: its ~/read reply decoded subscriber data without padding, so a FIFO device gave "undecodable sample". It now uses decodeNewestPollRecord and AttrFieldDesc::getValue.
  • Not changed: AutoPub's CDR serialiser keeps its own value reader, since it is independent of RaftCore. It reads values the same way, arrays and scaling included.

Depends on robdobsn/RaftCore#53 and robdobsn/RaftI2C#18.

Tested

ExampleDiscoverable (SysTypeMain) builds against RaftCore#53 and the RaftI2C change. Not run on hardware.

🤖 Generated with Claude Code

…and value reader

- AutoPub decodes with DeviceTypeRecords::decodeNewestPollRecord (static overload, with the context's working
  space, so nothing is allocated on the bus task for a full-length poll). It padded short polls itself; now every
  on-device consumer does the same in one place. The working space holds up to 32 records within 1 KB (it was 8):
  an LSM6DS FIFO read holds up to 20, and with 8 the newest of a full read was dropped.
- The ExampleDiscoverable ~/read reply decoded subscriber data without padding, so a FIFO device gave
  "undecodable sample". It now uses decodeNewestPollRecord and AttrFieldDesc::getValue.
- AutoPub's CDR serialiser keeps its own value reader (it is independent of RaftCore); it reads values the same
  way, arrays and scaling included.

Built (ExampleDiscoverable, SysTypeMain) against RaftCore and RaftI2C with these changes; not run on hardware.
Needs RaftCore with DeviceTypeRecords::decodeNewestPollRecord and AttrFieldDesc::getValue.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@robdobsn
robdobsn merged commit 4b4a039 into main Nov 9, 2026
@robdobsn
robdobsn deleted the feature/shared-poll-decode branch November 9, 2026 17:52
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