Crate vex_cdc

Crate vex_cdc 

Source
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§

cdc
Simple CDC packets.
cdc2
Extended CDC packets.

Structs§

DecodeError
FixedString
A UTF-8 string with a fixed maximum capacity of N bytes.
FixedStringSizeError
Returned when a FixedString cannot fit the specified string.
MessageEncoder
Simplifies encoding data with the Encode trait.
VarU16
A variable-width encoded u16.
VarU16SizeError
Returned when a VarU16 cannot fit the specified value.
Version
A VEXos firmware version.

Enums§

DecodeErrorKind

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.
DecodeWithLength
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.