
#ifndef __UDSSERVERCALLBACKS_GM_H
#define __UDSSERVERCALLBACKS_GM_H

/* ------------------------------ Includes --------------------------------- */
//#include "Global.h"
//#include "ISO15765_3_CFG.h"

//<<Wang
#include "Std_Types.h"
typedef unsigned char UI_8; 
//Wang>>
/* --------------------------- Type Definitions ---------------------------- */

/* ------------------------------- Defines --------------------------------- */
#define START_DOWNLOAD_VALUE (0xABC1)	/* Memory value to indicate to the bootloader that a reprogramming session is requested */

/************************* DATA IDENTIFIERS ***********************************/

/*** SUPPORTED DATA IDENTIFIERS FOR READDATABYID AND WRITEDATABYID SERVICES ***/

/* FICOSA DIDs */
/* DIAGNOSTICS ACTIVE */

#define DID_DIAGNOSTICS_ACTIVE											((UI_16)0x08)	//ACT: 		0x7CA, 0x03, 0x2F, 0x08, 0x01, 0x50, 0x50, 0x50, 0x50
																						//FREE: 	0x7CA, 0x03, 0x2F, 0x08, 0xFF, 0x50, 0x50, 0x50, 0x50
/* CAN IDS MANAGEMENT */
#define DID_CAN_IDS_MANAGEMENT_SEED								((UI_16)0x001)	// 0x7CA, 0x04, 0x2E, 0x00, 0x01, 0xSD, 0x50, 0x50, 0x50

/* SYSTEM SHUTDOWN NOTIF */
#define DID_SYSTEM_SHUTDOWN_NOTIF								((UI_16)0x002)	// 0x7CA, 0x04, 0x2E, 0x00, 0x02, 0xSS, 0x50, 0x50, 0x50

/* LENGTH OF DATA IDENTIFIERS FOR READDATABYID AND WRITEDATABYID SERVICES */

/*** SUPPORTED LOCAL IDENTIFIERS FOR INPUTOUTPUTCONTROLBYLOCALID SERVICE ***/

/* FICOSA DIDs */

/* MOTOR DRIVING DRIVING AND MONITORING */

#define DID_MOTOR_DRIVING								((UI_16)0x01)

#define IO_CTL_LED_STATUS           			((UI_16)0xFA00)

#define IO_CTL_ACT_MOV_SUB_RETURN_CONTOL		((UI_8)0x00)
#define IO_CTL_ACT_MOV_SUB_RESET        		((UI_8)0x01)
#define IO_CTL_ACT_MOV_SUB_FREEZE       		((UI_8)0x02)
#define IO_CTL_ACT_MOV_SUB_CONTROL       		((UI_8)0x03)

/*** SUPPORTED LOCAL IDENTIFIERS FOR ROUTINE CONTROL SERVICE ***/

/* FICOSA DIDs */
#define ROUTINE_CTL_N_CAL_DEMO	     			((UI_16)0xF1C1)
#define ROUTINE_CTL_CALIBRATION_MODE			((UI_16)0xF1C0)
#define ROUTINE_CTL_UNCALIBRATION_MODE			((UI_16)0x1800)
#define ROUTINE_CTL_PROGRAM_PRECONDITION		((UI_16)0x0203)

#define ROUTINE_CTL_CALI_IDLE_START             ((UI_16)0x0100)
#define ROUTINE_CTL_CALI_F1_START               ((UI_16)0x0101)
#define ROUTINE_CTL_CALI_F2_START               ((UI_16)0x0102)
#define ROUTINE_CTL_CALI_B1_START               ((UI_16)0x0103)
#define ROUTINE_CTL_CALI_B2_START               ((UI_16)0x0104)

/* Definitions needed for the Read/WriteMemoryByAddress UDS services */
#define FIXED_ADDR_LEN 		((UI_8)4)
#define MAX_ADDR_SIZE 		((UI_8)4)
#define MAX_SIZE_LEN 		((UI_8)0xFF)
#define DIAG_TX_RX_BUF_LEN 	((UI_8)0xFF)
#define MAX_DATA_SIZE 		((UI_8)4)

