Expand description
Implementation of the VEX Robotics CDC protocol in Rust.
This crate allows you to encode and decode packets used to communicate with products sold by VEX Robotics using their CDC (Communications Device Class) protocol. The protocol can be used to upload programs and interact with VEX brains and other hardware over USB and bluetooth.
Currently, most packets supported by the V5 Brain and V5 Controller are implemented, though the packets provided by this crate are non-exhaustive.
This crate is used as a backing implementation for vexide’s vex-v5-serial library and cargo-v5.
Modules§
Structs§
- Decode
Error - Fixed
String - A UTF-8 string with a fixed maximum capacity of
N
bytes. - Fixed
String Size Error - Returned when a
FixedString
cannot fit the specified string. - Message
Encoder - Simplifies encoding data with the
Encode
trait. - VarU16
- A variable-width encoded
u16
. - VarU16
Size Error - Returned when a
VarU16
cannot fit the specified value. - Version
- A VEXos firmware version.
Enums§
Constants§
- COMMAND_
HEADER - Starting byte sequence for all device-bound CDC packets.
- REPLY_
HEADER - Starting byte sequence used for all host-bound CDC packets.
- VEX_
CRC16 - CRC16 error-detecting algorithm used in CDC2 packets.
- VEX_
CRC32 - CRC32 error-detecting algorithm used for file uploads.
Traits§
- Decode
- A type that can be reconstructed (decoded) from a raw sequence of bytes.
- Decode
With Length - A type that can be decoded from a sequence of bytes, given an indicator of the number of items contained within the type.
- Encode
- A type that can be encoded into a sequence of bytes.