No description
Find a file
Jason Alexander 90fc4df4a8
Some checks failed
GitHub Actions CI / build (push) Has been cancelled
GitHub Actions CI / coverage (push) Has been cancelled
A touch
2025-12-30 13:14:03 +00:00
.cargo Avoid SSDP tests when running under QEMU 2024-09-06 14:30:31 +01:00
.github/workflows Update Github CI action again 2025-02-12 18:22:03 +00:00
cotton-netif Fix doc builds for latest nightly 2025-10-04 13:00:25 +01:00
cotton-scsi Fix doc builds for latest nightly 2025-10-04 13:00:25 +01:00
cotton-ssdp Fix doc builds for latest nightly 2025-10-04 13:00:25 +01:00
cotton-unique Deduplicate MSRV/edition 2025-06-23 11:12:44 +01:00
cotton-usb-host Update READMEs etc for cotton-usb-host-hid release 2025-10-07 15:53:26 +01:00
cotton-usb-host-hid Made mice work. 2025-12-13 16:41:01 +00:00
cotton-usb-host-msc Update changelogs for release 2025-08-20 14:34:22 +01:00
cotton-w5500 Deduplicate MSRV/edition 2025-06-23 11:12:44 +01:00
cross A touch 2025-12-30 13:14:03 +00:00
scripts Fix new nightly Clippy lint 2024-10-10 09:31:25 +01:00
systemtests Update assertables to 9.7.1 2025-06-23 11:12:44 +01:00
.gitignore netif: More test coverage for linux_netlink 2023-01-21 13:49:36 +00:00
.rustfmt.toml Cargo fmt 2023-01-21 13:30:27 +00:00
Cargo.toml Drafting HID keyboard support. 2025-10-07 15:53:26 +01:00
clippy.toml Bump MSRV to 1.80 2025-02-11 15:00:48 +00:00
LICENSE Add README and top-level LICENSE 2023-01-22 14:35:16 +00:00
README.md Update READMEs etc for cotton-usb-host-hid release 2025-10-07 15:53:26 +01:00

CI status codecov dependency status License: CC0-1.0

Cotton

A collection of Rust crates for low-level networking functionality.

So far:

  • cotton-netif Crates.io Crates.io docs.rs: enumerating available network interfaces and their IP addresses, including ongoing (asynchronous) comings and goings of network interfaces (e.g. on USB hotplug/unplug); so far, for Linux only.

  • cotton-scsi Crates.io Crates.io docs.rs: implementing SCSI direct-access storage device commands in terms of an abstract SCSI transport.

  • cotton-ssdp Crates.io Crates.io docs.rs: implementing SSDP, the Simple Service Discovery Protocol, a mechanism for discovering available resources (service) on a local network. Uses cotton-netif, in order to do the Right Thing on multi-homed hosts (but meaning that it is unlikely to work on Windows platforms).

  • cotton-unique Crates.io Crates.io docs.rs: creating deterministic but per-device unique identifiers such as MAC addresses.

  • cotton-usb-host Crates.io Crates.io docs.rs: a no-std, no-alloc asynchronous USB host stack, initially for RP2040.

  • cotton-usb-host-hid Crates.io Crates.io docs.rs: USB "Human Interface Device" (HID) keyboard support (i.e., supporting attaching USB keyboards to a microcontroller, to allow keyboard input).

  • cotton-usb-host-msc Crates.io Crates.io docs.rs: USB mass-storage support for cotton-usb-host (i.e., supporting attaching USB mass-storage devices to a microcontroller, to give the microcontroller extra storage space).

  • cotton-w5500 Crates.io Crates.io docs.rs: smoltcp driver for the Wiznet W5500 Ethernet controller in MACRAW mode, including interrupt-driven mode.

These crates are no_std-compatible, meaning that they can be used on embedded systems. In fact, all pushes to my local (not Github) continuous-integration server are automatically tested on both STM32 and RP2040 platforms. You can read about how that is set up on my blog: Part one, Part two, Part three.

These system-tests also serve as example code combining the Cotton crates with the wider ecosystem, including examples where the combining of the wider ecosystem components needed a little research in its own right even before involving Cotton, so perhaps that in itself will be useful to others:

My long-term goals for this project as a whole:

  • provide useful, solid, well-tested components to folks needing Rust crates for networking, including UPnP and embedded devices

  • develop skills in Rust coding, including the packaging, distributing, and publicising of it, after a career spent with C++

MSRV policy

Changes to the Minimum Supported Rust Version are breaking changes and get a new major version. This policy may change in future, but such a change would itself be a breaking change and get a new major version.

Licence

Everything is licensed under Creative Commons CC0, qv.