#ifndef CAN_APP_H
#define CAN_APP_H

#include "common_types.h"


#define HEAT_LV1 0x01u
#define HEAT_LV2 0x02u
#define HEAT_LV3 0x03u

#define CAN_CONTROL_BY_APP        0u
#define CAN_CONTROL_BY_28_SERVICE 1u

#define CAN_APP_LOST_COMMUNICATION_MPC_316_ID                 0u
#define CAN_APP_LOST_COMMUNICATION_METER_055_ID               1u
#define CAN_APP_LOST_COMMUNICATION_BCM_1_12D_ID               2u
#define CAN_APP_LOST_COMMUNICATION_BCM_2_50D_ID               3u
#define CAN_APP_LOST_COMMUNICATION_MOD_4G_49A_ID              4u
#define CAN_APP_LOST_COMMUNICATION_MULTIMEDIA_385_ID          5u
#define CAN_APP_LOST_COMMUNICATION_CLOUD_SERVICES_0A2_ID      6u
#define CAN_APP_LOST_COMMUNICATION_BCM_EVP2_394_ID            7u
#define CAN_APP_LOST_COMMUNICATION_AIR_CONDITION_CTRL_2DB_ID  8u 
#define CAN_APP_LOST_COMMUNICATION_VCU_40D_ID                 9u
#define CAN_APP_LOST_COMMUNICATION_BCM_L_407_ID               10u
#define CAN_APP_LOST_COMMUNICATION_METER_1_DIR_4BF_ID         11u
#define CAN_APP_LOST_COMMUNICATION_BCM_R_4E6_ID               12u
#define CAN_APP_LOST_COMMUNICATION_HEAT_4C1_ID                13u
#define CAN_APP_LOST_COMMUNICATION_ADS_29C_ID                 14u

#define ADS_ACC_MODE_DISPLAYL_OFF_MODE                        0u
#define ADS_ACC_MODE_DISPLAYL_PASSIVE_MODE                    1u
#define ADS_ACC_MODE_DISPLAYL_STAND_BY_MODE                   2u
#define ADS_ACC_MODE_DISPLAYL_ACTIVE_CONTROL_MODE             3u
#define ADS_ACC_MODE_DISPLAYL_BRAKE_ONLY_MODE                 4u
#define ADS_ACC_MODE_DISPLAYL_OVENIDE                         5u
#define ADS_ACC_MODE_DISPLAYL_STAND_STILL_ACTIVE_MODE         6u
#define ADS_ACC_MODE_DISPLAYL_STAND_STILL_WAIT_MODE           7u
#define ADS_ACC_MODE_DISPLAYL_TEMPORARY_FAILURE_MODE          8u
#define ADS_ACC_MODE_DISPLAYL_PERMANENT_FAILURE               9u

#define ADS_DNP_STATS_OFF           0u
#define ADS_DNP_STATS_PASSIVE       1u
#define ADS_DNP_STATS_LCC_READY     2u
#define ADS_DNP_STATS_DNP_READY     3u
#define ADS_DNP_STATS_LCC_ACTIVE2   4u
#define ADS_DNP_STATS_ILCA_ACTIVE   5u
#define ADS_DNP_STATS_DNP_ACTIVE    6u
#define ADS_DNP_STATS_FAULT         7u
#define ADS_DNP_STATS_MRC           8u
#define ADS_DNP_STATS_FORBIDDEN     9u
#define ADS_DNP_STATS_LCC_ACTIVE1   10u

#define ADS_DNP_TAKE_OVER_REQ_S_INACTIVE        0u
#define ADS_DNP_TAKE_OVER_REQ_S_WARNING_LEVEL1  1u
#define ADS_DNP_TAKE_OVER_REQ_S_WARNING_LEVEL2  2u
#define ADS_DNP_TAKE_OVER_REQ_S_WARNING_LEVEL3  3u
#define ADS_DNP_TAKE_OVER_REQ_S_SAFE_STOP       4u
#define ADS_DNP_TAKE_OVER_REQ_S_EXIT            5u

