This commit is contained in:
2026-02-01 20:41:48 +01:00
parent 49ec3abfd9
commit c5e2d1dd31

View File

@@ -188,7 +188,7 @@ impl Protocol300Message {
return Err(MessageDecodingError::LengthMismatch()); return Err(MessageDecodingError::LengthMismatch());
} }
let message_identifier = match MessageIdentifier::try_from(bytes[2]) { let message_identifier = match MessageIdentifier::try_from(bytes[2] & 0x0F) {
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]) { let function_code = match FunctionCode::try_from(bytes[3] & 0x0F) {
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]);