Update header (#9)
* Add ack message type * Rename dictionaryEntry to messageId * Refactor * Map message ids
This commit is contained in:
committed by
GitHub
parent
174f5e8d76
commit
906dfcd3db
@@ -0,0 +1,23 @@
|
||||
#include "mmr_can_message_id.h"
|
||||
|
||||
|
||||
bool MMR_CAN_IsMessageIdSCS(MmrCanMessageId msgId) {
|
||||
return MMR_CAN_IsMessageIdOfType(msgId, MMR_CAN_MESSAGE_ID_TYPE_SCS);
|
||||
}
|
||||
|
||||
|
||||
bool MMR_CAN_IsMessageIdOfType(
|
||||
MmrCanMessageId msgId,
|
||||
MmrCanMessageIdType type
|
||||
) {
|
||||
return MMR_CAN_GetMessageIdType(msgId) == type;
|
||||
}
|
||||
|
||||
|
||||
uint8_t MMR_CAN_GetMessageIdType(MmrCanMessageId msgId) {
|
||||
return msgId >> 7;
|
||||
}
|
||||
|
||||
uint8_t MMR_CAN_GetMessageIdSubtype(MmrCanMessageId msgId) {
|
||||
return msgId & B8_(0111, 1111);
|
||||
}
|
||||
@@ -23,6 +23,7 @@ static uint8_t computeNextMessageLength(MmrCanPacket *packet);
|
||||
static void setMessageType(TransmissionParams *header, MmrCanMessageType type);
|
||||
static void syncHeaders(TransmissionParams *tp);
|
||||
|
||||
|
||||
HalStatus MMR_CAN_Send(CanHandle *hcan, MmrCanPacket packet) {
|
||||
TransmissionParams tp = {
|
||||
.handle = hcan,
|
||||
|
||||
Reference in New Issue
Block a user