/** New DID's **/
/* Logistic data */
#define DID_FICOSA_HW_ID					    ((UI_16)0xF192)
#define DID_FICOSA_SW_ID					    ((UI_16)0xF194)
#define DID_CD_SYSID_DIAGNOSTIC_SPEC            ((UI_16)0xF10D)
#define DID_CD_SYSID_ECU_HW_VER_NUMBER          ((UI_16)0xF193)
#define DID_CD_SYSID_ECU_SW_VER_NUMBER          ((UI_16)0xF195)
#define DID_CD_SYSID_BOOT_ID		  			((UI_16)0xF180)
#define DID_CD_SYSID_APP_SW_ID	                ((UI_16)0xF181)
#define DID_CD_SYSID_APP_SW_FINGERPRINT		    ((UI_16)0xF184)
#define DID_CD_SYSID_ACTIVE_DIAG_SESSION		((UI_16)0xF186)
#define DID_CD_SYSID_SPARE_PART_NUMBER   		((UI_16)0xF187)
#define DID_CD_SYSID_ECU_SW_VERSION             ((UI_16)0xF189)
#define DID_CD_SYSID_SYSTEMSUPPLIER_ID			((UI_16)0xF18A)
#define DID_CD_SYSID_KIT_ASSEMLY_PART_NUMBER    ((UI_16)0xF18E)
#define DID_CD_SYSID_REPAIR_SHOP_CODE           ((UI_16)0xF198)
#define DID_CD_SYSID_UDS_PROTOCOL_VERSION       ((UI_16)0xF100)
#define DID_CD_SYSID_REPROGRAMING_DATE          ((UI_16)0xF199)
#define DID_CD_SYSID_BOOT_VERSION          		((UI_16)0xF101)
#define DID_CD_SYSID_DIAGNOSTIC_TABLE_VERSION	((UI_16)0xF10B)
#define DID_CD_SYSID_ECU_NAME                   ((UI_16)0xF197)
#define DID_CD_SYSID_CALIBRATION_SW_VERSION     ((UI_16)0xF1B2)
#define DID_CD_SYSID_SHARED_KEY                 ((UI_16)0xF16A)


#define DID_CD_SYSID_INDEXSRVDATA				((UI_16)0xF011)
#define DID_CD_SYSID_OPERATIONALREF				((UI_16)0xF012)

#define DID_CD_SYSID_ECU_MANUFAC_DATE			((UI_16)0xF18B)
#define DID_CD_SYSID_ECUSNDATAID				((UI_16)0xF18C)
#define DID_CD_SYSID_VIN						((UI_16)0xF190)
#define DID_CD_SYSID_CALIBRATION_DATA			((UI_16)0xF19B)
#define DID_CD_SYSID_BOOT_VERSION				((UI_16)0xF101)
#define DID_CD_SYSID_MANUF_ECUHWNUM				((UI_16)0xF191)
#define DID_CD_SYSID_ECU_INSTALL_DATE			((UI_16)0xF19D)
#define DID_CD_SYSID_VEH_POWERMODE				((UI_16)0xFD08)

#define DID_FUN1                               ((UI_16)0x9020)
#define DID_FUN2                                ((UI_16)0x9021)
#define DID_FUN3                              ((UI_16)0x9022)
#define DID_UP                                  ((UI_16)0x9023)
#define DID_DOWN                                ((UI_16)0x9024)
#define DID_LEFT                                ((UI_16)0x9025)
#define DID_RIGHT                               ((UI_16)0x9026)
#define DID_OK                                  ((UI_16)0x9027)
#define DID_Trigger_Vibration                   ((UI_16)0x9001)
#define DID_DAC_Ref_Voltage                     ((UI_16)0x9002)
#define DID_Vibration_Gain                      ((UI_16)0x9003)
#define DID_DAC_Timer_Period                    ((UI_16)0x9004)
#define DID_Measure_Frame_Switch                ((UI_16)0xA001)


/** Dynamic **/

