Skip to content

Forward libcanard TX deadlines through the CAN driver vtable#60

Merged
maksimdrachov merged 4 commits into
mainfrom
copilot/extend-cy-can-vtable-t
Jun 3, 2026
Merged

Forward libcanard TX deadlines through the CAN driver vtable#60
maksimdrachov merged 4 commits into
mainfrom
copilot/extend-cy-can-vtable-t

Conversation

Copilot AI commented Jun 3, 2026

Copy link
Copy Markdown
Contributor

cy_can_vtable_t::tx_classic and tx_fd were dropping the libcanard transmission deadline even though the CAN transport already receives it. This updates the public CAN driver API so platform backends can observe the deadline directly, matching the FluxGrip-facing integration model.

  • Public CAN vtable API

    • Extend tx_classic and tx_fd to accept a canard_us_t deadline.
    • Update the callback contract in cy_can.h to make deadline-aware transmission explicit.
  • Deadline propagation

    • Pass the libcanard deadline through cy_can.c instead of discarding it before dispatching to the backend vtable.
  • Backend and test support

    • Update the SocketCAN backend to the new callback signature.
    • Update CAN test doubles to capture the last deadline seen on classic and FD TX paths.
    • Add focused assertions covering both classic and FD publication paths.
  • Example

    typedef struct
    {
        bool (*tx_classic)(void* user,
                           canard_us_t deadline,
                           uint_least8_t iface_index,
                           uint32_t can_id,
                           const void* data,
                           uint_least8_t len);
    
        bool (*tx_fd)(void* user,
                      canard_us_t deadline,
                      uint_least8_t iface_index,
                      uint32_t can_id,
                      const void* data,
                      uint_least8_t len);
    } cy_can_vtable_t;

Copilot AI changed the title [WIP] Extend cy_can_vtable_t to accept the Canard deadline Forward libcanard TX deadlines through the CAN driver vtable Jun 3, 2026
@pavel-kirienko pavel-kirienko marked this pull request as ready for review June 3, 2026 15:13
@maksimdrachov maksimdrachov merged commit 0a3ab4d into main Jun 3, 2026
8 checks passed
@maksimdrachov maksimdrachov deleted the copilot/extend-cy-can-vtable-t branch June 3, 2026 16:15
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.

Extend cy_can_vtable_t::tx_classic and tx_fd to accept the Canard deadline

3 participants