Add SCS manager

bozza
This commit is contained in:
Nicola Gutierrez
2022-02-17 17:22:27 +01:00
parent 4ac0afc010
commit 607817389c
5 changed files with 115 additions and 36 deletions
+37
View File
@@ -0,0 +1,37 @@
#ifndef INC_MMR_CAN_SCS_MANAGER_H_
#define INC_MMR_CAN_SCS_MANAGER_H_
#include "mmr_can.h"
#include "mmr_can_timer_scs.h"
/**
* TODO:
* - GetCurrentTime
* - ACK
* - Reset timer
* - Setup method
*/
/**
* @brief Represents the base-struct to manage a single RTR
* and allows to interface with the associated SCS's timer
*/
typedef struct {
MmrCanMessageId scsId;
CanId receiverId;
int rtr;
} RTRresponse;
/**
* It is used to iterate the RTRresponse array in the CheckSCS function
*/
static int counter;
bool MMR_CAN_SetRTRresponse(MmrCanMessageId scsId, CanId receiverId, int rtr);
TimerRange MMR_CAN_GetCurrentTime();
void MMR_CAN_CheckSCS(); // What is necessary to do ritrasmission (mmr_can_send_scs)
#endif // !INC_MMR_CAN_SCS_MANAGER_H_