Skip to content

Commit

Permalink
Implement page checksums in packet 27/0
Browse files Browse the repository at this point in the history
CRC is calculated for every header packet in PacketMag::GetPacket and compared to a stored value. If the checksum has changed (e.g. at midnight), or the page has been updated, the rest of the page (X/1-25) are also checksummed ready for transmission in packet X/27/0

Packet::Header() and Packet::HeaderText() are combined into a single function and header template substitutions moved here from Packet::tx().
Version string substitution is moved to Packet::SetRow so that it gets included in page checksum.

The remaining substitutions (temperature, offset time, etc) are problematic because they are dynamic (meaning a mechanism is needed to cause the checksum to be recalculated if they change), and need to be processed *before* the packet X/27/0 is broadcast, i.e. before they get generated from the ttxline which would mean significant changes to the line/packet storage architecture.

This commit also adds a new variable _subpage to PacketMag which holds a pointer to the the actual subpage currently being transmitted to remove the repeated `if _page->IsCarousel _page->GetCarouselPage->foo() else _page->foo()` pattern
  • Loading branch information
ZXGuesser committed Jul 24, 2023
1 parent 35e99d3 commit 1ca78b6
Show file tree
Hide file tree
Showing 7 changed files with 282 additions and 185 deletions.
Loading

0 comments on commit 1ca78b6

Please sign in to comment.