#define DID_READ_MELEXIS_SPI_DATA  		 		((UI_16)0xFD00)
#define DID_READ_BATTERY_ADC             		((UI_16)0x1000)
#define DID_READ_INTERNAL_ADC             		((UI_16)0xFD01)
#define DID_READ_PADDLE_ADC              		((UI_16)0x1001)
#define DID_READ_PARK_SWITCH_ADC         		((UI_16)0x1002)
#define DID_READ_ECO_SWITCH_ADC          		((UI_16)0x1004)
#define DID_READ_SHIFT_POSITION          		((UI_16)0x2100)
#define DID_READ_ACTUATOR_POSITION          	((UI_16)0x2103)
#define DID_READ_ILLUMINATION_DUTY       		((UI_16)0x2002)
#define DID_READ_TCU_POSITION            		((UI_16)0x2102)
#define DID_READ_BCS_SPEED               		((UI_16)0x0500)
#define DID_READ_BRAKE_STATE             		((UI_16)0x0501)
#define DID_READ_BCM_KEY_STS             		((UI_16)0x1202)
#define DID_READ_SHIFT_DISABLE_CONDITION       ((UI_16)0x1204)
#define DID_READ_REPROGRAMMING_COUNTER         ((UI_16)0x0200)
#define DID_READ_REPROGRAMMING_ATTEMPT_COUNTER ((UI_16)0x0201)
#define DID_READ_SHIFT_LEVER_POS  		 		((UI_16)0x2104)

#define DID_READ_POW_SUP_VOLTAGE  		 		((UI_16)0xB001)
#define DID_READ_SYS_MEC_POSITION  		 		((UI_16)0xB003)
#define DID_READ_P_BUT_STATUS  		 			((UI_16)0xB004)
#define DID_READ_MLX_DIE1_VAL  		 			((UI_16)0xB005)
#define DID_READ_MLX_DIE2_VAL  		 			((UI_16)0xB006)


#define DID_READ_DTC_OCCURENCE_CNT  		 	((UI_16)0xB101)
#define DID_READ_FAULT_DET_CNT  		 		((UI_16)0xB102)
#define DID_READ_UNCOMPLETE_TES_CNT  		 	((UI_16)0xB103)
#define DID_READ_FAULT_OCCUENCE_CNT  		 	((UI_16)0xB104)
#define DID_READ_DTC_AGEING_CNT  		 		((UI_16)0xB105)
#define DID_READ_ALLDTC_EXT_REC  		 		((UI_16)0xB106)

/** FICOSA **/
#define DID_FICOSA_CALI_STABLE_POSTION      ((UI_16)0xFD02)
#define DID_FICOSA_CALI_F2_POSTION          ((UI_16)0xFD06)
#define DID_FICOSA_CALI_B2_POSTION          ((UI_16)0xFD05)
#define DID_FICOSA_CALI_F1_POSTION          ((UI_16)0xFD03)
#define DID_FICOSA_CALI_B1_POSTION          ((UI_16)0xFD04)
#define DID_SHIFT_PADDLE_CONFKGURE          ((UI_16)0xFD10)
#define DID_FICOSA_SHIELD_ATP				((UI_16)0x0600)

#define DID_FICOSA_DRIVE_MODE_CONFIGURE		((UI_16)0x0102)

#define DID_FICOSA_SHIFT_FAILURE_REASON		((UI_16)0x1204)
#define DID_FICOSA_SHIFT_RESET_REASON		((UI_16)0x1205)
#define DID_FICOSA_MLX_OPERATION_MODE		((UI_16)0xFD07)
/* GAC */
#define DID_GAC_MANUFACTORY_MODE            ((UI_16)0x0110)
#define DID_GAC_DTC_SETTING_CONTROL_STATE   ((UI_16)0x0120)
#define DID_GAC_TRANSPORTATION_MODE         ((UI_16)0x0140)

#define IO_CTL_LED_STATUS_MS_MASK       ((UI_16)0x08)
#define IO_CTL_LED_STATUS_D_MASK        ((UI_16)0x10)
#define IO_CTL_LED_STATUS_N_MASK        ((UI_16)0x20)
#define IO_CTL_LED_STATUS_R_MASK        ((UI_16)0x40)
#define IO_CTL_LED_STATUS_P_MASK        ((UI_16)0x80)

#define IO_STS_LED_STATUS_D_MASK        ((UI_16)0x10)
#define IO_STS_LED_STATUS_N_MASK        ((UI_16)0x20)
#define IO_STS_LED_STATUS_R_MASK        ((UI_16)0x40)
#define IO_STS_LED_STATUS_P_MASK        ((UI_16)0x80)

