kcan-core 0.1.0

No-std CAN protocol primitives for KCAN actuator tooling.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
# 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.

```rust
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>(())
```