#ifndef __CANUSER_H__
#define __CANUSER_H__

#include "mcu.h"
#include "uds.h"
/*******************************************************************************
 * the defines
 ******************************************************************************/
#define UDS_PHYS_RECV_MSG_ID (0x732)
#define UDS_FUNC_RECV_MSG_ID (0x7DF)
#define UDS_PHYS_RESP_MSG_ID (0x7B2)

#define APP_TX_ECU_STATUS_MSG_ID  (0x301)
#define APP_TX_ECU_DEBUG1_MSG_ID  (0x401)
#define APP_TX_ECU_DEBUG2_MSG_ID  (0x402)
#define APP_TX_ECU_DEBUG3_MSG_ID  (0x403)
#define APP_TX_ECU_DEBUG4_MSG_ID  (0x404)
#define APP_TX_ECU_DEBUG5_MSG_ID  (0x405)
#define APP_TX_ECU_DEBUG6_MSG_ID  (0x406)
#define APP_RX_HOST_REQ1_MSG_ID  (0x201)
#define APP_RX_HOST_REQ2_MSG_ID  (0x202)

#define CAN_DATA_BUFFER_SIZE (64u)
#define CAN_BUFFER_FIFO_SIZE (32u)

/*******************************************************************************
 * the typedefs
 ******************************************************************************/

typedef struct
{
    uint32_t id;
    uint8_t  data[CAN_DATA_BUFFER_SIZE];
    uint8_t  len;
    uint16_t timeStamp;
    uint32_t hrTimeStamp;
} FlexCan_FrameStructureType;


/*******************************************************************************
 * the function prototypes
 ******************************************************************************/

void FlexCanBoot_Init(McuType *obj);
int8_t FlexCanBoot_TxMessage(uint32_t msgId, const uint8_t* pData, uint8_t size);
bool FlexCanBoot_ReadoutMsg(FlexCan_FrameStructureType* pRxMsgObj);
void MsgTask(UdsType *obj);

void GetRxMsgData(uint16_t msgId, uint8_t* pData, uint8_t Size);
void SetTxMsgData(uint16_t msgId, uint8_t* pData, uint8_t Size);

#endif