#define POWER_GEAR_INVALID  0u
#define POWER_GEAR_OFF      1u
#define POWER_GEAR_ACC      2u
#define POWER_GEAR_ON       3u



#define POWER_GEAR_EVENT_NULL      0u
#define POWER_GEAR_EVENT_OFF       1u
#define POWER_GEAR_EVENT_ACC       2u
#define POWER_GEAR_EVENT_ON        3u

#define Heat_Limit_ACC_Enbale      1u
#define Heat_Limit_ACC_DISABLE    0u



void app_sig_sws_r_multimedia_tx_process(uint8_t value, uint8_t tx_count, uint8_t valid_count);
void app_sig_sws_r_left_menu_tx_process(uint8_t value, uint8_t tx_count, uint8_t valid_count);
void app_sig_sws_r_voicd_expand_2_tx_process(uint8_t value, uint8_t tx_count, uint8_t valid_count);
void app_sig_sws_r_auto_show_in_tx_process(uint8_t value, uint8_t tx_count, uint8_t valid_count);
void app_sig_sws_r_auto_show_out_tx_process(uint8_t value, uint8_t tx_count, uint8_t valid_count);
void app_sig_sws_r_mileage_clear_tx_process(uint8_t value, uint8_t tx_count, uint8_t valid_count);
void AppCan_EventSig_SWS_R_MediaReset_TxProcess(uint8_t Value, uint8_t TxNum, uint8_t EventSigTxNum);
void AppCan_EventSig_SWS_R_OtherRecover_TxProcess(uint8_t Value, uint8_t TxNum, uint8_t EventSigTxNum);
void app_sig_sws_r_multimedia_tx_conf(void);
void app_sig_sws_r_left_menu_tx_conf(void);
void app_sig_sws_r_voicd_expand_2_tx_conf(void);
void app_sig_sws_r_auto_show_in_tx_conf(void);
void app_sig_sws_r_auto_show_out_tx_conf(void);
void app_sig_sws_r_mileage_clear_tx_conf(void);
void AppCan_EventSig_SWS_R_MediaReset_TxConf(void);
void AppCan_EventSig_SWS_R_OtherRecover_TxConf(void);


void app_mpc_316_rx_conf(void);
void app_meter_055_rx_conf(void);
void app_bcm_1_12d_rx_conf(void);
void app_bcm_2_50d_rx_conf(void);
void app_mod_4g_49a_rx_conf(void);
void app_multimedia_385_rx_conf(void);
void app_cloud_services_0a2_rx_conf(void);
void app_bcm_evp2_394_rx_conf(void);
void app_air_condition_ctrl_2db_rx_conf(void);
void app_vcu_40d_rx_conf(void);
void app_bcm_l_407_rx_conf(void);
void app_meter_1_dir_4bf_rx_conf(void);
void app_bcm_r_4e6_rx_conf(void);
void app_bcm_heat_4c1_rx_conf(void);
void app_ads_29c_rx_conf(void);


void app_mpc_316_to_conf(void);
void app_meter_055_to_conf(void);
void app_bcm_1_12d_to_conf(void);
void app_bcm_2_50d_to_conf(void);
void app_mod_4g_49a_to_conf(void);
void app_multimedia_385_to_conf(void);
void app_cloud_services_0a2_to_conf(void);
void app_bcm_evp2_394_to_conf(void);
void app_air_condition_ctrl_2db_to_conf(void);
void app_vcu_40d_to_conf(void);
void app_bcm_l_407_to_conf(void);
void app_meter_1_dir_4bf_to_conf(void);
void app_bcm_r_4e6_to_conf(void);
void app_bcm_heat_4c1_to_conf(void);
void app_ads_29c_to_conf(void);


void can_app_receive_signal(uint8_t rx_sig_id, void *signal_data_ptr);

void can_app_init(void);
void CanApp_WakeupProcess(void);
uint8_t CAN_GetControlBy(void);
void CAN_SetControlBy(uint8_t ControlBy);
#endif