V0.7.x - #12
Open
tristanalderson wants to merge 8 commits into
Open
Conversation
There was a problem hiding this comment.
Pull request overview
This PR upgrades the AIM CAN network library and protocol documentation to the v0.7.0 draft, including a new flat CAN-ID layout (class/subject/source) and a revised payload format that uses a 16-bit offset from a 1 Hz TimeSync baseline (with a “zero-timestamp” exception for specific subjects like GPS position). It also refactors the platform driver layering by removing AimCanDriver and having AimNetwork talk directly to the STM32/ESP32 core via a shared raw aim::Frame type.
Changes:
- Replace v0.6.0 protocol doc with a new v0.7.0 draft spec (ID layout, class priorities, offset timestamping, GPS zero-timestamp).
- Refactor
AimNetworkTX/RX to pack/unpackaim::Msg↔aim::Frameand compute/consumeoffsetMsrelative to TimeSync. - Remove
AimCanDriverwrapper and update STM32/ESP32 cores + examples to useAimCanHardwaredirectly.
Reviewed changes
Copilot reviewed 14 out of 14 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| aim_protocol_v0.7.0.md | Adds v0.7.0 draft protocol specification (new ID + payload rules). |
| aim_protocol_v0.6.0.md | Removes v0.6.0 draft protocol specification. |
| aim_network/src/aim_stm32_can_core.h | Updates STM32 core to use aim::Frame directly and adjusts includes. |
| aim_network/src/aim_stm32_can_core.cpp | Updates STM32 core to use aim::Frame; adds aim_network.h include. |
| aim_network/src/aim_network.h | Updates protocol header to v0.7.0; adds frame packing/unpacking helpers and hardware mapping. |
| aim_network/src/aim_network.cpp | Implements v0.7.0 send/receive logic using offset timestamps and raw frames; updates begin flow. |
| aim_network/src/aim_esp32_can_core.h | Updates ESP32 core to use aim::Frame directly and adjusts includes. |
| aim_network/src/aim_esp32_can_core.cpp | Updates ESP32 core to use aim::Frame; adds aim_network.h include. |
| aim_network/src/aim_control.cpp | Formatting-only changes for ternary expressions. |
| aim_network/src/aim_catalog.h | Updates schema/class ordering; adds classBit() + isZeroTimestamp(); updates subjects. |
| aim_network/src/aim_can_driver.h | Removes old cross-platform AimCanDriver wrapper. |
| aim_network/src/aim_can_driver.cpp | Removes old cross-platform AimCanDriver implementation. |
| aim_network/examples/stm32_canbus/src/main.cpp | Updates example to v0.7.0 and swaps to AimCanHardware. |
| aim_network/examples/esp32_canbus/src/main.cpp | Updates example to v0.7.0 and swaps to AimCanHardware. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+51
to
+55
| } else { | ||
| uint32_t baseTime = (_lastSyncTimeMs == 0U) ? 0U : _lastSyncTimeMs; | ||
| uint32_t offset = m.timestampMs - baseTime; | ||
| m.offsetMs = static_cast<uint16_t>(offset & 0xFFFFU); | ||
| } |
Comment on lines
+95
to
99
| } else if (aim::isZeroTimestamp(m.cls, m.subject)) { | ||
| m.timestampMs = syncedMillis(); | ||
| } else { | ||
| m.timestampMs = _lastSyncTimeMs + m.offsetMs; | ||
| } |
… Acceleration & Velocity
…/Ack Zero-TS exceptions
…psPosition - Update Acceleration catalog comment to note mm/s^2 scale (1G = 9810) - Mark aim::Msg::getGpsPosition as const member function
…dd spare PT catalog slots - Make AimNetwork::syncTime public to allow external server time ingestion - Declare _timeOffset as volatile int32_t for lock-free cross-core reads - Add PtSpare1 (0x13) and PtSpare2 (0x14) pressure transducer subjects - Add timestamp field to Sensor struct for data tracking - Align GpsPosition catalog documentation comment to (lon, lat) byte order
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
working pr for upgrade to v0.7.x