pub enum AtlasScientificError {
Show 16 variants
FirstCharacterNotMagic(String, u8, u8),
LastCharacterNotMagic(String, u8, u8),
ContainsInvalidCharacter(String, u8),
InvalidUtf8Sequence {
location: String,
source: Utf8Error,
},
ConversionFailure {
location: String,
source: ParseFloatError,
},
IncorrectBufferLength(String, AquariumSignal, usize),
CouldNotLockMutex {
location: String,
signal: AquariumSignal,
},
ResponseCheckFailed {
location: String,
signal: AquariumSignal,
source: Box<AtlasScientificError>,
},
Initial,
I2cCommunicationFailure {
location: String,
signal: AquariumSignal,
source: I2cError,
},
ChannelIsEmpty(String),
ChannelIsDisconnected {
location: String,
source: AquaChannelError,
},
InvalidSignal(String, AquariumSignal),
SignalRequestCreationFailure {
location: String,
source: I2cError,
},
SendingRequestToI2cInterfaceFailed {
location: String,
source: AquaChannelError,
},
UnknownError(String),
}Expand description
error codes for evaluation of sensor unit response
Variants§
FirstCharacterNotMagic(String, u8, u8)
The first character in the message sent from the sensor does not match the required magic number.
LastCharacterNotMagic(String, u8, u8)
The last character in the message sent from the sensor does not match the required magic number.
ContainsInvalidCharacter(String, u8)
The message sent from the sensor unit contains non-numeric characters in the data section
InvalidUtf8Sequence
The error is masked by other checks. Still, the signature of the function to convert from u8 array slice to String throws an error.
ConversionFailure
Conversion from String to f32 failed.
IncorrectBufferLength(String, AquariumSignal, usize)
Incorrect buffer length
CouldNotLockMutex
Mutex poisoned
ResponseCheckFailed
Error in sensor unit response for a specific signal.
Initial
Initial value, is overwritten
I2cCommunicationFailure
Error in I2C communication for a specific signal.
ChannelIsEmpty(String)
Error is used to communicate to caller that receiving needs to be repeated.
ChannelIsDisconnected
The channel is disconnected.
InvalidSignal(String, AquariumSignal)
Logic error: Signal is unknown
SignalRequestCreationFailure
Signal request could not be created.
SendingRequestToI2cInterfaceFailed
Sending request to I2cInterface thread failed.
UnknownError(String)
Enum value covering unreachable branch in match