Thanks to visit codestin.com
Credit goes to lib.rs

1 unstable release

0.1.0 Jun 9, 2025

#1351 in Embedded development


Used in mctp-usb-embassy

MIT/Apache

125KB
2.5K SLoC

MCTP Stack

This crate provides a MCTP stack that can be embedded in other programs or devices.

A Router object lets programs use a Stack with MCTP transport binding links. Each Port handles transmitting and receiving packets independently. Messages destined for the stack's own EID will be passed to applications.

Applications can create router::RouterAsyncListener and router::RouterAsyncReqChannel instances to communicate over MCTP. Those implement the standard mctp crate async traits.

The IO-less Stack handles MCTP message formatting and parsing, independent of any particular MCTP transport binding.

Configuration

mctp-estack uses fixed sizes to be suitable on no-alloc platforms. These can be configured at build time, see config


Embedded MCTP Stack

API docs

This is a MCTP stack suitable for embedded devices.

A Router instance handles feeding MCTP packets to and from user provided MCTP transports, and handles sending receiving MCTP messages from applications using the mctp crate async traits.

Applications using MCTP can create RouterAsyncListener and RouterAsyncReqChannel instances.

MCTP bridging between ports is supported by the Router.

The core Stack handles IO-less MCTP message reassembly and fragmentation, and MCTP tag tracking. MCTP transport binding packet encoding and decoding is provided for I2C, USB, and serial.

Dependencies

~2MB
~35K SLoC