/*Applicaiton*/
#define DID_TOUCH_SEN1_BASE_LINE      ((UI_16)0x7000)
#define DID_TOUCH_SEN2_BASE_LINE      ((UI_16)0x7001)
#define DID_TOUCH_SEN3_BASE_LINE      ((UI_16)0x7002)
#define DID_TOUCH_SEN4_BASE_LINE      ((UI_16)0x7003)
#define DID_TOUCH_SEN5_BASE_LINE      ((UI_16)0x7004)
#define DID_TOUCH_SEN6_BASE_LINE      ((UI_16)0x7005)
#define DID_TOUCH_SEN7_BASE_LINE      ((UI_16)0x7006)
#define DID_TOUCH_SEN8_BASE_LINE      ((UI_16)0x7007)
#define DID_TOUCH_SEN9_BASE_LINE      ((UI_16)0x7008)
#define DID_TOUCH_SEN10_BASE_LINE      ((UI_16)0x7009)
#define DID_TOUCH_SEN11_BASE_LINE      ((UI_16)0x700A)
#define DID_TOUCH_SEN12_BASE_LINE      ((UI_16)0x700B)
#define DID_TOUCH_SEN13_BASE_LINE      ((UI_16)0x700C)
#define DID_TOUCH_SEN14_BASE_LINE      ((UI_16)0x700D)
#define DID_TOUCH_SEN15_BASE_LINE      ((UI_16)0x700E)

#define DID_TOUCH_SEN1_SIGNAL      ((UI_16)0x7010)
#define DID_TOUCH_SEN2_SIGNAL      ((UI_16)0x7011)
#define DID_TOUCH_SEN3_SIGNAL      ((UI_16)0x7012)
#define DID_TOUCH_SEN4_SIGNAL      ((UI_16)0x7013)
#define DID_TOUCH_SEN5_SIGNAL      ((UI_16)0x7014)
#define DID_TOUCH_SEN6_SIGNAL      ((UI_16)0x7015)
#define DID_TOUCH_SEN7_SIGNAL      ((UI_16)0x7016)
#define DID_TOUCH_SEN8_SIGNAL      ((UI_16)0x7017)
#define DID_TOUCH_SEN9_SIGNAL      ((UI_16)0x7018)
#define DID_TOUCH_SEN10_SIGNAL      ((UI_16)0x7019)
#define DID_TOUCH_SEN11_SIGNAL      ((UI_16)0x701A)
#define DID_TOUCH_SEN12_SIGNAL      ((UI_16)0x701B)
#define DID_TOUCH_SEN13_SIGNAL      ((UI_16)0x701C)
#define DID_TOUCH_SEN14_SIGNAL      ((UI_16)0x701D)
#define DID_TOUCH_SEN15_SIGNAL      ((UI_16)0x701E)

#define DID_PRESEE_SEN_BASELINE      ((UI_16)0x7020)
#define DID_PRESEE_SEN_SIGNAL      ((UI_16)0x7021)
#define DID_PRESEE_SEN_PRE_VAL      ((UI_16)0x7022)

/*---------------------------  Global variables ---------------------------- */
//#pragma push

//#pragma section data_type ".sect_shr_var_ram" ".sect_shr_var_ram"

/* Variable to enable directly a download session after a SW reset. This variable */
/* will be set by the application before reset only in the case that a reprog     */
/* session is requested.                                                           */
/* This variable is declared here in main to make it clear for everybody that it  */
/* is shared between bootloader and application.                                   */
//extern UI_16 start_download;
//
///* Bootloader variable that tells if bootloader must respond or not to the session
//change when coming from application (supress positive response)      */
//extern UI_16 start_download_response;
//
///* Variable shared between bootloader and application in which application says to */
///* bootloader to perform a memory selfcheck because it has detected some problems  */
///* This variable is declared here in main to make it clear for everybody that it   */
///* is shared between bootloader and application                                    */
//extern UI_16 check_app;
//
///* Bootloader variable that tells if bootloader must give control to the app       */
//extern UI_16 bootloader_active;
//
////#pragma pop

extern uint8 security_faa_flag;
extern UI_8 manufactory_mode;
extern BOOL uds_control_led;
extern BOOL uds_control_led_lmc;
extern uint8 uds_control_led_conbyte;
extern BOOL uds_control_led_p;
extern BOOL uds_control_led_r;
extern BOOL uds_control_led_n;
extern BOOL uds_control_led_d;
//extern BOOL dtc_setting;
/* ------------------------- Function prototypes --------------------------- */

