kcan-core 0.1.0

No-std CAN protocol primitives for KCAN actuator tooling.
Documentation
  • Coverage
  • 1.09%
    1 out of 92 items documented1 out of 34 items with examples
  • Size
  • Source code size: 18.6 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 926.6 kB This is the summed size of all files generated by rustdoc for all configured targets
  • Ø build duration
  • this release: 2s Average build duration of successful builds.
  • all releases: 2s Average build duration of successful builds in releases after 2024-10-23.
  • Links
  • Repository
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • Tknott95

kcan-core

No-std CAN protocol primitives for KCAN actuator tooling.

kcan-core is intentionally small: fixed-size CAN IDs/frames, CubeMars Servo Direct payload builders, and RobStride status decoding pieces that can be reused by embedded, viewer, or larger app crates without pulling in SocketCAN or TUI dependencies.

The main user-facing crate remains kcan. Use kcan-core when you specifically need the dependency-light foundation.

use kcan_core::{CanId, DirectCommand, direct_command_frame};

let id: CanId = "extended:0x301".parse()?;
let frame = direct_command_frame(0x03, DirectCommand::Velocity(1_000))?;

assert_eq!(id.raw(), 0x301);
assert_eq!(frame.to_string(), "extended 0x303 len=4 data=00 00 03 E8");
# Ok::<(), kcan_core::Error>(())