101 lines
3.2 KiB
C
101 lines
3.2 KiB
C
//
|
|
// Created by cfif on 05.04.2024.
|
|
//
|
|
|
|
#ifndef HVAC_CAN_SPAM_RECEIVER_H
|
|
#define HVAC_CAN_SPAM_RECEIVER_H
|
|
|
|
#include <cmsis_os.h>
|
|
#include "CanSerialPortFrame.h"
|
|
#include "ccu_candb-binutil.h"
|
|
#include "LoggerInterface.h"
|
|
#include "crc32_m7.h"
|
|
|
|
// Индексы таблицы g_can_monitors
|
|
typedef enum {
|
|
CAN_IDX_ESC_04, // 0
|
|
CAN_IDX_EMS_VEH, // 1
|
|
CAN_IDX_BCM_POWERTRAIN, // 2
|
|
CAN_IDX_EMS_VEH_02, // 3
|
|
CAN_IDX_BCM_EEM, // 4
|
|
CAN_IDX_DMFR_MSG1, // 5
|
|
CAN_IDX_DMFL_MSG1, // 6
|
|
CAN_IDX_TM_STAT, // 7
|
|
CAN_IDX_TM_CP, // 8
|
|
CAN_IDX_HVC_CCU_STATUS_MSG, // 9
|
|
CAN_IDX_BCM_VEH_STATE, // 10
|
|
CAN_IDX_EMS_HVC_REQ_MSG, // 11
|
|
CAN_IDX_HVC_ERR_STATUS_MSG, // 12
|
|
CAN_IDX_BCM_CLIMATIC_DATA, // 13
|
|
CAN_IDX_VCU_CCU_REQ, // 14
|
|
CAN_IDX_ESC_08, // 15
|
|
CAN_IDX_SMFL_STATUS, // 16
|
|
CAN_IDX_SMFR_STATUS, // 17
|
|
CAN_IDX_SMRL_STATUS, // 18
|
|
CAN_IDX_SMRR_STATUS, // 19
|
|
CAN_IDX_SDM_CMD, // 20
|
|
CAN_IDX_VEH_VIN, // 21
|
|
CAN_IDX_OCUFL_MSG, // 22
|
|
CAN_IDX_OCUFR_MSG, // 23
|
|
CAN_IDX_OCURL_MSG, // 24
|
|
CAN_IDX_OCURR_MSG, // 25
|
|
CAN_IDX_DW_STATE, // 26
|
|
CAN_IDX_FIU_CCU1, // 27
|
|
CAN_IDX_FIU_CCU2, // 28
|
|
CAN_IDX_FIU_CCU3, // 29
|
|
} CAN_MonitorIndex_t;
|
|
|
|
|
|
|
|
typedef struct {
|
|
|
|
tSerialPortFrameIO *ioCanFrame;
|
|
osMutexId_t access;
|
|
can_rx_message_type canFrame;
|
|
|
|
char SET_HVAC_VIN[17];
|
|
bool getVIN0;
|
|
bool getVIN1;
|
|
bool getVIN2;
|
|
|
|
osMessageQueueId_t ccu_candb_error_missing_rx;
|
|
osMessageQueueId_t ccu_candb_time_missing_rx;
|
|
|
|
osMessageQueueId_t ccu_candb_rx_LOCAL_HVAC_VIN;
|
|
osMessageQueueId_t ccu_candb_rx_LOCAL_HVAC_UDS_VIN;
|
|
osMessageQueueId_t ccu_candb_rx_TM_CP;
|
|
osMessageQueueId_t ccu_candb_rx_FIU_CCU1;
|
|
osMessageQueueId_t ccu_candb_rx_FIU_CCU2;
|
|
osMessageQueueId_t ccu_candb_rx_BCM_Powertrain;
|
|
osMessageQueueId_t ccu_candb_rx_BCM_CLIMATIC_DATA;
|
|
osMessageQueueId_t ccu_candb_rx_EMS_Veh;
|
|
osMessageQueueId_t ccu_candb_rx_ESC_04;
|
|
osMessageQueueId_t ccu_candb_rx_BCM_VEH_STATE;
|
|
osMessageQueueId_t ccu_candb_rx_EMS_HVC_Req_Msg;
|
|
osMessageQueueId_t ccu_candb_rx_HVC_Err_Status_Msg;
|
|
|
|
tLoggerInterface *logger;
|
|
|
|
struct {
|
|
osThreadId_t id;
|
|
//uint32_t stack[384];
|
|
uint32_t *stack;
|
|
StaticTask_t controlBlock;
|
|
osThreadAttr_t attr;
|
|
} thread;
|
|
|
|
} tCanSpamReceiver;
|
|
|
|
void CanSpamReceiver_Init(tCanSpamReceiver *env, tSerialPortFrameIO *ioCanFrame, tLoggerInterface *logger);
|
|
|
|
void CanSpamReceiver_StartThread(tCanSpamReceiver *env);
|
|
|
|
void get_CanSpamReceiver(tCanSpamReceiver *env, char *VIN, ccu_candb_error_missing_rx_t *CAN_ERROR_MISSLE, ccu_candb_time_missing_rx_t *CAN_TIME_MISSLE);
|
|
|
|
bool get_CanSpamReceiverUDS(tCanSpamReceiver *env, char *VIN, func_update_func update_func, void *update_func_env,
|
|
uint32_t timeout, uint32_t count);
|
|
|
|
bool get_is_NoNull_CanSpam_BCM_PowerTrain_Receiver(tCanSpamReceiver *env);
|
|
|
|
#endif //HVAC_CAN_SPAM_RECEIVER_H
|