/*****************************************************************************
 | Portability:  DEFC Project
 |----------------------------------------------------------------------------
 | Description:
 |  * Routine that commands the TcuUdsTesterPresent diagnostic service and is
 |    responsible for giving the final answer to ISO_3 layer.
 |---------------------------------------------------------------------------
 | Parameters description:
 |  UI_8 tp_type : tester present type requested
 |  result none : ...
 | Timing:
 |  Tmax Int Dis:   ? cicles cpu | O(n): CTE
 |  Tmax Int En :   ? cicles cpu | O(n): CTE
 |  Tmax Total  :   ? cicles cpu | O(n): CTE
 /---------------------------------------------------------------------------*/
void UdsTesterPresent(UI_8 tp_type);


/*****************************************************************************
 | Portability:  DEFC Project
 |----------------------------------------------------------------------------
 | Description:
 |  * Routine that commands all the ReadDataByIdentifier diagnostics and is
 |    responsible for giving the final answer to ISO_3 layer.
 |---------------------------------------------------------------------------
 | Parameters description:
 |  UI_8 id_h : higher byte of the identifier requested
 |  UI_8 id_l : lower byte of the identifier requested
 |  result none : ...
 | Timing:
 |  Tmax Int Dis:   ? cicles cpu | O(n): CTE
 |  Tmax Int En :   ? cicles cpu | O(n): CTE
 |  Tmax Total  :   ? cicles cpu | O(n): CTE
 /---------------------------------------------------------------------------*/
UI_8 UdsReadDataByIdentifier(UI_8 id_h, UI_8 id_l);


/*****************************************************************************
 | Portability:  DEFC Project
 |----------------------------------------------------------------------------
 | Description:
 |  * Routine that commands all the WriteDataByIdentifier diagnostics and is
 |    responsible for giving the final answer to ISO_3 layer.
 |---------------------------------------------------------------------------
 | Parameters description:
 |  UI_8 id_h : higher byte of the identifier requested
 |  UI_8 id_l : lower byte of the identifier requested
 |  UI_8 *data_buffer: data pointer of the received parameters for the write
 |  UI_16 size: length of the parameters received for the write
 |  result none : ...
 | Timing:
 |  Tmax Int Dis:   ? cicles cpu | O(n): CTE
 |  Tmax Int En :   ? cicles cpu | O(n): CTE
 |  Tmax Total  :   ? cicles cpu | O(n): CTE
 /---------------------------------------------------------------------------*/
void UdsWriteDataByIdentifier(UI_8 id_h, UI_8 id_l, UI_8 *buf_data_rx, UI_16 size);

/*****************************************************************************
 | Portability:  DEFC Project
 |----------------------------------------------------------------------------
 | Description:
 |  * Routine that commands the TcuUdsReadMemoryByAddress diagnostic service
 |    and is responsible for giving the final answer to ISO_3 layer.
 |---------------------------------------------------------------------------
 | Parameters description:
 |  UI_8 mem_size_len: length of the requested size in bytes
 |  UI_8 mem_addr_len: length of the requested address in bytes
 |  UI_8 *mem_addr: data pointer to the requested initial memory address to be read
 |  UI_8 *mem_size: data pointer to the requested memory size to be read
 |  result none : ...
 | Timing:
 |  Tmax Int Dis:   ? cicles cpu | O(n): CTE
 |  Tmax Int En :   ? cicles cpu | O(n): CTE
 |  Tmax Total  :   ? cicles cpu | O(n): CTE
 /---------------------------------------------------------------------------*/
void UdsReadMemoryByAddress(UI_8 mem_size_len, UI_8 mem_addr_len,
		UI_8 *mem_addr, UI_8 *mem_size);


/*****************************************************************************
 | Portability:  DEFC Project
 |----------------------------------------------------------------------------
 | Description:
 |  * Routine that commands the TcuUdsWriteMemoryByAddress diagnostic service
 |    and is responsible for giving the final answer to ISO_3 layer.
 |---------------------------------------------------------------------------
 | Parameters description:
 |  UI_8 addr_data_size: The first four bits cointains the data size length in
 |                       bytes and the last four bits contains the address size
 |                       length in bytes
 |  UI_8 *data_buffer: Data pointer where to find the requested initial write
 |                     address, the requested write length and the values to write
 |                     in memory
 |  UI_16 size: ...
 |  result none : ...
 | Timing:
 |  Tmax Int Dis:   ? cicles cpu | O(n): CTE
 |  Tmax Int En :   ? cicles cpu | O(n): CTE
 |  Tmax Total  :   ? cicles cpu | O(n): CTE
 /---------------------------------------------------------------------------*/
