pub enum ProtocolParseError {
UnknownEvent(Option<u8>),
DisabledControllerDataPackageType(ControllerDataPackageType),
ButtonParseError(ButtonParseError),
InvalidLength(usize, usize),
InvalidCrc(u8, u16),
InvalidFloatSize(usize),
}
Expand description
Represents the different kinds of errors which can happen when the protocol is being parsed.
Variants
UnknownEvent(Option<u8>)
The message contained an event which is not known to the current implementation. This can mean that:
- the message was malformed or
- that a newer protocol version has been used or
- that the event type has not been enabled as a feature.
DisabledControllerDataPackageType(ControllerDataPackageType)
The message contained an event which is known to the library but has not been selected as a feature and can thus not be parsed. Select the feature when compiling the library to handle this message.
ButtonParseError(ButtonParseError)
An error occurred while parsing a ButtonEvent
.
InvalidLength(usize, usize)
The event in the message did not have the expected length. The first value is the expected length, the second the actual length.
InvalidCrc(u8, u16)
The event in the message did not have the expected CRC. The first value is the expected CRC, the second the actual CRC.
InvalidFloatSize(usize)
There was a problem parsing a float from a message. The parameter gives the length of the received input.