Add SCS manager
bozza
This commit is contained in:
@@ -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_
|
||||
+1
-16
@@ -4,7 +4,6 @@
|
||||
#include "mmr_can_message_id.h"
|
||||
#include "mmr_can_types.h"
|
||||
|
||||
|
||||
/**
|
||||
* Scs_timer represents the max number of counter
|
||||
* that need to checked w/current time
|
||||
@@ -19,8 +18,6 @@
|
||||
*/
|
||||
typedef uint32_t TimerRange;
|
||||
|
||||
|
||||
|
||||
typedef struct {
|
||||
MmrCanMessageId scsId;
|
||||
CanId receiverId;
|
||||
@@ -28,18 +25,6 @@ typedef struct {
|
||||
} MmrTimerSCS;
|
||||
|
||||
|
||||
/**
|
||||
* @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;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* All time units are to be considered as milliseconds (1ms)
|
||||
*/
|
||||
@@ -54,7 +39,7 @@ bool MMR_CAN_SetTimerSCS(MmrCanMessageId scsId, CanId receiverId, TimerRange cur
|
||||
* @param currentTime from __HAL_TIM_GET_COUNTER(&htimX) or directly from the CNT register
|
||||
* @param thresholdDelay by rules 500ms
|
||||
*/
|
||||
bool MMR_CAN_GetTimerSCS(RTRresponse *rtrResponse, TimerRange currentTime, TimerRange thresholdDelay);
|
||||
bool MMR_CAN_GetTimerSCS(MmrCanMessageId scsId, CanId receiverId, int *rtr, TimerRange currentTime, TimerRange thresholdDelay);
|
||||
|
||||
|
||||
#endif // !INC_MMR_CAN_TIMER_SCS_H_
|
||||
|
||||
Reference in New Issue
Block a user