void UdsWriteMemoryByAddr(UI_8 addr_data_size, UI_8 *data_buffer, UI_16 size);


/*****************************************************************************
 | Portability:  DEFC Project
 |----------------------------------------------------------------------------
 | Description:
 |  * Routine that commands the InputOutputControlByLocalId diagnostic
 |    service and is responsible for giving the final answer to ISO_3 layer
 |---------------------------------------------------------------------------
 | Parameters description:
 |  UI_8 *data_buffer: data pointer to the received control data
 |  UI_8 size: length of the data received to control
 |  result none : ...
 | Timing:
 |  Tmax Int Dis:   ? cicles cpu | O(n): CTE
 |  Tmax Int En :   ? cicles cpu | O(n): CTE
 |  Tmax Total  :   ? cicles cpu | O(n): CTE
 /---------------------------------------------------------------------------*/
void UdsInputOutputControlByIdentifier(UI_8 id_h, UI_8 id_l, UI_8 io_ctrl_type, UI_8* buf_data_rx, UI_16 size);

/*****************************************************************************
 | Portability:  DEFC Project
 |----------------------------------------------------------------------------
 | Description:
 |  * Routine that commands the TcuUdsDiagnosticSessionControl diagnostic
 |    service and is responsible for giving the final answer to ISO_3 layer.
 |---------------------------------------------------------------------------
 | Arguments:
 |  - session: requested new session
 |---------------------------------------------------------------------------
 | Parameters description:
 |  UI_8 session: requested new session
 |  result none : ..
 | Timing:
 |  Tmax Int Dis:   ? cicles cpu | O(n): CTE
 |  Tmax Int En :   ? cicles cpu | O(n): CTE
 |  Tmax Total  :   ? cicles cpu | O(n): CTE
 /---------------------------------------------------------------------------*/
void UdsDiagnosticSessionControl(UI_8 session);

/*****************************************************************************
 | Portability:  DEFC Project
 |----------------------------------------------------------------------------
 | Description:
 |  * UdServices diagnostic initialitzation task. This routine should only
 |    be called one time at the microcontroller initialization
 |---------------------------------------------------------------------------
 | Parameters description:
 |  void: ...
 |  result none : ...
 | Timing:
 |  Tmax Int Dis:   ? cicles cpu | O(n): CTE
 |  Tmax Int En :   ? cicles cpu | O(n): CTE
 |  Tmax Total  :   ? cicles cpu | O(n): CTE
 /---------------------------------------------------------------------------*/
void UdsServerCallbacksInit(void);


/*****************************************************************************
 | Portability:  DEFC Project
 |----------------------------------------------------------------------------
 | Description:
 |  * UdServices diagnostic task executed in every main cycle
 |---------------------------------------------------------------------------
 | Parameters description:
 |  void: ...
 |  result none : ...
 | Timing:
 |  Tmax Int Dis:   ? cicles cpu | O(n): CTE
 |  Tmax Int En :   ? cicles cpu | O(n): CTE
 |  Tmax Total  :   ? cicles cpu | O(n): CTE
 /---------------------------------------------------------------------------*/
void UdsServerCallbacksTask(void);

/*****************************************************************************
 | Portability:  DEFC Project
 |----------------------------------------------------------------------------
 | Description:
 |  *
 |---------------------------------------------------------------------------
 | Parameters description:
 |  param : ...
 |  result none : ...
 | Timing:
 |  Tmax Int Dis:   ? cicles cpu | O(n): CTE
 |  Tmax Int En :   ? cicles cpu | O(n): CTE
 |  Tmax Total  :   ? cicles cpu | O(n): CTE
 /---------------------------------------------------------------------------*/
void UdsIniSession(void);

/*****************************************************************************
 | Portability:  DEFC Project
 |----------------------------------------------------------------------------
 | Description:
 |  *
 |---------------------------------------------------------------------------
 | Parameters description:
 |  param : ...
 |  result none : ...
 | Timing:
 |  Tmax Int Dis:   ? cicles cpu | O(n): CTE
 |  Tmax Int En :   ? cicles cpu | O(n): CTE
 |  Tmax Total  :   ? cicles cpu | O(n): CTE
 /---------------------------------------------------------------------------*/
BOOL UdsCheckResetIsPossible(UI_8 reset_type);

