Skip to content

Support for multiple CAN/DAQ frames in 1 UDP packet#47

Merged
LelsersLasers merged 9 commits intomasterfrom
millan/multi_frame_udp
Apr 22, 2026
Merged

Support for multiple CAN/DAQ frames in 1 UDP packet#47
LelsersLasers merged 9 commits intomasterfrom
millan/multi_frame_udp

Conversation

@LelsersLasers
Copy link
Copy Markdown
Member

@LelsersLasers LelsersLasers commented Mar 6, 2026

  • trait Driver::read_frames returns DriverResult<Vec<CanFrame>> instead of just one (DriverResult<CanFrame>) (and renamed accordingly)
  • Implementing read frame for UDP (break read bytes into chunks, parse each chunk as a message)
  • Serial just returns a vec of length 1

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Updates the CAN driver abstraction and UDP parsing to support receiving multiple CAN frames within a single UDP datagram, and adapts the CAN processing thread to handle batches of frames.

Changes:

  • Changed the driver read API to return a batch of frames (Vec<CanFrame>) instead of a single frame.
  • Implemented UDP packet parsing that splits a received datagram into multiple fixed-size raw frames.
  • Updated the CAN thread loop to process all frames returned from a single driver read.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 4 comments.

File Description
src/can/thread.rs Processes a vector of frames per read instead of a single frame.
src/can/driver.rs Updates the Driver trait + Serial/UDP implementations and adds multi-frame UDP parsing.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/can/driver.rs
Comment thread src/can/driver.rs Outdated
Comment thread src/can/driver.rs Outdated
Comment thread src/can/driver.rs Outdated
@LelsersLasers LelsersLasers marked this pull request as ready for review March 6, 2026 04:06
@LelsersLasers LelsersLasers requested a review from shb-png March 6, 2026 04:06
@LelsersLasers
Copy link
Copy Markdown
Member Author

Should be tested b4 merge

@LelsersLasers LelsersLasers force-pushed the millan/multi_frame_udp branch 2 times, most recently from 9296bc4 to e0fb614 Compare April 21, 2026 19:28
@LelsersLasers LelsersLasers requested review from irvingywang and shb-png and removed request for shb-png April 21, 2026 19:29
@LelsersLasers LelsersLasers changed the title Support for multiple frames in 1 UDP packet Support for multiple CAN/DAQ frames in 1 UDP packet Apr 21, 2026
@LelsersLasers LelsersLasers force-pushed the millan/multi_frame_udp branch from e0fb614 to accdeb7 Compare April 22, 2026 01:45
@LelsersLasers LelsersLasers merged commit 4e025c5 into master Apr 22, 2026
1 check passed
@LelsersLasers LelsersLasers deleted the millan/multi_frame_udp branch April 22, 2026 01:49
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.

4 participants