Skip to content

V0.7.x - #12

Open
tristanalderson wants to merge 8 commits into
mainfrom
v0.7.x
Open

V0.7.x#12
tristanalderson wants to merge 8 commits into
mainfrom
v0.7.x

Conversation

@tristanalderson

Copy link
Copy Markdown
Collaborator

working pr for upgrade to v0.7.x

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 AimNetwork TX/RX to pack/unpack aim::Msgaim::Frame and compute/consume offsetMs relative to TimeSync.
  • Remove AimCanDriver wrapper and update STM32/ESP32 cores + examples to use AimCanHardware directly.

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;
}
Comment thread aim_network/src/aim_stm32_can_core.cpp Outdated
@tristanalderson
tristanalderson requested a review from Copilot July 25, 2026 02:52

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

…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
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.

2 participants