/*****************************************************************************
 | Portability:  DEFC Project
 |----------------------------------------------------------------------------
 | Description:
 |  *
 |---------------------------------------------------------------------------
 | Parameters description:
 |  param : ...
 |  result none : ...
 | Timing:
 |  Tmax Int Dis:   ? cicles cpu | O(n): CTE
 |  Tmax Int En :   ? cicles cpu | O(n): CTE
 |  Tmax Total  :   ? cicles cpu | O(n): CTE
 /---------------------------------------------------------------------------*/
void UdsExecuteResetNow(UI_8 reset_type);

/*****************************************************************************
 | Portability:  DEFC Project
 |----------------------------------------------------------------------------
 | Description:
 |  *
 |---------------------------------------------------------------------------
 | Parameters description:
 |  param : ...
 |  result none : ...
 | Timing:
 |  Tmax Int Dis:   ? cicles cpu | O(n): CTE
 |  Tmax Int En :   ? cicles cpu | O(n): CTE
 |  Tmax Total  :   ? cicles cpu | O(n): CTE
 /---------------------------------------------------------------------------*/
UI_8 UdsControlRoutineCallback(UI_8 id_high, UI_8 id_low, UI_8* routine_entry_option, UI_16 size);

/*****************************************************************************
 | Portability:  DEFC Project
 |----------------------------------------------------------------------------
 | Description:
 |  *
 |---------------------------------------------------------------------------
 | Parameters description:
 |  param : ...
 |  result none : ...
 | Timing:
 |  Tmax Int Dis:   ? cicles cpu | O(n): CTE
 |  Tmax Int En :   ? cicles cpu | O(n): CTE
 |  Tmax Total  :   ? cicles cpu | O(n): CTE
 /---------------------------------------------------------------------------*/
//UI_8 UdsSecurityGetSeed(UI_8 seed_type, UI_8 * seed);

/*****************************************************************************
 | Portability:  DEFC Project
 |----------------------------------------------------------------------------
 | Description:
 |  *
 |---------------------------------------------------------------------------
 | Parameters description:
 |  param : ...
 |  result none : ...
 | Timing:
 |  Tmax Int Dis:   ? cicles cpu | O(n): CTE
 |  Tmax Int En :   ? cicles cpu | O(n): CTE
 |  Tmax Total  :   ? cicles cpu | O(n): CTE
 /---------------------------------------------------------------------------*/
//BOOL UdsSecurityCheckKey(UI_8 key_type, UI_8 * seed, UI_8 * key, UI_8 * response_mode);
/*****************************************************************************
 | Portability:  DEFC Project
 |----------------------------------------------------------------------------
 | Description:
 |  *
 |---------------------------------------------------------------------------
 | Parameters description:
 |  param : ...
 |  result none : ...
 | Timing:
 |  Tmax Int Dis:   ? cicles cpu | O(n): CTE
 |  Tmax Int En :   ? cicles cpu | O(n): CTE
 |  Tmax Total  :   ? cicles cpu | O(n): CTE
 /---------------------------------------------------------------------------*/
void UdsCommunicationControl(UI_8 subfunction, UI_8 comtype);

/*****************************************************************************
 | Portability:  DEFC Project
 |----------------------------------------------------------------------------
 | Description:
 |  *
 |---------------------------------------------------------------------------
 | Parameters description:
 |  param : ...
 |  result none : ...
 | Timing:
 |  Tmax Int Dis:   ? cicles cpu | O(n): CTE
 |  Tmax Int En :   ? cicles cpu | O(n): CTE
 |  Tmax Total  :   ? cicles cpu | O(n): CTE
 /---------------------------------------------------------------------------*/
void UdsSecurityNvmCallback(UI_8 *counter);

/*****************************************************************************
 | Portability:  DEFC Project
 |----------------------------------------------------------------------------
 | Description:
 |  *
 |---------------------------------------------------------------------------
 | Parameters description:
 |  param : ...
 |  result none : ...
 | Timing:
 |  Tmax Int Dis:   ? cicles cpu | O(n): CTE
 |  Tmax Int En :   ? cicles cpu | O(n): CTE
 |  Tmax Total  :   ? cicles cpu | O(n): CTE
 /---------------------------------------------------------------------------*/
UI_8 UdsSecurityLoadNvmCallback(void);

#define STORAGE_FAA_CALLBACK   (StorageFaaFlag)
void StorageFaaFlag(void);
void QMGatewayDEMTask(void);

#endif
