diff --git a/src/protocol.c b/src/protocol.c --- a/src/protocol.c +++ b/src/protocol.c @@ -25,7 +25,7 @@ bool protocol_receive_message(CanRxMsgTy protocol_message_t message; message.command = can_message->Data[0] & 0x80; message.id = can_message->Data[0] & 0x7F; - message.key = (can_message->Data[1] << 8) & can_message->Data[2]; + message.key = (can_message->Data[1] << 8) | can_message->Data[2]; message.sensor = can_message->Data[3]; message.data.byte_data[0] = can_message->Data[4]; message.data.byte_data[1] = can_message->Data[5];