@@ -188,7 +188,7 @@ impl Protocol300Message {
|
|||||||
return Err(MessageDecodingError::LengthMismatch());
|
return Err(MessageDecodingError::LengthMismatch());
|
||||||
}
|
}
|
||||||
|
|
||||||
let message_identifier = match MessageIdentifier::try_from(bytes[2] & 0x0F) {
|
let message_identifier = match MessageIdentifier::try_from(bytes[2]) {
|
||||||
Ok(id) => id,
|
Ok(id) => id,
|
||||||
Err(e) => {
|
Err(e) => {
|
||||||
error!("Failed to decode message: invalid message identifier byte 0x{:02X}", bytes[2]);
|
error!("Failed to decode message: invalid message identifier byte 0x{:02X}", bytes[2]);
|
||||||
@@ -196,7 +196,7 @@ impl Protocol300Message {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
let function_code = match FunctionCode::try_from(bytes[3] & 0x0F) {
|
let function_code = match FunctionCode::try_from(bytes[3]) {
|
||||||
Ok(fc) => fc,
|
Ok(fc) => fc,
|
||||||
Err(e) => {
|
Err(e) => {
|
||||||
error!("Failed to decode message: invalid function code byte 0x{:02X}", bytes[3]);
|
error!("Failed to decode message: invalid function code byte 0x{:02X}", bytes[3]);
|
||||||
|
|||||||
Reference in New Issue
Block a user