
/* -------------------------------- Includes -------------------------------- */
#include ".\OsekCom.h"
#include <stddef.h>      // Defines NULL
#include <stdbool.h>     // Defines true
#include <stdlib.h>      // Defines EXIT_FAILURE
#include "definitions.h" // SYS function prototypes
#include "Std_Types.h"
#include "DiagnosticR/FicOsek/FicOsekCom.h"
#include "RTE.h"
#include "FunctionState.h"
/* -------------------------------- Defines --------------------------------- */
#define CAN_CALC_STD_ID(id) ((uint32_t)(id))
/* ID in Target Process format of frames with static ID */
#define ID_TP_FRM_SWTRPRIVATEDHUCANFR06 (CAN_CALC_STD_ID(0x38U))
#define ID_TP_FRM_SWTRPRIVATEDHUCANFR05 (CAN_CALC_STD_ID(0x383U))
#define ID_TP_FRM_SWTRPRIVATEDHUCANFR04 (CAN_CALC_STD_ID(0x37FU))
#define ID_TP_FRM_SWTRPRIVATEDHUCANFR03 (CAN_CALC_STD_ID(0x37BU))
#define ID_TP_FRM_SWTRPRIVATEDHUCANFR02 (CAN_CALC_STD_ID(0x307U))
#define ID_TP_FRM_SWTRPRIVATEDHUCANFR01 (CAN_CALC_STD_ID(0x309U))
#define ID_TP_FRM_SWTRPRESSFR01 (CAN_CALC_STD_ID(0x410U))
#define ID_TP_FRM_SWTRSENSORFR01 (CAN_CALC_STD_ID(0x411U))
#define ID_TP_FRM_SWTRSENSORFR02 (CAN_CALC_STD_ID(0x412U))
#define ID_TP_FRM_SWTRSENSORFR03 (CAN_CALC_STD_ID(0x413U))
#define ID_TP_FRM_SWTRSENSORFR04 (CAN_CALC_STD_ID(0x414U))
#define ID_TP_FRM_SWTRSENSORFR05 (CAN_CALC_STD_ID(0x415U))
#define ID_TP_FRM_SWTRSENSORFR06 (CAN_CALC_STD_ID(0x416U))
#define ID_TP_FRM_SWTRSENSORFR07 (CAN_CALC_STD_ID(0x417U))
#define ID_TP_FRM_SWTRSENSORFR08 (CAN_CALC_STD_ID(0x418U))
#define ID_TP_FRM_IHUPRIVATEDHUCANFR01 (CAN_CALC_STD_ID(0x30U))
#define ID_TP_FRM_DIAG_PHYSRESP_SWTR (CAN_CALC_STD_ID(0x610U))
#define ID_TP_FRM_DIAG_PHYSREQ_SWTR (CAN_CALC_STD_ID(0x710U))
#define ID_TP_FRM_DIAG_FUNCREQ (CAN_CALC_STD_ID(0x7FFU))
/* Max length of Tx Com frames */
#define MAX_LEN_FRM_SWTRPRIVATEDHUCANFR06 ((uint16_t)8)
#define MAX_LEN_FRM_SWTRPRIVATEDHUCANFR05 ((uint16_t)8)
#define MAX_LEN_FRM_SWTRPRIVATEDHUCANFR04 ((uint16_t)8)
#define MAX_LEN_FRM_SWTRPRIVATEDHUCANFR03 ((uint16_t)8)
#define MAX_LEN_FRM_SWTRPRIVATEDHUCANFR02 ((uint16_t)8)
#define MAX_LEN_FRM_SWTRPRIVATEDHUCANFR01 ((uint16_t)8)
#define MAX_LEN_FRM_SWTRPRESSFR01 ((uint16_t)8)
#define MAX_LEN_FRM_SWTRSENSORFR01 ((uint16_t)8)
#define MAX_LEN_FRM_SWTRSENSORFR02 ((uint16_t)8)
#define MAX_LEN_FRM_SWTRSENSORFR03 ((uint16_t)8)
#define MAX_LEN_FRM_SWTRSENSORFR04 ((uint16_t)8)
#define MAX_LEN_FRM_SWTRSENSORFR05 ((uint16_t)8)
#define MAX_LEN_FRM_SWTRSENSORFR06 ((uint16_t)8)
#define MAX_LEN_FRM_SWTRSENSORFR07 ((uint16_t)8)
#define MAX_LEN_FRM_SWTRSENSORFR08 ((uint16_t)8)
#define MAX_LEN_FRM_DIAG_PHYSRESP_SWTR ((UI_16)8)

/* Min length of Rx frames to be able to decode each signal */
#define MIN_LEN_FRM_SIG_TWLIBRISTS_UB ((uint16_t)3)
#define MIN_LEN_FRM_SIG_TWLIBRISTS ((uint16_t)3)
#define MIN_LEN_FRM_SIG_SWTOFKEYTONE_UB ((uint16_t)1)
#define MIN_LEN_FRM_SIG_SWTOFKEYTONE ((uint16_t)1)
#define MIN_LEN_FRM_SIG_INTRBRISTS_UB ((uint16_t)1)
#define MIN_LEN_FRM_SIG_INTRBRISTS ((uint16_t)1)
#define MIN_LEN_FRM_SIG_ACTVNOFSTEERWHLILLMN_UB ((uint16_t)6)
#define MIN_LEN_FRM_SIG_ACTVNOFSTEERWHLILLMN ((uint16_t)6)
#define MIN_LEN_FRM_SIG_DIAGNOSTICREQSWTR ((UI_16)1)
#define MIN_LEN_FRM_SIG_DIAGNOSTICFUNCADDRREQ ((UI_16)1)

/* First byte of dynamic length signals */
#define FB_SIG_DIAGNOSTICREQSWTR ((UI_8)0)
#define FB_SIG_DIAGNOSTICFUNCADDRREQ ((UI_8)0)
/* Maximum length of dynamic length signals */
#define MAX_LEN_FRM_DIAG_PHYSRESP_SWTR ((UI_16)8)
#define MAX_LEN_SIG_DIAGNOSTICRESPSWTR ((UI_16)8)
#define MAX_LEN_SIG_DIAGNOSTICFUNCADDRREQ ((UI_8)8)
#define MAX_LEN_SIG_DIAGNOSTICREQSWTR ((UI_8)8)

#define ENDIAN_BYTE(byte, alloc_size) (byte)

/* Macros of the TX_REQ flags */
#define SET_FLAG_TX_REQ_FRM_SWTRPRIVATEDHUCANFR06() (flag_swtr_com_tx_req0 |= ((uint8_t)0x01))
#define RST_FLAG_TX_REQ_FRM_SWTRPRIVATEDHUCANFR06() (flag_swtr_com_tx_req0 &= ((uint8_t)0xFE))
#define TST_FLAG_TX_REQ_FRM_SWTRPRIVATEDHUCANFR06() ((flag_swtr_com_tx_req0 & ((uint8_t)0x01)) == ((uint8_t)0x01))

#define SET_FLAG_TX_REQ_FRM_SWTRPRIVATEDHUCANFR02() (flag_swtr_com_tx_req0 |= ((uint8_t)0x02))
#define RST_FLAG_TX_REQ_FRM_SWTRPRIVATEDHUCANFR02() (flag_swtr_com_tx_req0 &= ((uint8_t)0xFD))
#define TST_FLAG_TX_REQ_FRM_SWTRPRIVATEDHUCANFR02() ((flag_swtr_com_tx_req0 & ((uint8_t)0x02)) == ((uint8_t)0x02))

#define SET_FLAG_TX_REQ_FRM_SWTRPRIVATEDHUCANFR01() (flag_swtr_com_tx_req0 |= ((uint8_t)0x04))
#define RST_FLAG_TX_REQ_FRM_SWTRPRIVATEDHUCANFR01() (flag_swtr_com_tx_req0 &= ((uint8_t)0xFB))
#define TST_FLAG_TX_REQ_FRM_SWTRPRIVATEDHUCANFR01() ((flag_swtr_com_tx_req0 & ((uint8_t)0x04)) == ((uint8_t)0x04))

#define SET_FLAG_TX_REQ_FRM_SWTRPRIVATEDHUCANFR03() (flag_swtr_com_tx_req0 |= ((uint8_t)0x08))
#define RST_FLAG_TX_REQ_FRM_SWTRPRIVATEDHUCANFR03() (flag_swtr_com_tx_req0 &= ((uint8_t)0xF7))
#define TST_FLAG_TX_REQ_FRM_SWTRPRIVATEDHUCANFR03() ((flag_swtr_com_tx_req0 & ((uint8_t)0x08)) == ((uint8_t)0x08))

#define SET_FLAG_TX_REQ_FRM_SWTRPRIVATEDHUCANFR04() (flag_swtr_com_tx_req0 |= ((uint8_t)0x10))
#define RST_FLAG_TX_REQ_FRM_SWTRPRIVATEDHUCANFR04() (flag_swtr_com_tx_req0 &= ((uint8_t)0xEF))
#define TST_FLAG_TX_REQ_FRM_SWTRPRIVATEDHUCANFR04() ((flag_swtr_com_tx_req0 & ((uint8_t)0x10)) == ((uint8_t)0x10))

#define SET_FLAG_TX_REQ_FRM_SWTRPRIVATEDHUCANFR05() (flag_swtr_com_tx_req0 |= ((uint8_t)0x20))
#define RST_FLAG_TX_REQ_FRM_SWTRPRIVATEDHUCANFR05() (flag_swtr_com_tx_req0 &= ((uint8_t)0xDF))
#define TST_FLAG_TX_REQ_FRM_SWTRPRIVATEDHUCANFR05() ((flag_swtr_com_tx_req0 & ((uint8_t)0x20)) == ((uint8_t)0x20))

#define SET_FLAG_TX_REQ_FRM_SWTRPRESSFR01() (flag_swtr_com_tx_req0 |= ((uint8_t)0x40))
#define RST_FLAG_TX_REQ_FRM_SWTRPRESSFR01() (flag_swtr_com_tx_req0 &= ((uint8_t)0xBF))
#define TST_FLAG_TX_REQ_FRM_SWTRPRESSFR01() ((flag_swtr_com_tx_req0 & ((uint8_t)0x40)) == ((uint8_t)0x40))

#define SET_FLAG_TX_REQ_FRM_SWTRSENSORFR01() (flag_swtr_com_tx_req0 |= ((uint8_t)0x80))
#define RST_FLAG_TX_REQ_FRM_SWTRSENSORFR01() (flag_swtr_com_tx_req0 &= ((uint8_t)0x7F))
#define TST_FLAG_TX_REQ_FRM_SWTRSENSORFR01() ((flag_swtr_com_tx_req0 & ((uint8_t)0x80)) == ((uint8_t)0x80))

#define SET_FLAG_TX_REQ_FRM_SWTRSENSORFR02() (flag_swtr_com_tx_req1 |= ((uint8_t)0x01))
#define RST_FLAG_TX_REQ_FRM_SWTRSENSORFR02() (flag_swtr_com_tx_req1 &= ((uint8_t)0xFE))
#define TST_FLAG_TX_REQ_FRM_SWTRSENSORFR02() ((flag_swtr_com_tx_req1 & ((uint8_t)0x01)) == ((uint8_t)0x01))

#define SET_FLAG_TX_REQ_FRM_SWTRSENSORFR03() (flag_swtr_com_tx_req1 |= ((uint8_t)0x02))
#define RST_FLAG_TX_REQ_FRM_SWTRSENSORFR03() (flag_swtr_com_tx_req1 &= ((uint8_t)0xFD))
#define TST_FLAG_TX_REQ_FRM_SWTRSENSORFR03() ((flag_swtr_com_tx_req1 & ((uint8_t)0x02)) == ((uint8_t)0x02))

#define SET_FLAG_TX_REQ_FRM_SWTRSENSORFR04() (flag_swtr_com_tx_req1 |= ((uint8_t)0x04))
#define RST_FLAG_TX_REQ_FRM_SWTRSENSORFR04() (flag_swtr_com_tx_req1 &= ((uint8_t)0xFB))
#define TST_FLAG_TX_REQ_FRM_SWTRSENSORFR04() ((flag_swtr_com_tx_req1 & ((uint8_t)0x04)) == ((uint8_t)0x04))

#define SET_FLAG_TX_REQ_FRM_SWTRSENSORFR05() (flag_swtr_com_tx_req1 |= ((uint8_t)0x08))
#define RST_FLAG_TX_REQ_FRM_SWTRSENSORFR05() (flag_swtr_com_tx_req1 &= ((uint8_t)0xF7))
#define TST_FLAG_TX_REQ_FRM_SWTRSENSORFR05() ((flag_swtr_com_tx_req1 & ((uint8_t)0x08)) == ((uint8_t)0x08))

#define SET_FLAG_TX_REQ_FRM_SWTRSENSORFR06() (flag_swtr_com_tx_req1 |= ((uint8_t)0x10))
#define RST_FLAG_TX_REQ_FRM_SWTRSENSORFR06() (flag_swtr_com_tx_req1 &= ((uint8_t)0xEF))
#define TST_FLAG_TX_REQ_FRM_SWTRSENSORFR06() ((flag_swtr_com_tx_req1 & ((uint8_t)0x10)) == ((uint8_t)0x10))

#define SET_FLAG_TX_REQ_FRM_SWTRSENSORFR07() (flag_swtr_com_tx_req1 |= ((uint8_t)0x20))
#define RST_FLAG_TX_REQ_FRM_SWTRSENSORFR07() (flag_swtr_com_tx_req1 &= ((uint8_t)0xDF))
#define TST_FLAG_TX_REQ_FRM_SWTRSENSORFR07() ((flag_swtr_com_tx_req1 & ((uint8_t)0x20)) == ((uint8_t)0x20))

#define SET_FLAG_TX_REQ_FRM_SWTRSENSORFR08() (flag_swtr_com_tx_req1 |= ((uint8_t)0x40))
#define RST_FLAG_TX_REQ_FRM_SWTRSENSORFR08() (flag_swtr_com_tx_req1 &= ((uint8_t)0xBF))
#define TST_FLAG_TX_REQ_FRM_SWTRSENSORFR08() ((flag_swtr_com_tx_req1 & ((uint8_t)0x40)) == ((uint8_t)0x40))

#define SET_FLAG_TX_REQ_FRM_DIAG_PHYSRESP_SWTR() (flag_swtr_com_tx_req1 |= ((UI_8)0x80))
#define RST_FLAG_TX_REQ_FRM_DIAG_PHYSRESP_SWTR() (flag_swtr_com_tx_req1 &= ((UI_8)0x7F))
#define TST_FLAG_TX_REQ_FRM_DIAG_PHYSRESP_SWTR() ((flag_swtr_com_tx_req1 & ((UI_8)0x80)) == ((UI_8)0x80))

/* Cancel value to cancel a timer */
#define TIMER_CANCEL ((uint16_t)0xFFFF)

/* Declaration of period time of the periodic or mixed Tx frames */
#define OT_TX_FRM_SWTRPRIVATEDHUCANFR06 ((uint32_t)(0))
#define PT_TX_FRM_SWTRPRIVATEDHUCANFR06 ((uint32_t)(400))
#define OT_TX_FRM_SWTRPRIVATEDHUCANFR05 ((uint32_t)(0))
#define PT_TX_FRM_SWTRPRIVATEDHUCANFR05 ((uint32_t)(400))
#define OT_TX_FRM_SWTRPRIVATEDHUCANFR04 ((uint32_t)(0))
#define PT_TX_FRM_SWTRPRIVATEDHUCANFR04 ((uint32_t)(400))
#define OT_TX_FRM_SWTRPRIVATEDHUCANFR03 ((uint32_t)(0))
#define PT_TX_FRM_SWTRPRIVATEDHUCANFR03 ((uint32_t)(400))
#define OT_TX_FRM_SWTRPRIVATEDHUCANFR02 ((uint32_t)(0))
#define PT_TX_FRM_SWTRPRIVATEDHUCANFR02 ((uint32_t)(100))
#define OT_TX_FRM_SWTRPRIVATEDHUCANFR01 ((uint32_t)(0))
#define PT_TX_FRM_SWTRPRIVATEDHUCANFR01 ((uint32_t)(100))

#define OT_TX_FRM_SWTRPRESSFR01 ((uint32_t)(0))
#define PT_TX_FRM_SWTRPRESSFR01 ((uint32_t)(50))
#define OT_TX_FRM_SWTRSENSORFR01 ((uint32_t)(0))
#define PT_TX_FRM_SWTRSENSORFR01 ((uint32_t)(50))
#define OT_TX_FRM_SWTRSENSORFR02 ((uint32_t)(0))
#define PT_TX_FRM_SWTRSENSORFR02 ((uint32_t)(50))
#define OT_TX_FRM_SWTRSENSORFR03 ((uint32_t)(0))
#define PT_TX_FRM_SWTRSENSORFR03 ((uint32_t)(50))
#define OT_TX_FRM_SWTRSENSORFR04 ((uint32_t)(0))
#define PT_TX_FRM_SWTRSENSORFR04 ((uint32_t)(50))
#define OT_TX_FRM_SWTRSENSORFR05 ((uint32_t)(0))
#define PT_TX_FRM_SWTRSENSORFR05 ((uint32_t)(50))
#define OT_TX_FRM_SWTRSENSORFR06 ((uint32_t)(0))
#define PT_TX_FRM_SWTRSENSORFR06 ((uint32_t)(50))
#define OT_TX_FRM_SWTRSENSORFR07 ((uint32_t)(0))
#define PT_TX_FRM_SWTRSENSORFR07 ((uint32_t)(50))
#define OT_TX_FRM_SWTRSENSORFR08 ((uint32_t)(0))
#define PT_TX_FRM_SWTRSENSORFR08 ((uint32_t)(50))

#define TIMER_MS_TO_TIME_RESTRICTIVE(t) ((uint32_t)((t) + (uint8_t)1))
/* Declaration of deadline monitoring values for Rx signals */
#define TO_FRX_SIG_ACTVNOFSTEERWHLILLMN ((uint32_t)TIMER_MS_TO_TIME_RESTRICTIVE((uint16_t)200))
#define TO_RX_SIG_ACTVNOFSTEERWHLILLMN ((uint32_t)TIMER_MS_TO_TIME_RESTRICTIVE((uint16_t)2000))

/* Declaration of deadline monitoring values of Tx frames */
#define TO_TX_FRM_DIAG_PHYSRESP_SWTR ((t_timer_time)TIMER_MS_TO_TIME_RESTRICTIVE((UI_16)1))

/* Macros to Set notification flags */
#define SET_FLAG_TX_SIG_DIAGCFAILRTOUCHPANSWTRVIBRATIONFLTSTS() (flag_tx0 |= (uint8_t)0x01)
#define SET_FLAG_TX_SIG_DIAGCFAILRTOUCHPANSWTRTOUCHDFLTSTS() (flag_tx0 |= (uint8_t)0x02)
#define SET_FLAG_TX_SIG_DIAGCFAILRTOUCHPANSWTRSNSRFLTSTS() (flag_tx0 |= (uint8_t)0x04)
#define SET_FLAG_TX_SIG_DIAGCFAILRTOUCHPANSWTRCMNFLTSTS() (flag_tx0 |= (uint8_t)0x08)
#define SET_FLAG_TX_SIG_DIAGCFAILRTOUCHPANSWTR_UB() (flag_tx0 |= (uint8_t)0x10)
#define SET_FLAG_TX_SIG_SWTRSERNONR4() (flag_tx0 |= (uint8_t)0x20)
#define SET_FLAG_TX_SIG_SWTRSERNONR3() (flag_tx0 |= (uint8_t)0x40)
#define SET_FLAG_TX_SIG_SWTRSERNONR2() (flag_tx0 |= (uint8_t)0x80)
#define SET_FLAG_TX_SIG_SWTRSERNONR1() (flag_tx1 |= (uint8_t)0x01)
#define SET_FLAG_TX_SIG_SWTRSERNO_UB() (flag_tx1 |= (uint8_t)0x02)
#define SET_FLAG_TX_SIG_SWTRPARTNOCMPLNR4() (flag_tx1 |= (uint8_t)0x04)
#define SET_FLAG_TX_SIG_SWTRPARTNOCMPLNR3() (flag_tx1 |= (uint8_t)0x08)
#define SET_FLAG_TX_SIG_SWTRPARTNOCMPLNR2() (flag_tx1 |= (uint8_t)0x10)
#define SET_FLAG_TX_SIG_SWTRPARTNOCMPLNR1() (flag_tx1 |= (uint8_t)0x20)
#define SET_FLAG_TX_SIG_SWTRPARTNOCMPLENDSGN3() (flag_tx1 |= (uint8_t)0x40)
#define SET_FLAG_TX_SIG_SWTRPARTNOCMPLENDSGN2() (flag_tx1 |= (uint8_t)0x80)
#define SET_FLAG_TX_SIG_SWTRPARTNOCMPLENDSGN1() (flag_tx2 |= (uint8_t)0x01)
#define SET_FLAG_TX_SIG_SWTRPARTNOCMPL_UB() (flag_tx2 |= (uint8_t)0x02)
#define SET_FLAG_TX_SIG_SWTRPARTNO10CMPLNR5() (flag_tx2 |= (uint8_t)0x04)
#define SET_FLAG_TX_SIG_SWTRPARTNO10CMPLNR4() (flag_tx2 |= (uint8_t)0x08)
#define SET_FLAG_TX_SIG_SWTRPARTNO10CMPLNR3() (flag_tx2 |= (uint8_t)0x10)
#define SET_FLAG_TX_SIG_SWTRPARTNO10CMPLNR2() (flag_tx2 |= (uint8_t)0x20)
#define SET_FLAG_TX_SIG_SWTRPARTNO10CMPLNR1() (flag_tx2 |= (uint8_t)0x40)
#define SET_FLAG_TX_SIG_SWTRPARTNO10CMPLENDSGN3() (flag_tx2 |= (uint8_t)0x80)
#define SET_FLAG_TX_SIG_SWTRPARTNO10CMPLENDSGN2() (flag_tx3 |= (uint8_t)0x01)
#define SET_FLAG_TX_SIG_SWTRPARTNO10CMPLENDSGN1() (flag_tx3 |= (uint8_t)0x02)
#define SET_FLAG_TX_SIG_SWPUPDWNSTSRI_UB() (flag_tx3 |= (uint8_t)0x04)
#define SET_FLAG_TX_SIG_SWPUPDWNSTSRI() (flag_tx3 |= (uint8_t)0x08)
#define SET_FLAG_TX_SIG_SWPLERISTSRI_UB() (flag_tx3 |= (uint8_t)0x10)
#define SET_FLAG_TX_SIG_SWPLERISTSRI() (flag_tx3 |= (uint8_t)0x20)
#define SET_FLAG_TX_SIG_STEERWHLTOUCHBDVOICE_UB() (flag_tx3 |= (uint8_t)0x40)
#define SET_FLAG_TX_SIG_STEERWHLTOUCHBDVOICE() (flag_tx3 |= (uint8_t)0x80)
#define SET_FLAG_TX_SIG_STEERWHLTOUCHBDMENU_UB() (flag_tx4 |= (uint8_t)0x01)
#define SET_FLAG_TX_SIG_STEERWHLTOUCHBDMENU() (flag_tx4 |= (uint8_t)0x02)
#define SET_FLAG_TX_SIG_STEERWHLTOUCHBDDN_UB() (flag_tx4 |= (uint8_t)0x04)
#define SET_FLAG_TX_SIG_STEERWHLTOUCHBDDN() (flag_tx4 |= (uint8_t)0x08)
#define SET_FLAG_TX_SIG_SLDVOLCTRLSTS_UB() (flag_tx4 |= (uint8_t)0x10)
#define SET_FLAG_TX_SIG_SLDVOLCTRLSTS() (flag_tx4 |= (uint8_t)0x20)
#define SET_FLAG_TX_SIG_RIMFCTACTSGUP_UB() (flag_tx4 |= (uint8_t)0x40)
#define SET_FLAG_TX_SIG_RIMFCTACTSGUP() (flag_tx4 |= (uint8_t)0x80)
#define SET_FLAG_TX_SIG_RIMFCTACTSGRI_UB() (flag_tx5 |= (uint8_t)0x01)
#define SET_FLAG_TX_SIG_RIMFCTACTSGRI() (flag_tx5 |= (uint8_t)0x02)
#define SET_FLAG_TX_SIG_RIMFCTACTSGLE_UB() (flag_tx5 |= (uint8_t)0x04)
#define SET_FLAG_TX_SIG_RIMFCTACTSGLE() (flag_tx5 |= (uint8_t)0x08)
#define SET_FLAG_TX_SIG_RIMFCTACTSGDN_UB() (flag_tx5 |= (uint8_t)0x10)
#define SET_FLAG_TX_SIG_RIMFCTACTSGDN() (flag_tx5 |= (uint8_t)0x20)
#define SET_FLAG_TX_SIG_RIMFCTACTSGCE_UB() (flag_tx5 |= (uint8_t)0x40)
#define SET_FLAG_TX_SIG_RIMFCTACTSGCE() (flag_tx5 |= (uint8_t)0x80)
#define SET_FLAG_TX_SIG_STEERWHLTOUCHBDRITOUCHPOSNY() (flag_tx6 |= (uint8_t)0x01)
#define SET_FLAG_TX_SIG_STEERWHLTOUCHBDRITOUCHPOSNX() (flag_tx6 |= (uint8_t)0x02)
#define SET_FLAG_TX_SIG_STEERWHLTOUCHBDRISTEERWHLTOUCHBDSTS() (flag_tx6 |= (uint8_t)0x04)
#define SET_FLAG_TX_SIG_STEERWHLTOUCHBDRICNTR() (flag_tx6 |= (uint8_t)0x08)
#define SET_FLAG_TX_SIG_STEERWHLTOUCHBDRICHKS() (flag_tx6 |= (uint8_t)0x10)
#define SET_FLAG_TX_SIG_STEERWHLTOUCHBDRI_UB() (flag_tx6 |= (uint8_t)0x20)
#define SET_FLAG_TX_SIG_DIAGNOSTICRESPSWTR() (flag_tx6 |= (UI_8)0x40)
#define SET_FLAG_RX_SIG_DIAGNOSTICREQSWTR() (flag_rx0 |= (UI_8)0x01)
#define SET_FLAG_RX_SIG_DIAGNOSTICFUNCADDRREQ() (flag_rx0 |= (UI_8)0x02)

/* Macros of the flag of the estate of the communications */
#define SET_FLAG_OSEK_COM_INIT() (flag_st_mode |= ((uint8_t)0x10))
#define RST_FLAG_OSEK_COM_INIT() (flag_st_mode &= ((uint8_t)0xEF))
#define TST_FLAG_OSEK_COM_INIT() ((flag_st_mode & ((uint8_t)0x10)) == ((uint8_t)0x10))
#define SET_FLAG_OSEK_COM_PER_TX() (flag_st_mode |= ((uint8_t)0x20))
#define RST_FLAG_OSEK_COM_PER_TX() (flag_st_mode &= ((uint8_t)0xDF))
#define TST_FLAG_OSEK_COM_PER_TX() ((flag_st_mode & ((uint8_t)0x20)) == ((uint8_t)0x20))

/* ------------------------------- Data Types ------------------------------- */

/* Type to allocate data structure for managed signals */
typedef uint8_t t_alloc_sig_twlibrists_ub[1];
typedef uint8_t t_alloc_sig_twlibrists[1];
typedef uint8_t t_alloc_sig_swtofkeytone_ub[1];
typedef uint8_t t_alloc_sig_swtofkeytone[1];
typedef uint8_t t_alloc_sig_intrbrists_ub[1];
typedef uint8_t t_alloc_sig_intrbrists[1];
typedef uint8_t t_alloc_sig_actvnofsteerwhlillmn_ub[1];
typedef uint8_t t_alloc_sig_actvnofsteerwhlillmn[1];
typedef UI_8 t_alloc_sig_diagnosticreqswtr[8];
typedef UI_8 t_alloc_sig_diagnosticfuncaddrreq[8];

/* ---------------------------- Global Variables ---------------------------- */
extern uint8_t Test_frame_On;
/* Declaration of mode and state flag */
static uint8_t flag_st_mode;

/* Static length Rx Com signals internal objects declaration */
static volatile t_alloc_sig_twlibrists_ub sig_twlibrists_ub;
static volatile t_alloc_sig_twlibrists sig_twlibrists;
static volatile t_alloc_sig_swtofkeytone_ub sig_swtofkeytone_ub;
static volatile t_alloc_sig_swtofkeytone sig_swtofkeytone;
static volatile t_alloc_sig_intrbrists_ub sig_intrbrists_ub;
static volatile t_alloc_sig_intrbrists sig_intrbrists;
static volatile t_alloc_sig_actvnofsteerwhlillmn_ub sig_actvnofsteerwhlillmn_ub;
static volatile t_alloc_sig_actvnofsteerwhlillmn sig_actvnofsteerwhlillmn;
static volatile t_alloc_sig_diagnosticreqswtr sig_diagnosticreqswtr;
static volatile UI_8 sig_len_diagnosticreqswtr;
static volatile t_alloc_sig_diagnosticfuncaddrreq sig_diagnosticfuncaddrreq;
static volatile UI_8 sig_len_diagnosticfuncaddrreq;

/* Dynamic length Rx Com signals internal objects declaration */

/* Com Tx fames objects internal declaration */
static uint8_t frm_swtrprivatedhucanfr06[MAX_LEN_FRM_SWTRPRIVATEDHUCANFR06];
static uint8_t frm_swtrprivatedhucanfr05[MAX_LEN_FRM_SWTRPRIVATEDHUCANFR05];
static uint8_t frm_swtrprivatedhucanfr04[MAX_LEN_FRM_SWTRPRIVATEDHUCANFR04];
static uint8_t frm_swtrprivatedhucanfr03[MAX_LEN_FRM_SWTRPRIVATEDHUCANFR03];
static uint8_t frm_swtrprivatedhucanfr02[MAX_LEN_FRM_SWTRPRIVATEDHUCANFR02];
static uint8_t frm_swtrprivatedhucanfr01[MAX_LEN_FRM_SWTRPRIVATEDHUCANFR01];
static uint8_t frm_swtrpressfr01[MAX_LEN_FRM_SWTRPRESSFR01];
static uint8_t frm_swtrsensorfr01[MAX_LEN_FRM_SWTRSENSORFR01];
static uint8_t frm_swtrsensorfr02[MAX_LEN_FRM_SWTRSENSORFR02];
static uint8_t frm_swtrsensorfr03[MAX_LEN_FRM_SWTRSENSORFR03];
static uint8_t frm_swtrsensorfr04[MAX_LEN_FRM_SWTRSENSORFR04];
static uint8_t frm_swtrsensorfr05[MAX_LEN_FRM_SWTRSENSORFR05];
static uint8_t frm_swtrsensorfr06[MAX_LEN_FRM_SWTRSENSORFR06];
static uint8_t frm_swtrsensorfr07[MAX_LEN_FRM_SWTRSENSORFR07];
static uint8_t frm_swtrsensorfr08[MAX_LEN_FRM_SWTRSENSORFR08];
static uint8_t frm_swtrsensorfr09[8];
static uint8_t frm_swtrsensorfr0A[8];
static uint8_t frm_swtrsensorfr0B[8];
static uint8_t frm_swtrsensorfr0C[8];
UI_8 frm_diag_physresp_swtr[MAX_LEN_FRM_DIAG_PHYSRESP_SWTR];
static UI_8 len_frm_diag_physresp_swtr;

/* Tx request flags declaration */
static volatile uint8_t flag_swtr_com_tx_req0;
static volatile uint8_t flag_swtr_com_tx_req1;

/* Com traffic flags declaration */
static volatile t_flag_value com_traffic_swtr;

/* Declaration of the periodic timers of Tx frames */
static uint32_t ptt_tx_frm_swtrprivatedhucanfr06;
static uint32_t ptt_tx_frm_swtrprivatedhucanfr05;
static uint32_t ptt_tx_frm_swtrprivatedhucanfr04;
static uint32_t ptt_tx_frm_swtrprivatedhucanfr03;
static uint32_t ptt_tx_frm_swtrprivatedhucanfr02;
static uint32_t ptt_tx_frm_swtrprivatedhucanfr01;
static uint32_t ptt_tx_frm_swtrpressfr01;
static uint32_t ptt_tx_frm_swtrsensorfr01;
static uint32_t ptt_tx_frm_swtrsensorfr02;
static uint32_t ptt_tx_frm_swtrsensorfr03;
static uint32_t ptt_tx_frm_swtrsensorfr04;
static uint32_t ptt_tx_frm_swtrsensorfr05;
static uint32_t ptt_tx_frm_swtrsensorfr06;
static uint32_t ptt_tx_frm_swtrsensorfr07;
static uint32_t ptt_tx_frm_swtrsensorfr08;
static volatile t_timer_time dmt_tx_frm_diag_physresp_swtr;
/* Declaration of deadline monitoring timers of Rx signals */
static volatile uint32_t dmt_rx_sig_actvnofsteerwhlillmn;

/* Declaration of class 2 (TxNotif) notification flags */
static volatile uint8_t flag_tx0;
static volatile uint8_t flag_tx1;
static volatile uint8_t flag_tx2;
static volatile uint8_t flag_tx3;
static volatile uint8_t flag_tx4;
static volatile uint8_t flag_tx5;
static volatile uint8_t flag_tx6;
static volatile uint8_t flag_tx7;
uint8_t flag_rx0;
/* Declaration of timer diff between last tick and current tick */
static uint32_t time_diff;

/* --------------------------- Routine Prototypes --------------------------- */
static void OsekComPeriodicTx(void);
static void OsekComDeadlineMonitRx(void);
// static void OsekComTxReqFrmSwtrPrivateDHUCanFr01(void);
static void OsekComTxReqFrmDIAG_PhysResp_SWTR(void);
/* -------------------------------- Routines -------------------------------- */
uint32_t CanBufQueryIdTp(void);
uint8_t CanBufQueryDataByte(uint8_t hdl, uint8_t index);
#define CAN_BUF_QUERY_DATA_BYTE(bhdl, byte) (CanBufQueryDataByte(bhdl, byte))
#define CAN_BUF_QUERY_DATA_LEN(HwCtl, bhdl) (CanBufQueryDataLen(HwCtl, bhdl))
UI_8 CanBufQueryDataLen(t_can_handler can_handler, t_can_buf_hdl bhdl);
/*---------------------------------------------------------------------------
| Portability:  Target platform independent
|----------------------------------------------------------------------------
| Routine description:
|  * Reception of a new frame notification callback
|  * This callback must be launched by the lower COM driver upon the reception
|    of a new frame.
|---------------------------------------------------------------------------
| Parameters description:
|  bhdl: Handler of the buffer where the received frame is stored.
/---------------------------------------------------------------------------*/
void OsekComRxNotifCallbackSWTR(t_com_buf_hdl bhdl)
{
    t_flag_value aux_com_traffic = COM_TRUE;
    uint32_t buf_idtp = CanBufQueryIdTp();
    uint8_t frm_len = 8;

    if (TST_FLAG_OSEK_COM_INIT())
    {
        /* Rx Com frames with static ID */
        switch (buf_idtp)
        {
        case ID_TP_FRM_IHUPRIVATEDHUCANFR01:
            /* Test of the minimum Rx frames length required to decode the signal */
            if (frm_len >= MIN_LEN_FRM_SIG_TWLIBRISTS_UB)
            {
                /* Decoding of signal sig_TwliBriSts_UB */
                sig_twlibrists_ub[0] = ((CAN_BUF_QUERY_DATA_BYTE(bhdl, 2)) >> ((uint8_t)7));
            }
            else
            {
                /* Do nothing */
            }

            /* Test of the minimum Rx frames length required to decode the signal */
            if (frm_len >= MIN_LEN_FRM_SIG_TWLIBRISTS)
            {
                /* Decoding of signal sig_TwliBriSts */
                sig_twlibrists[0] = ((CAN_BUF_QUERY_DATA_BYTE(bhdl, 2) & ((uint8_t)127)) >> ((uint8_t)6));
            }
            else
            {
                /* Do nothing */
            }

            /* Test of the minimum Rx frames length required to decode the signal */
            if (frm_len >= MIN_LEN_FRM_SIG_SWTOFKEYTONE_UB)
            {
                /* Decoding of signal sig_SwtOfKeyTone_UB */
                sig_swtofkeytone_ub[0] = ((CAN_BUF_QUERY_DATA_BYTE(bhdl, 0) & ((uint8_t)63)) >> ((uint8_t)5));
            }
            else
            {
                /* Do nothing */
            }

            /* Test of the minimum Rx frames length required to decode the signal */
            if (frm_len >= MIN_LEN_FRM_SIG_SWTOFKEYTONE)
            {
                /* Decoding of signal sig_SwtOfKeyTone */
                sig_swtofkeytone[0] = ((CAN_BUF_QUERY_DATA_BYTE(bhdl, 0)) >> ((uint8_t)6));
            }
            else
            {
                /* Do nothing */
            }

            /* Test of the minimum Rx frames length required to decode the signal */
            if (frm_len >= MIN_LEN_FRM_SIG_INTRBRISTS_UB)
            {
                /* Decoding of signal sig_IntrBriSts_UB */
                sig_intrbrists_ub[0] = ((CAN_BUF_QUERY_DATA_BYTE(bhdl, 0) & ((uint8_t)31)) >> ((uint8_t)4));
            }
            else
            {
                /* Do nothing */
            }

            /* Test of the minimum Rx frames length required to decode the signal */
            if (frm_len >= MIN_LEN_FRM_SIG_INTRBRISTS)
            {
                /* Decoding of signal sig_IntrBriSts */
                sig_intrbrists[0] = ((CAN_BUF_QUERY_DATA_BYTE(bhdl, 0) & ((uint8_t)15)));
            }
            else
            {
                /* Do nothing */
            }

            /* Test of the minimum Rx frames length required to decode the signal */
            if (frm_len >= MIN_LEN_FRM_SIG_ACTVNOFSTEERWHLILLMN_UB)
            {
                /* Decoding of signal sig_ActvnOfSteerWhlIllmn_UB */
                sig_actvnofsteerwhlillmn_ub[0] = ((CAN_BUF_QUERY_DATA_BYTE(bhdl, 5) & ((uint8_t)7)) >> ((uint8_t)2));
            }
            else
            {
                /* Do nothing */
            }

            /* Test of the minimum Rx frames length required to decode the signal */
            if (frm_len >= MIN_LEN_FRM_SIG_ACTVNOFSTEERWHLILLMN)
            {
                /* Reset of the deadline monitoring timer */
                dmt_rx_sig_actvnofsteerwhlillmn = 0;
                /* Decoding of signal sig_ActvnOfSteerWhlIllmn */
                sig_actvnofsteerwhlillmn[0] = ((CAN_BUF_QUERY_DATA_BYTE(bhdl, 5) & ((uint8_t)15)) >> ((uint8_t)3));
                /* Rx notification callback */
                IhuPrivateDHUCanFr01_CALLBACK();
            }
            else
            {
                /* Do nothing */
            }

            break;
        case ID_TP_FRM_DIAG_PHYSREQ_SWTR:
            /* Test of the minimum Rx frames length required to decode the signal */

            if (frm_len >= MIN_LEN_FRM_SIG_DIAGNOSTICREQSWTR)
            {
                /* Decoding of signal sig_DiagnosticReqSWTR */
                sig_diagnosticreqswtr[0] = (CAN_BUF_QUERY_DATA_BYTE(bhdl, 0));
                sig_diagnosticreqswtr[1] = (CAN_BUF_QUERY_DATA_BYTE(bhdl, 1));
                sig_diagnosticreqswtr[2] = (CAN_BUF_QUERY_DATA_BYTE(bhdl, 2));
                sig_diagnosticreqswtr[3] = (CAN_BUF_QUERY_DATA_BYTE(bhdl, 3));
                sig_diagnosticreqswtr[4] = (CAN_BUF_QUERY_DATA_BYTE(bhdl, 4));
                sig_diagnosticreqswtr[5] = (CAN_BUF_QUERY_DATA_BYTE(bhdl, 5));
                sig_diagnosticreqswtr[6] = (CAN_BUF_QUERY_DATA_BYTE(bhdl, 6));
                sig_diagnosticreqswtr[7] = ((CAN_BUF_QUERY_DATA_BYTE(bhdl, 7)));
                /* Length calculation of signal sig_DiagnosticReqPRNDL */
                sig_len_diagnosticreqswtr = frm_len - FB_SIG_DIAGNOSTICREQSWTR;

                /* Set of the Rx notification flag */
                SET_FLAG_RX_SIG_DIAGNOSTICREQSWTR();
            }
            else
            {
                /* Do nothing */
            }
            break;
        case ID_TP_FRM_DIAG_FUNCREQ:
            /* Test of the minimum Rx frames length required to decode the signal */
            if (frm_len >= MIN_LEN_FRM_SIG_DIAGNOSTICFUNCADDRREQ)
            {
                /* Decoding of signal sig_DiagnosticFuncAddrReq */
                sig_diagnosticfuncaddrreq[0] = (CAN_BUF_QUERY_DATA_BYTE(bhdl, 0));
                sig_diagnosticfuncaddrreq[1] = (CAN_BUF_QUERY_DATA_BYTE(bhdl, 1));
                sig_diagnosticfuncaddrreq[2] = (CAN_BUF_QUERY_DATA_BYTE(bhdl, 2));
                sig_diagnosticfuncaddrreq[3] = (CAN_BUF_QUERY_DATA_BYTE(bhdl, 3));
                sig_diagnosticfuncaddrreq[4] = (CAN_BUF_QUERY_DATA_BYTE(bhdl, 4));
                sig_diagnosticfuncaddrreq[5] = (CAN_BUF_QUERY_DATA_BYTE(bhdl, 5));
                sig_diagnosticfuncaddrreq[6] = (CAN_BUF_QUERY_DATA_BYTE(bhdl, 6));
                sig_diagnosticfuncaddrreq[7] = ((CAN_BUF_QUERY_DATA_BYTE(bhdl, 7)));
                /* Length calculation of signal sig_DiagnosticFuncAddrReq */
                sig_len_diagnosticfuncaddrreq = frm_len - FB_SIG_DIAGNOSTICFUNCADDRREQ;
                /* Set of the Rx notification flag */
                SET_FLAG_RX_SIG_DIAGNOSTICFUNCADDRREQ();
            }
            else
            {
                /* Do nothing */
            }

            break;
        default:
            /* Reset com traffic flag */
            aux_com_traffic = COM_FALSE;
            break;
        }
    }
    else
    {
        /* Do nothing */
    }
    /* Com traffic flag */
    if ((com_traffic_swtr == COM_FALSE) && (aux_com_traffic == COM_TRUE))
    {
        com_traffic_swtr = COM_TRUE;
    }
}

void CanTx(t_can_handler can_handler, bool notif, uint32_t idtp, uint16_t len, t_can_data can_data);
/*---------------------------------------------------------------------------
| Portability:  Target platform independent
|----------------------------------------------------------------------------
| Routine description:
|  * Available transmission buffer notification callback
|  * This callback must be launched by the lower COM driver upon a transmission
|    buffer will become available after requesting one to perform a transmission.
|---------------------------------------------------------------------------
| Parameters description:
|  return: TRUE in case that after current transmission lower COM driver should
|          call again this callback to transmit a new frame.
|          FALSE otherwise.
/---------------------------------------------------------------------------*/
bool OsekComTxReqCallbackSWTR(void)
{
    /* Check of the Tx request flag */
    if (TST_FLAG_TX_REQ_FRM_SWTRPRIVATEDHUCANFR06())
    {
        /* Transmission of the frame SwtrPrivateDHUCanFr06*/
        if (Fuction_State != Function_State_C)
        {
            CanTx(0, true, ID_TP_FRM_SWTRPRIVATEDHUCANFR06, MAX_LEN_FRM_SWTRPRIVATEDHUCANFR06, frm_swtrprivatedhucanfr06);
        }
        RST_FLAG_TX_REQ_FRM_SWTRPRIVATEDHUCANFR06();
    }
    else if (TST_FLAG_TX_REQ_FRM_SWTRPRIVATEDHUCANFR02())
    {
        /* Transmission of the frame SwtrPrivateDHUCanFr02 */
        if (Fuction_State != Function_State_C)
        {
            CanTx(0, true, ID_TP_FRM_SWTRPRIVATEDHUCANFR02, MAX_LEN_FRM_SWTRPRIVATEDHUCANFR02, frm_swtrprivatedhucanfr02);
        }
        RST_FLAG_TX_REQ_FRM_SWTRPRIVATEDHUCANFR02();
    }
    else if (TST_FLAG_TX_REQ_FRM_SWTRPRIVATEDHUCANFR01())
    {
        /* Transmission of the frame SwtrPrivateDHUCanFr01 */
        if (Fuction_State != Function_State_C)
        {
            CanTx(0, true, ID_TP_FRM_SWTRPRIVATEDHUCANFR01, MAX_LEN_FRM_SWTRPRIVATEDHUCANFR01, frm_swtrprivatedhucanfr01);
        }
        RST_FLAG_TX_REQ_FRM_SWTRPRIVATEDHUCANFR01();
    }
    else if (TST_FLAG_TX_REQ_FRM_SWTRPRIVATEDHUCANFR03())
    {
        /* Transmission of the frame SwtrPrivateDHUCanFr03 */
        if (Fuction_State != Function_State_C)
        {
            CanTx(0, true, ID_TP_FRM_SWTRPRIVATEDHUCANFR03, MAX_LEN_FRM_SWTRPRIVATEDHUCANFR03, frm_swtrprivatedhucanfr03);
        }
        RST_FLAG_TX_REQ_FRM_SWTRPRIVATEDHUCANFR03();
    }
    else if (TST_FLAG_TX_REQ_FRM_SWTRPRIVATEDHUCANFR04())
    {
        /* Transmission of the frame SwtrPrivateDHUCanFr04 */
        if (Fuction_State != Function_State_C)
        {
            CanTx(0, true, ID_TP_FRM_SWTRPRIVATEDHUCANFR04, MAX_LEN_FRM_SWTRPRIVATEDHUCANFR04, frm_swtrprivatedhucanfr04);
        }
        RST_FLAG_TX_REQ_FRM_SWTRPRIVATEDHUCANFR04();
    }
    else if (TST_FLAG_TX_REQ_FRM_SWTRPRIVATEDHUCANFR05())
    {
        /* Transmission of the frame SwtrPrivateDHUCanFr05 */
        if (Fuction_State != Function_State_C)
        {
            CanTx(0, true, ID_TP_FRM_SWTRPRIVATEDHUCANFR05, MAX_LEN_FRM_SWTRPRIVATEDHUCANFR05, frm_swtrprivatedhucanfr05);
        }
        RST_FLAG_TX_REQ_FRM_SWTRPRIVATEDHUCANFR05();
    }
    else if (TST_FLAG_TX_REQ_FRM_SWTRPRESSFR01())
    {
        /* Transmission of the frame SwtrPressFr01 */
        if (Fuction_State != Function_State_C)
        {
            if (Test_frame_On == 1)
                CanTx(0, true, ID_TP_FRM_SWTRPRESSFR01, MAX_LEN_FRM_SWTRPRESSFR01, frm_swtrpressfr01);
        }
        RST_FLAG_TX_REQ_FRM_SWTRPRESSFR01();
    }
    else if (TST_FLAG_TX_REQ_FRM_SWTRSENSORFR01())
    {
        /* Transmission of the frame SwtRSensorFr01 */
        if (Fuction_State != Function_State_C)
        {
            if (Test_frame_On == 1)
                CanTx(0, true, ID_TP_FRM_SWTRSENSORFR01, MAX_LEN_FRM_SWTRSENSORFR01, frm_swtrsensorfr01);
        }
        RST_FLAG_TX_REQ_FRM_SWTRSENSORFR01();
    }
    else if (TST_FLAG_TX_REQ_FRM_SWTRSENSORFR02())
    {
        /* Transmission of the frame SwtRSensorFr02 */
        if (Fuction_State != Function_State_C)
        {
            if (Test_frame_On == 1)
                CanTx(0, true, ID_TP_FRM_SWTRSENSORFR02, MAX_LEN_FRM_SWTRSENSORFR02, frm_swtrsensorfr02);
        }
        RST_FLAG_TX_REQ_FRM_SWTRSENSORFR02();
    }
    else if (TST_FLAG_TX_REQ_FRM_SWTRSENSORFR03())
    {
        /* Transmission of the frame SwtRSensorFr03 */
        if (Fuction_State != Function_State_C)
        {
            if (Test_frame_On == 1)
                CanTx(0, true, ID_TP_FRM_SWTRSENSORFR03, MAX_LEN_FRM_SWTRSENSORFR03, frm_swtrsensorfr03);
        }
        RST_FLAG_TX_REQ_FRM_SWTRSENSORFR03();
    }
    else if (TST_FLAG_TX_REQ_FRM_SWTRSENSORFR04())
    {
        /* Transmission of the frame SwtRSensorFr04 */
        if (Fuction_State != Function_State_C)
        {
            if (Test_frame_On == 1)
                CanTx(0, true, ID_TP_FRM_SWTRSENSORFR04, MAX_LEN_FRM_SWTRSENSORFR04, frm_swtrsensorfr04);
        }
        RST_FLAG_TX_REQ_FRM_SWTRSENSORFR04();
    }
    else if (TST_FLAG_TX_REQ_FRM_SWTRSENSORFR05())
    {
        /* Transmission of the frame SwtRSensorFr05 */
        if (Fuction_State != Function_State_C)
        {
            if (Test_frame_On == 1)
                CanTx(0, true, ID_TP_FRM_SWTRSENSORFR05, MAX_LEN_FRM_SWTRSENSORFR05, frm_swtrsensorfr05);
        }
        RST_FLAG_TX_REQ_FRM_SWTRSENSORFR05();
    }
    else if (TST_FLAG_TX_REQ_FRM_SWTRSENSORFR06())
    {
        /* Transmission of the frame SwtRSensorFr06 */
        if (Fuction_State != Function_State_C)
        {
            if (Test_frame_On == 1)
                CanTx(0, true, ID_TP_FRM_SWTRSENSORFR06, MAX_LEN_FRM_SWTRSENSORFR06, frm_swtrsensorfr06);
        }
        RST_FLAG_TX_REQ_FRM_SWTRSENSORFR06();
    }
    else if (TST_FLAG_TX_REQ_FRM_SWTRSENSORFR07())
    {
        /* Transmission of the frame SwtRSensorFr07 */
        if (Fuction_State != Function_State_C)
        {
            if (Test_frame_On == 1)
                CanTx(0, true, ID_TP_FRM_SWTRSENSORFR07, MAX_LEN_FRM_SWTRSENSORFR07, frm_swtrsensorfr07);
        }
        RST_FLAG_TX_REQ_FRM_SWTRSENSORFR07();
    }
    else if (TST_FLAG_TX_REQ_FRM_SWTRSENSORFR08())
    {
        /* Transmission of the frame SwtRSensorFr08 */
        if (Fuction_State != Function_State_C)
        {
            if (Test_frame_On == 1)
            {
                CanTx(0, true, ID_TP_FRM_SWTRSENSORFR08, MAX_LEN_FRM_SWTRSENSORFR08, frm_swtrsensorfr08);
                CanTx(0, true, 0x419, 8, frm_swtrsensorfr09);
                CanTx(0, true, 0x41A, 8, frm_swtrsensorfr0A);
                CanTx(0, true, 0x41B, 8, frm_swtrsensorfr0B);
                CanTx(0, true, 0x41C, 8, frm_swtrsensorfr0C);
            }
        }
        RST_FLAG_TX_REQ_FRM_SWTRSENSORFR08();
        Fr08_send_flag = 1;
    }

    else if (TST_FLAG_TX_REQ_FRM_DIAG_PHYSRESP_SWTR())
    {
        /* Transmission of the frame DIAG_PHYSRESP_SWTR */
        CanTx(0, true, ID_TP_FRM_DIAG_PHYSRESP_SWTR, MAX_LEN_FRM_DIAG_PHYSRESP_SWTR, frm_diag_physresp_swtr);
        RST_FLAG_TX_REQ_FRM_DIAG_PHYSRESP_SWTR();
    }
    else
    {
        /* Do nothing */
    }

    /* return checking pending transmissions */
    return (((flag_swtr_com_tx_req0 != 0) || (flag_swtr_com_tx_req1 != 0)) ? true : false);
}
void OsekComSetFR09data(uint8_t data[])
{
    uint8_t i;
    for (i = 0; i < 8; i++)
    {
        frm_swtrsensorfr09[i] = data[i];
    }
    
}
void OsekComSetFR0Adata(uint8_t data[])
{
    uint8_t i;
    for (i = 0; i < 8; i++)
    {
        frm_swtrsensorfr0A[i] = data[i];
    }
}
void OsekComSetFR0Bdata(uint8_t data[])
{
    uint8_t i;
    for (i = 0; i < 8; i++)
    {
        frm_swtrsensorfr0B[i] = data[i];
    }
}
void OsekComSetFR0Cdata(uint8_t data[])
{
    uint8_t i;
    for (i = 0; i < 8; i++)
    {
        frm_swtrsensorfr0C[i] = data[i];
    }
}
uint32_t CanBufQueryIdTp_Tx(void);
/*---------------------------------------------------------------------------
| Portability:  Target platform independent
|----------------------------------------------------------------------------
| Routine description:
|  * Frame transmission confirmation notifying callback
|  * This callback must be launched by the lower COM driver upon the completion
|    of a frame transmission for which transmission confirmation has been requested
|---------------------------------------------------------------------------
| Parameters description:
|  bhdl: Handler of the buffer where the transmitted frame is stored.
/---------------------------------------------------------------------------*/
void OsekComTxNotifCallbackSWTR(t_com_buf_hdl bhdl)
{
    // uint32_t buf_idtp = CanBufQueryIdTp_Tx();
    uint32_t buf_idtp = CanBufQueryIdTp();
    buf_idtp = ID_TP_FRM_DIAG_PHYSREQ_SWTR;
    switch (buf_idtp)
    {

    case ID_TP_FRM_SWTRPRIVATEDHUCANFR06:
        /* Set of Tx the notification flag */
        SET_FLAG_TX_SIG_DIAGCFAILRTOUCHPANSWTRVIBRATIONFLTSTS();
        /* Set of Tx the notification flag */
        SET_FLAG_TX_SIG_DIAGCFAILRTOUCHPANSWTRTOUCHDFLTSTS();
        /* Set of Tx the notification flag */
        SET_FLAG_TX_SIG_DIAGCFAILRTOUCHPANSWTRSNSRFLTSTS();
        /* Set of Tx the notification flag */
        SET_FLAG_TX_SIG_DIAGCFAILRTOUCHPANSWTRCMNFLTSTS();
        /* Set of Tx the notification flag */
        SET_FLAG_TX_SIG_DIAGCFAILRTOUCHPANSWTR_UB();
        break;
    case ID_TP_FRM_SWTRPRIVATEDHUCANFR05:
        /* Set of Tx the notification flag */
        SET_FLAG_TX_SIG_SWTRSERNONR4();
        /* Set of Tx the notification flag */
        SET_FLAG_TX_SIG_SWTRSERNONR3();
        /* Set of Tx the notification flag */
        SET_FLAG_TX_SIG_SWTRSERNONR2();
        /* Set of Tx the notification flag */
        SET_FLAG_TX_SIG_SWTRSERNONR1();
        /* Set of Tx the notification flag */
        SET_FLAG_TX_SIG_SWTRSERNO_UB();
        break;
    case ID_TP_FRM_SWTRPRIVATEDHUCANFR04:
        /* Set of Tx the notification flag */
        SET_FLAG_TX_SIG_SWTRPARTNOCMPLNR4();
        /* Set of Tx the notification flag */
        SET_FLAG_TX_SIG_SWTRPARTNOCMPLNR3();
        /* Set of Tx the notification flag */
        SET_FLAG_TX_SIG_SWTRPARTNOCMPLNR2();
        /* Set of Tx the notification flag */
        SET_FLAG_TX_SIG_SWTRPARTNOCMPLNR1();
        /* Set of Tx the notification flag */
        SET_FLAG_TX_SIG_SWTRPARTNOCMPLENDSGN3();
        /* Set of Tx the notification flag */
        SET_FLAG_TX_SIG_SWTRPARTNOCMPLENDSGN2();
        /* Set of Tx the notification flag */
        SET_FLAG_TX_SIG_SWTRPARTNOCMPLENDSGN1();
        /* Set of Tx the notification flag */
        SET_FLAG_TX_SIG_SWTRPARTNOCMPL_UB();
        break;
    case ID_TP_FRM_SWTRPRIVATEDHUCANFR03:
        /* Set of Tx the notification flag */
        SET_FLAG_TX_SIG_SWTRPARTNO10CMPLNR5();
        /* Set of Tx the notification flag */
        SET_FLAG_TX_SIG_SWTRPARTNO10CMPLNR4();
        /* Set of Tx the notification flag */
        SET_FLAG_TX_SIG_SWTRPARTNO10CMPLNR3();
        /* Set of Tx the notification flag */
        SET_FLAG_TX_SIG_SWTRPARTNO10CMPLNR2();
        /* Set of Tx the notification flag */
        SET_FLAG_TX_SIG_SWTRPARTNO10CMPLNR1();
        /* Set of Tx the notification flag */
        SET_FLAG_TX_SIG_SWTRPARTNO10CMPLENDSGN3();
        /* Set of Tx the notification flag */
        SET_FLAG_TX_SIG_SWTRPARTNO10CMPLENDSGN2();
        /* Set of Tx the notification flag */
        SET_FLAG_TX_SIG_SWTRPARTNO10CMPLENDSGN1();
        break;
    case ID_TP_FRM_SWTRPRIVATEDHUCANFR02:
        /* Set of Tx the notification flag */
        SET_FLAG_TX_SIG_SWPUPDWNSTSRI_UB();
        /* Set of Tx the notification flag */
        SET_FLAG_TX_SIG_SWPUPDWNSTSRI();
        /* Set of Tx the notification flag */
        SET_FLAG_TX_SIG_SWPLERISTSRI_UB();
        /* Set of Tx the notification flag */
        SET_FLAG_TX_SIG_SWPLERISTSRI();
        /* Set of Tx the notification flag */
        SET_FLAG_TX_SIG_STEERWHLTOUCHBDVOICE_UB();
        /* Set of Tx the notification flag */
        SET_FLAG_TX_SIG_STEERWHLTOUCHBDVOICE();
        /* Set of Tx the notification flag */
        SET_FLAG_TX_SIG_STEERWHLTOUCHBDMENU_UB();
        /* Set of Tx the notification flag */
        SET_FLAG_TX_SIG_STEERWHLTOUCHBDMENU();
        /* Set of Tx the notification flag */
        SET_FLAG_TX_SIG_STEERWHLTOUCHBDDN_UB();
        /* Set of Tx the notification flag */
        SET_FLAG_TX_SIG_STEERWHLTOUCHBDDN();
        /* Set of Tx the notification flag */
        SET_FLAG_TX_SIG_SLDVOLCTRLSTS_UB();
        /* Set of Tx the notification flag */
        SET_FLAG_TX_SIG_SLDVOLCTRLSTS();
        /* Set of Tx the notification flag */
        SET_FLAG_TX_SIG_RIMFCTACTSGUP_UB();
        /* Set of Tx the notification flag */
        SET_FLAG_TX_SIG_RIMFCTACTSGUP();
        /* Set of Tx the notification flag */
        SET_FLAG_TX_SIG_RIMFCTACTSGRI_UB();
        /* Set of Tx the notification flag */
        SET_FLAG_TX_SIG_RIMFCTACTSGRI();
        /* Set of Tx the notification flag */
        SET_FLAG_TX_SIG_RIMFCTACTSGLE_UB();
        /* Set of Tx the notification flag */
        SET_FLAG_TX_SIG_RIMFCTACTSGLE();
        /* Set of Tx the notification flag */
        SET_FLAG_TX_SIG_RIMFCTACTSGDN_UB();
        /* Set of Tx the notification flag */
        SET_FLAG_TX_SIG_RIMFCTACTSGDN();
        /* Set of Tx the notification flag */
        SET_FLAG_TX_SIG_RIMFCTACTSGCE_UB();
        /* Set of Tx the notification flag */
        SET_FLAG_TX_SIG_RIMFCTACTSGCE();
        break;
    case ID_TP_FRM_SWTRPRIVATEDHUCANFR01:
        /* Set of Tx the notification flag */
        SET_FLAG_TX_SIG_STEERWHLTOUCHBDRITOUCHPOSNY();
        /* Set of Tx the notification flag */
        SET_FLAG_TX_SIG_STEERWHLTOUCHBDRITOUCHPOSNX();
        /* Set of Tx the notification flag */
        SET_FLAG_TX_SIG_STEERWHLTOUCHBDRISTEERWHLTOUCHBDSTS();
        /* Set of Tx the notification flag */
        SET_FLAG_TX_SIG_STEERWHLTOUCHBDRICNTR();
        /* Set of Tx the notification flag */
        SET_FLAG_TX_SIG_STEERWHLTOUCHBDRICHKS();
        /* Set of Tx the notification flag */
        SET_FLAG_TX_SIG_STEERWHLTOUCHBDRI_UB();
        break;
    case ID_TP_FRM_DIAG_PHYSREQ_SWTR: // //ID_TP_FRM_DIAG_PHYSRESP_SWTR  ID_TP_FRM_DIAG_FUNCREQ
    case ID_TP_FRM_DIAG_FUNCREQ:
        SET_FLAG_TX_SIG_DIAGNOSTICRESPSWTR();
        break;
    default:
        /* Do nothing */
        break;
    }
}

/*---------------------------------------------------------------------------
| Portability:  Target platform independent
|----------------------------------------------------------------------------
| Routine description:
|  * Service to initialize OsekCom stack
|
| ------------------------------------------------- --------------------------
| Parameters description:
|  app_mode: OsekCom initialization mode (See t_com_application_mode_type)
|  return: E_OK in case of no errors
|          Other (see t_status_type).
/---------------------------------------------------------------------------*/
t_status_type StartCom(t_com_application_mode_type app_mode)
{
    uint16_t ind;
    uint8_t aux[8];
    const t_application_data_ref aux_ref = &aux;

    /* Get current timer tick */

    /* Buffer initialization */
    for (ind = 0; ind < (uint16_t)8; ind++)
    {
        aux[ind] = (uint8_t)0;
    }
    /* Register of the COM mode */
    flag_st_mode = app_mode & (uint8_t)0x0F;

    /* Set of the active communications flags */
    SET_FLAG_OSEK_COM_INIT();

    /* Signals initialization to zero */
    for (ind = (uint16_t)0; ind < LAST_OSEK_COM_SIGNAL_SYMBOLIC_NAME; ind++)
    {
        (void)InitMessage(ind, aux_ref);
    }
    /* Signals initialization to a specific value */

    /* Initialization of the Tx request flags */
    flag_swtr_com_tx_req0 = (uint8_t)0;
    flag_swtr_com_tx_req1 = (uint8_t)0;

    /* Initialization of the communications traffic flags */
    com_traffic_swtr = COM_FALSE;

    /* Initialization of the Rx deadline monitoring timers */
    dmt_rx_sig_actvnofsteerwhlillmn = 0;

    /* Initialization of the class 2 (TxNotif) flags */
    flag_tx0 = (uint8_t)0;
    flag_tx1 = (uint8_t)0;
    flag_tx2 = (uint8_t)0;
    flag_tx3 = (uint8_t)0;
    flag_tx4 = (uint8_t)0;
    flag_tx5 = (uint8_t)0;
    flag_tx6 = (uint8_t)0;
    flag_tx7 = (uint8_t)0;
    flag_rx0 = (UI_8)0;
    /* Return */
    return E_OK;
}

/*---------------------------------------------------------------------------
| Portability:  Target platform independent
|----------------------------------------------------------------------------
| Routine description:
| * Service to inquiry in which mode OsekCom has been initialized.
| * If this service is called before initializing the communications stack
|   a random mode will be returned.
| ---------------------------------------------------------------------------
| Parameters description:
|  return: OsekCom initialization mode(See t_com_application_mode_type)
/ --------------------------------------------------------------------------- */
t_com_application_mode_type GetComApplicationMode(void)
{
    return ((t_com_application_mode_type)(flag_st_mode & (uint8_t)0x0F));
}

/*---------------------------------------------------------------------------
| Portability:  Target platform independent
|----------------------------------------------------------------------------
| Routine description:
| * Service to close the OsekCom stack.
| * This service stops the transmission of periodic frames.
| * After calling this service communications could be re-established
|   calling again service StartCom.
| * This service does not change the state of any lower COM driver.
| ---------------------------------------------------------------------------
| Parameters description:
|  shtdwn_mode: OsekCom stop mode (See t_com_shutdown_mode_type)
|  return: E_OK in case of no errors
|          Other (see t_status_type).
/ --------------------------------------------------------------------------- */
t_status_type StopCom(t_com_shutdown_mode_type shtdwn_mode)
{
    /* Communications stop */
    flag_st_mode &= (uint8_t)0x0F;
    return (E_OK);
}

/*---------------------------------------------------------------------------
| Portability:  Target platform independent
|----------------------------------------------------------------------------
| Routine description:
|  * Service to start the transmission of periodic or mixed frames.
|  * If this service is re-executed then transmission timers will be re-started.
|---------------------------------------------------------------------------
| Parameters description:
|  return: E_OK in case of no errors
|          Other (see t_status_type).
/---------------------------------------------------------------------------*/
t_status_type StartPeriodic(void)
{
    t_status_type status = E_OK;

    if (TST_FLAG_OSEK_COM_INIT())
    {
        /* Initialization of periodic or mixed tx timers */
        ptt_tx_frm_swtrprivatedhucanfr06 = PT_TX_FRM_SWTRPRIVATEDHUCANFR06 - OT_TX_FRM_SWTRPRIVATEDHUCANFR06;
        ptt_tx_frm_swtrprivatedhucanfr05 = PT_TX_FRM_SWTRPRIVATEDHUCANFR05 - OT_TX_FRM_SWTRPRIVATEDHUCANFR05;
        ptt_tx_frm_swtrprivatedhucanfr04 = PT_TX_FRM_SWTRPRIVATEDHUCANFR04 - OT_TX_FRM_SWTRPRIVATEDHUCANFR04;
        ptt_tx_frm_swtrprivatedhucanfr03 = PT_TX_FRM_SWTRPRIVATEDHUCANFR03 - OT_TX_FRM_SWTRPRIVATEDHUCANFR03;
        ptt_tx_frm_swtrprivatedhucanfr02 = PT_TX_FRM_SWTRPRIVATEDHUCANFR02 - OT_TX_FRM_SWTRPRIVATEDHUCANFR02;
        ptt_tx_frm_swtrprivatedhucanfr01 = PT_TX_FRM_SWTRPRIVATEDHUCANFR01 - OT_TX_FRM_SWTRPRIVATEDHUCANFR01;
        ptt_tx_frm_swtrpressfr01 = PT_TX_FRM_SWTRPRESSFR01 - OT_TX_FRM_SWTRPRESSFR01;
        ptt_tx_frm_swtrsensorfr01 = PT_TX_FRM_SWTRSENSORFR01 - OT_TX_FRM_SWTRSENSORFR01;
        ptt_tx_frm_swtrsensorfr02 = PT_TX_FRM_SWTRSENSORFR02 - OT_TX_FRM_SWTRSENSORFR02;
        ptt_tx_frm_swtrsensorfr03 = PT_TX_FRM_SWTRSENSORFR03 - OT_TX_FRM_SWTRSENSORFR03;
        ptt_tx_frm_swtrsensorfr04 = PT_TX_FRM_SWTRSENSORFR04 - OT_TX_FRM_SWTRSENSORFR04;
        ptt_tx_frm_swtrsensorfr05 = PT_TX_FRM_SWTRSENSORFR05 - OT_TX_FRM_SWTRSENSORFR05;
        ptt_tx_frm_swtrsensorfr06 = PT_TX_FRM_SWTRSENSORFR06 - OT_TX_FRM_SWTRSENSORFR06;
        ptt_tx_frm_swtrsensorfr07 = PT_TX_FRM_SWTRSENSORFR07 - OT_TX_FRM_SWTRSENSORFR07;
        ptt_tx_frm_swtrsensorfr08 = PT_TX_FRM_SWTRSENSORFR08 - OT_TX_FRM_SWTRSENSORFR08;

        /* Activation of the periodic Tx management runnable */
        SET_FLAG_OSEK_COM_PER_TX();
    }
    else
    {
        status = E_COM_SYS_NOINIT;
    }

    return status;
}

/*---------------------------------------------------------------------------
| Portability:  Target platform independent
|----------------------------------------------------------------------------
| Routine description:
|  * Service to stop the transmission of periodic or mixed frames.
|  * To re-start the transmission of periodic or mixed frames service
|    StartPeriodic must be called.
|---------------------------------------------------------------------------
| Parameters description:
|  return: E_OK in case of no errors
|          Other (see t_status_type).
/---------------------------------------------------------------------------*/
t_status_type StopPeriodic(void)
{

    /* Deactivation of the periodic Tx management runnable */
    RST_FLAG_OSEK_COM_PER_TX();

    return E_OK;
}

/*---------------------------------------------------------------------------
| Portability:  Target platform independent
|----------------------------------------------------------------------------
| Routine description:
|  * This service updates the application variable referenced by >data_ref< with
|    the data stored in the internal stack for the object identified by >message<.
|  * This service will reset the class 1 (RxNotif) and 3 (RxErrorNotif) flags
|    associated to >message<
|  * If >message< is an enqueued signal the service will return the data
|    stored in the internal stack (initial value / last received value / last value
|    set with InitMessage)
|    If >message< is a queued signal the service will return the first value
|    available in the queue or error if the queue is empty. (Mode not supported)
|  * The user is responsible of granting that the parameter >data_ref<
|    points to a variable correctly allocated and compatible in size with the
|    received signal type
|  * Usage example:
|    t_vehicle_speed vehicle_speed;
|    (void)ReceiveMessage(SIG_VEHICLE_SPEED,&vehicle_speed);
|---------------------------------------------------------------------------
| Parameters description:
|   message: Identification of the signal to be retrieved.
|   data_ref: Pointer to a variable where to store the requested signal.
|   return:
|     E_OK in case of no errors
|     E_COM_ID in case the parameter >message< is out of range or if it refers
|              to signal that is sent, dynamic length or zero-length
|     E_COM_NOMSG in case the queued signal identified by >message< is empty.
|     E_COM_LIMIT in case an overflow of the queue of the signal identified by >message<
|                 occurred since the last call to ReceiveMessage for >message<.
|                 E_COM_LIMIT indicates that at least one message has been discarded
|                 since the message queue filled. Nevertheless the service is
|                 performed and a message is returned. The service ReceiveMessage
|                 clears the overflow condition for >message<.
|     other (see t_status_type).
/---------------------------------------------------------------------------*/
t_status_type ReceiveMessage(t_symbolic_name message,
                             t_application_data_ref data_ref)
{
    t_status_type status = E_OK;

    /* Mutual exclusive access begin */
    // SuspendAllInterrupts();
    switch (message)
    {
    case SIG_TWLIBRISTS_UB:
        ((uint8_t *)data_ref)[0] = sig_twlibrists_ub[0];
        break;
    case SIG_TWLIBRISTS:
        ((uint8_t *)data_ref)[0] = sig_twlibrists[0];
        break;
    case SIG_SWTOFKEYTONE_UB:
        ((uint8_t *)data_ref)[0] = sig_swtofkeytone_ub[0];
        break;
    case SIG_SWTOFKEYTONE:
        ((uint8_t *)data_ref)[0] = sig_swtofkeytone[0];
        break;
    case SIG_INTRBRISTS_UB:
        ((uint8_t *)data_ref)[0] = sig_intrbrists_ub[0];
        break;
    case SIG_INTRBRISTS:
        ((uint8_t *)data_ref)[0] = sig_intrbrists[0];
        break;
    case SIG_ACTVNOFSTEERWHLILLMN_UB:
        ((uint8_t *)data_ref)[0] = sig_actvnofsteerwhlillmn_ub[0];
        break;
    case SIG_ACTVNOFSTEERWHLILLMN:
        ((uint8_t *)data_ref)[0] = sig_actvnofsteerwhlillmn[0];
        break;
    default:
        status = E_COM_ID;
        break;
    }
    /* Mutual exclusive access end */
    // ResumeAllInterrupts();
    return status;
}

t_status_type ReceiveDynamicMessage(t_symbolic_name message,
                                    t_application_data_ref data_ref,
                                    t_length_ref length_ref)
{
    t_status_type status = E_OK;

    /* Mutual exclusive access begin */
    // SuspendAllInterrupts();
    switch (message)
    {
    case SIG_DIAGNOSTICREQSWTR:
        ((UI_8 *)data_ref)[0] = sig_diagnosticreqswtr[0];
        ((UI_8 *)data_ref)[1] = sig_diagnosticreqswtr[1];
        ((UI_8 *)data_ref)[2] = sig_diagnosticreqswtr[2];
        ((UI_8 *)data_ref)[3] = sig_diagnosticreqswtr[3];
        ((UI_8 *)data_ref)[4] = sig_diagnosticreqswtr[4];
        ((UI_8 *)data_ref)[5] = sig_diagnosticreqswtr[5];
        ((UI_8 *)data_ref)[6] = sig_diagnosticreqswtr[6];
        ((UI_8 *)data_ref)[7] = sig_diagnosticreqswtr[7];
        *((UI_8 *)length_ref) = sig_len_diagnosticreqswtr;
        /* Reset class 1 (RxNotif) flag */
        ResetFlagRxSigDiagnosticReqSWTR();
        break;
    case SIG_DIAGNOSTICFUNCADDRREQ:
        ((UI_8 *)data_ref)[0] = sig_diagnosticfuncaddrreq[0];
        ((UI_8 *)data_ref)[1] = sig_diagnosticfuncaddrreq[1];
        ((UI_8 *)data_ref)[2] = sig_diagnosticfuncaddrreq[2];
        ((UI_8 *)data_ref)[3] = sig_diagnosticfuncaddrreq[3];
        ((UI_8 *)data_ref)[4] = sig_diagnosticfuncaddrreq[4];
        ((UI_8 *)data_ref)[5] = sig_diagnosticfuncaddrreq[5];
        ((UI_8 *)data_ref)[6] = sig_diagnosticfuncaddrreq[6];
        ((UI_8 *)data_ref)[7] = sig_diagnosticfuncaddrreq[7];
        *((UI_8 *)length_ref) = sig_len_diagnosticfuncaddrreq;
        /* Reset class 1 (RxNotif) flag */
        ResetFlagRxSigDiagnosticFuncAddrReq();
        break;
    default:
        status = E_COM_ID;
        break;
    }
    /* Mutual exclusive access end */
    //  ResumeAllInterrupts();
    return status;
}

/*---------------------------------------------------------------------------
| Portability:  Target platform independent
|----------------------------------------------------------------------------
| Routine description:
|  * This service updates OsekCom internal data structure of the signal
|    identified by >message< with the data referenced by the variable
|    referenced by >data_ref< parameter.
|  * This service will reset the class 2 (TxNotif) and 4 (TxErrorNotif) flags
|    associated to >message<
|  * If >message< has the Triggered Transfer Property, the update will be
|    followed by immediate transmission of the I-PDU associated with the signal except
|    when the signal is packed into an I-PDU with Periodic Transmission Mode.
|    In this case, no transmission is initiated by the call to this service.
|  * If >message< has the Pending Transfer Property, no transmission is
|    triggered by the usage of this service.
|  * The user is responsible of granting that the parameter >data_ref<
|    points to a variable correctly allocated and compatible in size with the
|    transmitted signal type.
|  * Usage example:
|    t_vehicle_speed vehicle_speed = 20;
|    (void)SendMessage(SIG_VEHICLE_SPEED,&vehicle_speed);
|---------------------------------------------------------------------------
| Parameters description:
|   message: Identification of the signal to be transmitted.
|   data_ref: Pointer to a variable containing the data to be transmitted.
|   return:
|     E_OK in case of no errors
|     E_COM_ID is case the parameter >message< is out of range or if it refers
|              to a message that is received or to a dynamic-length or
|              zero-length message.
|     other (see t_status_type).
/---------------------------------------------------------------------------*/
t_status_type SendMessage(t_symbolic_name message,
                          t_application_data_ref data_ref)
{
    t_status_type status;
    t_symbolic_name aux_msg = message & (~NODE_ID_MASK);

    /* Case when FicOsek is initialized */
    if (TST_FLAG_OSEK_COM_INIT())
    {
        /* Case when message is not out of the range */
        if ((aux_msg >= FIRST_TX_STA_LEN_SIGNAL_SYMBOLIC_NAME) &&
            (aux_msg <= LAST_TX_STA_LEN_SIGNAL_SYMBOLIC_NAME))
        {
            /* Mutual exclusive access begin */
            // SuspendAllInterrupts();
            /* Set of message data */
            status = InitMessage(message, data_ref);
            /* Switch for signals with Tx or TxError flags to reset */
            switch (message)
            {
            case SIG_DIAGCFAILRTOUCHPANSWTRVIBRATIONFLTSTS:
                /* Reset Tx notification flag */
                ResetFlagTxSigDiagcFailrTouchPanSWTRVibrationFltSts();
                break;
            case SIG_DIAGCFAILRTOUCHPANSWTRTOUCHDFLTSTS:
                /* Reset Tx notification flag */
                ResetFlagTxSigDiagcFailrTouchPanSWTRTouchdFltSts();
                break;
            case SIG_DIAGCFAILRTOUCHPANSWTRSNSRFLTSTS:
                /* Reset Tx notification flag */
                ResetFlagTxSigDiagcFailrTouchPanSWTRSnsrFltSts();
                break;
            case SIG_DIAGCFAILRTOUCHPANSWTRCMNFLTSTS:
                /* Reset Tx notification flag */
                ResetFlagTxSigDiagcFailrTouchPanSWTRCmnFltSts();
                break;
            case SIG_DIAGCFAILRTOUCHPANSWTR_UB:
                /* Reset Tx notification flag */
                ResetFlagTxSigDiagcFailrTouchPanSWTR_UB();
                break;
            case SIG_SWTRSERNONR4:
                /* Reset Tx notification flag */
                ResetFlagTxSigSWTRSerNoNr4();
                break;
            case SIG_SWTRSERNONR3:
                /* Reset Tx notification flag */
                ResetFlagTxSigSWTRSerNoNr3();
                break;
            case SIG_SWTRSERNONR2:
                /* Reset Tx notification flag */
                ResetFlagTxSigSWTRSerNoNr2();
                break;
            case SIG_SWTRSERNONR1:
                /* Reset Tx notification flag */
                ResetFlagTxSigSWTRSerNoNr1();
                break;
            case SIG_SWTRSERNO_UB:
                /* Reset Tx notification flag */
                ResetFlagTxSigSWTRSerNo_UB();
                break;
            case SIG_SWTRPARTNOCMPLNR4:
                /* Reset Tx notification flag */
                ResetFlagTxSigSWTRPartNoCmplNr4();
                break;
            case SIG_SWTRPARTNOCMPLNR3:
                /* Reset Tx notification flag */
                ResetFlagTxSigSWTRPartNoCmplNr3();
                break;
            case SIG_SWTRPARTNOCMPLNR2:
                /* Reset Tx notification flag */
                ResetFlagTxSigSWTRPartNoCmplNr2();
                break;
            case SIG_SWTRPARTNOCMPLNR1:
                /* Reset Tx notification flag */
                ResetFlagTxSigSWTRPartNoCmplNr1();
                break;
            case SIG_SWTRPARTNOCMPLENDSGN3:
                /* Reset Tx notification flag */
                ResetFlagTxSigSWTRPartNoCmplEndSgn3();
                break;
            case SIG_SWTRPARTNOCMPLENDSGN2:
                /* Reset Tx notification flag */
                ResetFlagTxSigSWTRPartNoCmplEndSgn2();
                break;
            case SIG_SWTRPARTNOCMPLENDSGN1:
                /* Reset Tx notification flag */
                ResetFlagTxSigSWTRPartNoCmplEndSgn1();
                break;
            case SIG_SWTRPARTNOCMPL_UB:
                /* Reset Tx notification flag */
                ResetFlagTxSigSWTRPartNoCmpl_UB();
                break;
            case SIG_SWTRPARTNO10CMPLNR5:
                /* Reset Tx notification flag */
                ResetFlagTxSigSWTRPartNo10CmplNr5();
                break;
            case SIG_SWTRPARTNO10CMPLNR4:
                /* Reset Tx notification flag */
                ResetFlagTxSigSWTRPartNo10CmplNr4();
                break;
            case SIG_SWTRPARTNO10CMPLNR3:
                /* Reset Tx notification flag */
                ResetFlagTxSigSWTRPartNo10CmplNr3();
                break;
            case SIG_SWTRPARTNO10CMPLNR2:
                /* Reset Tx notification flag */
                ResetFlagTxSigSWTRPartNo10CmplNr2();
                break;
            case SIG_SWTRPARTNO10CMPLNR1:
                /* Reset Tx notification flag */
                ResetFlagTxSigSWTRPartNo10CmplNr1();
                break;
            case SIG_SWTRPARTNO10CMPLENDSGN3:
                /* Reset Tx notification flag */
                ResetFlagTxSigSWTRPartNo10CmplEndSgn3();
                break;
            case SIG_SWTRPARTNO10CMPLENDSGN2:
                /* Reset Tx notification flag */
                ResetFlagTxSigSWTRPartNo10CmplEndSgn2();
                break;
            case SIG_SWTRPARTNO10CMPLENDSGN1:
                /* Reset Tx notification flag */
                ResetFlagTxSigSWTRPartNo10CmplEndSgn1();
                break;
            case SIG_SWPUPDWNSTSRI_UB:
                /* Reset Tx notification flag */
                ResetFlagTxSigSwpUpDwnStsRi_UB();
                break;
            case SIG_SWPUPDWNSTSRI:
                /* Reset Tx notification flag */
                ResetFlagTxSigSwpUpDwnStsRi();
                break;
            case SIG_SWPLERISTSRI_UB:
                /* Reset Tx notification flag */
                ResetFlagTxSigSwpLeRiStsRi_UB();
                break;
            case SIG_SWPLERISTSRI:
                /* Reset Tx notification flag */
                ResetFlagTxSigSwpLeRiStsRi();
                break;
            case SIG_STEERWHLTOUCHBDVOICE_UB:
                /* Reset Tx notification flag */
                ResetFlagTxSigSteerWhlTouchBdVoice_UB();
                break;
            case SIG_STEERWHLTOUCHBDVOICE:
                /* Reset Tx notification flag */
                ResetFlagTxSigSteerWhlTouchBdVoice();
                break;
            case SIG_STEERWHLTOUCHBDMENU_UB:
                /* Reset Tx notification flag */
                ResetFlagTxSigSteerWhlTouchBdMenu_UB();
                break;
            case SIG_STEERWHLTOUCHBDMENU:
                /* Reset Tx notification flag */
                ResetFlagTxSigSteerWhlTouchBdMenu();
                break;
            case SIG_STEERWHLTOUCHBDDN_UB:
                /* Reset Tx notification flag */
                ResetFlagTxSigSteerWhlTouchBdDn_UB();
                break;
            case SIG_STEERWHLTOUCHBDDN:
                /* Reset Tx notification flag */
                ResetFlagTxSigSteerWhlTouchBdDn();
                break;
            case SIG_SLDVOLCTRLSTS_UB:
                /* Reset Tx notification flag */
                ResetFlagTxSigSldVolCtrlSts_UB();
                break;
            case SIG_SLDVOLCTRLSTS:
                /* Reset Tx notification flag */
                ResetFlagTxSigSldVolCtrlSts();
                break;
            case SIG_RIMFCTACTSGUP_UB:
                /* Reset Tx notification flag */
                ResetFlagTxSigRiMFctActSgUp_UB();
                break;
            case SIG_RIMFCTACTSGUP:
                /* Reset Tx notification flag */
                ResetFlagTxSigRiMFctActSgUp();
                break;
            case SIG_RIMFCTACTSGRI_UB:
                /* Reset Tx notification flag */
                ResetFlagTxSigRiMFctActSgRi_UB();
                break;
            case SIG_RIMFCTACTSGRI:
                /* Reset Tx notification flag */
                ResetFlagTxSigRiMFctActSgRi();
                break;
            case SIG_RIMFCTACTSGLE_UB:
                /* Reset Tx notification flag */
                ResetFlagTxSigRiMFctActSgLe_UB();
                break;
            case SIG_RIMFCTACTSGLE:
                /* Reset Tx notification flag */
                ResetFlagTxSigRiMFctActSgLe();
                break;
            case SIG_RIMFCTACTSGDN_UB:
                /* Reset Tx notification flag */
                ResetFlagTxSigRiMFctActSgDn_UB();
                break;
            case SIG_RIMFCTACTSGDN:
                /* Reset Tx notification flag */
                ResetFlagTxSigRiMFctActSgDn();
                break;
            case SIG_RIMFCTACTSGCE_UB:
                /* Reset Tx notification flag */
                ResetFlagTxSigRiMFctActSgCe_UB();
                break;
            case SIG_RIMFCTACTSGCE:
                /* Reset Tx notification flag */
                ResetFlagTxSigRiMFctActSgCe();
                break;
            case SIG_STEERWHLTOUCHBDRITOUCHPOSNY:
                /* Reset Tx notification flag */
                ResetFlagTxSigSteerWhlTouchBdRiTouchPosnY();
                break;
            case SIG_STEERWHLTOUCHBDRITOUCHPOSNX:
                /* Reset Tx notification flag */
                ResetFlagTxSigSteerWhlTouchBdRiTouchPosnX();
                break;
            case SIG_STEERWHLTOUCHBDRISTEERWHLTOUCHBDSTS:
                /* Reset Tx notification flag */
                ResetFlagTxSigSteerWhlTouchBdRiSteerWhlTouchBdSts();
                break;
            case SIG_STEERWHLTOUCHBDRICNTR:
                /* Reset Tx notification flag */
                ResetFlagTxSigSteerWhlTouchBdRiCntr();
                break;
            case SIG_STEERWHLTOUCHBDRICHKS:
                /* Reset Tx notification flag */
                ResetFlagTxSigSteerWhlTouchBdRiChks();
                break;
            case SIG_STEERWHLTOUCHBDRI_UB:
                /* Reset Tx notification flag */
                ResetFlagTxSigSteerWhlTouchBdRi_UB();
                break;
            case SIG_DIAGNOSTICRESPSWTR:
                ResetFlagTxSigDiagnosticRespSWTR();
                break;
            default:
                /* Do nothing */
                break;
            }
            /* Mutual exclusive access end */
            // ResumeAllInterrupts();
        }
        /* Case when message is out of the range */
        else
        {
            status = E_COM_ID;
        }
    }
    /* Case when FicOsek is not initialized */
    else
    {
        status = E_COM_SYS_NOINIT;
    }
    return status;
}

t_status_type SendDynamicMessage(t_symbolic_name message,
                                 t_application_data_ref data_ref,
                                 t_length_ref length_ref)
{
    t_status_type status;
    t_symbolic_name aux_msg = message & (~NODE_ID_MASK);
    /* Case when FicOsek is initialized */
    if (TST_FLAG_OSEK_COM_INIT())
    {
        /* Case when message is not out of the range */
        if ((aux_msg >= FIRST_TX_DYN_LEN_SIGNAL_SYMBOLIC_NAME) &&
            (aux_msg <= LAST_TX_DYN_LEN_SIGNAL_SYMBOLIC_NAME))
        {
            /* Mutual exclusive access begin */
            // SuspendAllInterrupts();
            /* Set of signal data */
            status = InitMessage(message, data_ref);
            /* Switch for signals */
            switch (message)
            {
            case SIG_DIAGNOSTICRESPSWTR:
                /* Set of signal length */
                len_frm_diag_physresp_swtr = MAX_LEN_FRM_DIAG_PHYSRESP_SWTR - MAX_LEN_SIG_DIAGNOSTICRESPSWTR + (*((UI_8 *)length_ref));
                /* Reset class 2 (TxNotif) flag */
                ResetFlagTxSigDiagnosticRespSWTR();
                /* Reset class 4 (TxErrorNotif) flag */
                // ResetFlagTxErrorSigDiagnosticRespSWTR();
                break;
            default:
                /* Do nothing */
                break;
            }
            /* Mutual exclusive access end */
            // ResumeAllInterrupts();
            /* Switch for triggered signal of direct or mixed frames */
            switch (message)
            {
            case SIG_DIAGNOSTICRESPSWTR:
                /* Trigger event to initiate the transmission of the frame */
                OsekComTxReqFrmDIAG_PhysResp_SWTR();
                break;
            default:
                /* Do nothing */
                break;
            }
        }
        /* Case when message is out of the range */
        else
        {
            status = E_COM_ID;
        }
    }
    /* Case when FicOsek is not initialized */
    else
    {
        status = E_COM_SYS_NOINIT;
    }
    return status;
}

/*---------------------------------------------------------------------------
| Portability:  Target platform independent
|----------------------------------------------------------------------------
| Routine description:
|  * This service updates OsekCom internal data structure of the signal
|    identified by >message< with the data referenced by the variable
|    referenced by >data_ref<
|  * This service will not reset any class flags associated to >message<
|  * This service will not initiate any transmission.
|  * The user is responsible of granting that the parameter 'data_ref'
|    points to an address correctly allocated and compatible in size with the
|    transmitted signal type.
|---------------------------------------------------------------------------
| Parameters description:
|   message: Identification of the signal.
|   data_ref: Pointer to a variable containing the data.
|   return:
|     E_OK in case of no errors
|     E_COM_ID if the message or signal to initialize don't exist
|     Other (see t_status_type).
/---------------------------------------------------------------------------*/
t_status_type InitMessage(t_symbolic_name message,
                          t_application_data_ref data_ref)
{
    t_status_type status = E_OK;

    /* Mutual exclusive access begin */
    // SuspendAllInterrupts();
    switch (message)
    {
    case SIG_TWLIBRISTS_UB:
        /* Initialization of signal sig_TwliBriSts_UB */
        sig_twlibrists_ub[0] = ((uint8_t *)data_ref)[0];
        break;
    case SIG_TWLIBRISTS:
        /* Initialization of signal sig_TwliBriSts */
        sig_twlibrists[0] = ((uint8_t *)data_ref)[0];
        break;
    case SIG_SWTOFKEYTONE_UB:
        /* Initialization of signal sig_SwtOfKeyTone_UB */
        sig_swtofkeytone_ub[0] = ((uint8_t *)data_ref)[0];
        break;
    case SIG_SWTOFKEYTONE:
        /* Initialization of signal sig_SwtOfKeyTone */
        sig_swtofkeytone[0] = ((uint8_t *)data_ref)[0];
        break;
    case SIG_INTRBRISTS_UB:
        /* Initialization of signal sig_IntrBriSts_UB */
        sig_intrbrists_ub[0] = ((uint8_t *)data_ref)[0];
        break;
    case SIG_INTRBRISTS:
        /* Initialization of signal sig_IntrBriSts */
        sig_intrbrists[0] = ((uint8_t *)data_ref)[0];
        break;
    case SIG_ACTVNOFSTEERWHLILLMN_UB:
        /* Initialization of signal sig_ActvnOfSteerWhlIllmn_UB */
        sig_actvnofsteerwhlillmn_ub[0] = ((uint8_t *)data_ref)[0];
        break;
    case SIG_ACTVNOFSTEERWHLILLMN:
        /* Initialization of signal sig_ActvnOfSteerWhlIllmn */
        sig_actvnofsteerwhlillmn[0] = ((uint8_t *)data_ref)[0];
        break;
    case SIG_DIAGCFAILRTOUCHPANSWTRVIBRATIONFLTSTS:
        /* Initial codification of the signal sig_DiagcFailrTouchPanSWTRVibrationFltSts */
        frm_swtrprivatedhucanfr06[0] &= (((uint8_t)0xFF) - (((uint8_t)3)));
        frm_swtrprivatedhucanfr06[0] |= ((((uint8_t *)data_ref)[0] & ((uint8_t)3)));
        break;
    case SIG_DIAGCFAILRTOUCHPANSWTRTOUCHDFLTSTS:
        /* Initial codification of the signal sig_DiagcFailrTouchPanSWTRTouchdFltSts */
        frm_swtrprivatedhucanfr06[0] &= (((uint8_t)0xFF) - (((uint8_t)3) << ((uint8_t)2)));
        frm_swtrprivatedhucanfr06[0] |= ((((uint8_t *)data_ref)[0] & ((uint8_t)3)) << ((uint8_t)2));
        break;
    case SIG_DIAGCFAILRTOUCHPANSWTRSNSRFLTSTS:
        /* Initial codification of the signal sig_DiagcFailrTouchPanSWTRSnsrFltSts */
        frm_swtrprivatedhucanfr06[0] &= (((uint8_t)0xFF) - (((uint8_t)7) << ((uint8_t)4)));
        frm_swtrprivatedhucanfr06[0] |= ((((uint8_t *)data_ref)[0] & ((uint8_t)7)) << ((uint8_t)4));
        break;
    case SIG_DIAGCFAILRTOUCHPANSWTRCMNFLTSTS:
        /* Initial codification of the signal sig_DiagcFailrTouchPanSWTRCmnFltSts */
        frm_swtrprivatedhucanfr06[0] &= (((uint8_t)0xFF) - (((uint8_t)1) << ((uint8_t)7)));
        frm_swtrprivatedhucanfr06[0] |= ((((uint8_t *)data_ref)[0] & ((uint8_t)1)) << ((uint8_t)7));
        break;
    case SIG_DIAGCFAILRTOUCHPANSWTR_UB:
        /* Initial codification of the signal sig_DiagcFailrTouchPanSWTR_UB */
        frm_swtrprivatedhucanfr06[1] &= (((uint8_t)0xFF) - (((uint8_t)1) << ((uint8_t)7)));
        frm_swtrprivatedhucanfr06[1] |= ((((uint8_t *)data_ref)[0] & ((uint8_t)1)) << ((uint8_t)7));
        break;
    case SIG_SWTRSERNONR4:
        /* Initial codification of the signal sig_SWTRSerNoNr4 */
        frm_swtrprivatedhucanfr05[3] &= (((uint8_t)0xFF) - (((uint8_t)255)));
        frm_swtrprivatedhucanfr05[3] |= ((((uint8_t *)data_ref)[0] & ((uint8_t)255)));
        break;
    case SIG_SWTRSERNONR3:
        /* Initial codification of the signal sig_SWTRSerNoNr3 */
        frm_swtrprivatedhucanfr05[2] &= (((uint8_t)0xFF) - (((uint8_t)255)));
        frm_swtrprivatedhucanfr05[2] |= ((((uint8_t *)data_ref)[0] & ((uint8_t)255)));
        break;
    case SIG_SWTRSERNONR2:
        /* Initial codification of the signal sig_SWTRSerNoNr2 */
        frm_swtrprivatedhucanfr05[1] &= (((uint8_t)0xFF) - (((uint8_t)255)));
        frm_swtrprivatedhucanfr05[1] |= ((((uint8_t *)data_ref)[0] & ((uint8_t)255)));
        break;
    case SIG_SWTRSERNONR1:
        /* Initial codification of the signal sig_SWTRSerNoNr1 */
        frm_swtrprivatedhucanfr05[0] &= (((uint8_t)0xFF) - (((uint8_t)255)));
        frm_swtrprivatedhucanfr05[0] |= ((((uint8_t *)data_ref)[0] & ((uint8_t)255)));
        break;
    case SIG_SWTRSERNO_UB:
        /* Initial codification of the signal sig_SWTRSerNo_UB */
        frm_swtrprivatedhucanfr05[4] &= (((uint8_t)0xFF) - (((uint8_t)1) << ((uint8_t)7)));
        frm_swtrprivatedhucanfr05[4] |= ((((uint8_t *)data_ref)[0] & ((uint8_t)1)) << ((uint8_t)7));
        break;
    case SIG_SWTRPARTNOCMPLNR4:
        /* Initial codification of the signal sig_SWTRPartNoCmplNr4 */
        frm_swtrprivatedhucanfr04[3] &= (((uint8_t)0xFF) - (((uint8_t)255)));
        frm_swtrprivatedhucanfr04[3] |= ((((uint8_t *)data_ref)[0] & ((uint8_t)255)));
        break;
    case SIG_SWTRPARTNOCMPLNR3:
        /* Initial codification of the signal sig_SWTRPartNoCmplNr3 */
        frm_swtrprivatedhucanfr04[2] &= (((uint8_t)0xFF) - (((uint8_t)255)));
        frm_swtrprivatedhucanfr04[2] |= ((((uint8_t *)data_ref)[0] & ((uint8_t)255)));
        break;
    case SIG_SWTRPARTNOCMPLNR2:
        /* Initial codification of the signal sig_SWTRPartNoCmplNr2 */
        frm_swtrprivatedhucanfr04[1] &= (((uint8_t)0xFF) - (((uint8_t)255)));
        frm_swtrprivatedhucanfr04[1] |= ((((uint8_t *)data_ref)[0] & ((uint8_t)255)));
        break;
    case SIG_SWTRPARTNOCMPLNR1:
        /* Initial codification of the signal sig_SWTRPartNoCmplNr1 */
        frm_swtrprivatedhucanfr04[0] &= (((uint8_t)0xFF) - (((uint8_t)255)));
        frm_swtrprivatedhucanfr04[0] |= ((((uint8_t *)data_ref)[0] & ((uint8_t)255)));
        break;
    case SIG_SWTRPARTNOCMPLENDSGN3:
        /* Initial codification of the signal sig_SWTRPartNoCmplEndSgn3 */
        frm_swtrprivatedhucanfr04[6] &= (((uint8_t)0xFF) - (((uint8_t)255)));
        frm_swtrprivatedhucanfr04[6] |= ((((uint8_t *)data_ref)[0] & ((uint8_t)255)));
        break;
    case SIG_SWTRPARTNOCMPLENDSGN2:
        /* Initial codification of the signal sig_SWTRPartNoCmplEndSgn2 */
        frm_swtrprivatedhucanfr04[5] &= (((uint8_t)0xFF) - (((uint8_t)255)));
        frm_swtrprivatedhucanfr04[5] |= ((((uint8_t *)data_ref)[0] & ((uint8_t)255)));
        break;
    case SIG_SWTRPARTNOCMPLENDSGN1:
        /* Initial codification of the signal sig_SWTRPartNoCmplEndSgn1 */
        frm_swtrprivatedhucanfr04[4] &= (((uint8_t)0xFF) - (((uint8_t)255)));
        frm_swtrprivatedhucanfr04[4] |= ((((uint8_t *)data_ref)[0] & ((uint8_t)255)));
        break;
    case SIG_SWTRPARTNOCMPL_UB:
        /* Initial codification of the signal sig_SWTRPartNoCmpl_UB */
        frm_swtrprivatedhucanfr04[7] &= (((uint8_t)0xFF) - (((uint8_t)1) << ((uint8_t)7)));
        frm_swtrprivatedhucanfr04[7] |= ((((uint8_t *)data_ref)[0] & ((uint8_t)1)) << ((uint8_t)7));
        break;
    case SIG_SWTRPARTNO10CMPLNR5:
        /* Initial codification of the signal sig_SWTRPartNo10CmplNr5 */
        frm_swtrprivatedhucanfr03[4] &= (((uint8_t)0xFF) - (((uint8_t)255)));
        frm_swtrprivatedhucanfr03[4] |= ((((uint8_t *)data_ref)[0] & ((uint8_t)255)));
        break;
    case SIG_SWTRPARTNO10CMPLNR4:
        /* Initial codification of the signal sig_SWTRPartNo10CmplNr4 */
        frm_swtrprivatedhucanfr03[3] &= (((uint8_t)0xFF) - (((uint8_t)255)));
        frm_swtrprivatedhucanfr03[3] |= ((((uint8_t *)data_ref)[0] & ((uint8_t)255)));
        break;
    case SIG_SWTRPARTNO10CMPLNR3:
        /* Initial codification of the signal sig_SWTRPartNo10CmplNr3 */
        frm_swtrprivatedhucanfr03[2] &= (((uint8_t)0xFF) - (((uint8_t)255)));
        frm_swtrprivatedhucanfr03[2] |= ((((uint8_t *)data_ref)[0] & ((uint8_t)255)));
        break;
    case SIG_SWTRPARTNO10CMPLNR2:
        /* Initial codification of the signal sig_SWTRPartNo10CmplNr2 */
        frm_swtrprivatedhucanfr03[1] &= (((uint8_t)0xFF) - (((uint8_t)255)));
        frm_swtrprivatedhucanfr03[1] |= ((((uint8_t *)data_ref)[0] & ((uint8_t)255)));
        break;
    case SIG_SWTRPARTNO10CMPLNR1:
        /* Initial codification of the signal sig_SWTRPartNo10CmplNr1 */
        frm_swtrprivatedhucanfr03[0] &= (((uint8_t)0xFF) - (((uint8_t)255)));
        frm_swtrprivatedhucanfr03[0] |= ((((uint8_t *)data_ref)[0] & ((uint8_t)255)));
        break;
    case SIG_SWTRPARTNO10CMPLENDSGN3:
        /* Initial codification of the signal sig_SWTRPartNo10CmplEndSgn3 */
        frm_swtrprivatedhucanfr03[7] &= (((uint8_t)0xFF) - (((uint8_t)255)));
        frm_swtrprivatedhucanfr03[7] |= ((((uint8_t *)data_ref)[0] & ((uint8_t)255)));
        break;
    case SIG_SWTRPARTNO10CMPLENDSGN2:
        /* Initial codification of the signal sig_SWTRPartNo10CmplEndSgn2 */
        frm_swtrprivatedhucanfr03[6] &= (((uint8_t)0xFF) - (((uint8_t)255)));
        frm_swtrprivatedhucanfr03[6] |= ((((uint8_t *)data_ref)[0] & ((uint8_t)255)));
        break;
    case SIG_SWTRPARTNO10CMPLENDSGN1:
        /* Initial codification of the signal sig_SWTRPartNo10CmplEndSgn1 */
        frm_swtrprivatedhucanfr03[5] &= (((uint8_t)0xFF) - (((uint8_t)255)));
        frm_swtrprivatedhucanfr03[5] |= ((((uint8_t *)data_ref)[0] & ((uint8_t)255)));
        break;
    case SIG_SWPUPDWNSTSRI_UB:
        /* Initial codification of the signal sig_SwpUpDwnStsRi_UB */
        frm_swtrprivatedhucanfr02[3] &= (((uint8_t)0xFF) - (((uint8_t)1)));
        frm_swtrprivatedhucanfr02[3] |= ((((uint8_t *)data_ref)[0] & ((uint8_t)1)));
        break;
    case SIG_SWPUPDWNSTSRI:
        /* Initial codification of the signal sig_SwpUpDwnStsRi */
        frm_swtrprivatedhucanfr02[4] &= (((uint8_t)0xFF) - (((uint8_t)7) << ((uint8_t)1)));
        frm_swtrprivatedhucanfr02[4] |= ((((uint8_t *)data_ref)[0] & ((uint8_t)7)) << ((uint8_t)1));
        break;
    case SIG_SWPLERISTSRI_UB:
        /* Initial codification of the signal sig_SwpLeRiStsRi_UB */
        frm_swtrprivatedhucanfr02[4] &= (((uint8_t)0xFF) - (((uint8_t)1) << ((uint8_t)4)));
        frm_swtrprivatedhucanfr02[4] |= ((((uint8_t *)data_ref)[0] & ((uint8_t)1)) << ((uint8_t)4));
        break;
    case SIG_SWPLERISTSRI:
        /* Initial codification of the signal sig_SwpLeRiStsRi */
        frm_swtrprivatedhucanfr02[4] &= (((uint8_t)0xFF) - (((uint8_t)7) << ((uint8_t)5)));
        frm_swtrprivatedhucanfr02[4] |= ((((uint8_t *)data_ref)[0] & ((uint8_t)7)) << ((uint8_t)5));
        break;
    case SIG_STEERWHLTOUCHBDVOICE_UB:
        /* Initial codification of the signal sig_SteerWhlTouchBdVoice_UB */
        frm_swtrprivatedhucanfr02[3] &= (((uint8_t)0xFF) - (((uint8_t)1) << ((uint8_t)5)));
        frm_swtrprivatedhucanfr02[3] |= ((((uint8_t *)data_ref)[0] & ((uint8_t)1)) << ((uint8_t)5));
        break;
    case SIG_STEERWHLTOUCHBDVOICE:
        /* Initial codification of the signal sig_SteerWhlTouchBdVoice */
        frm_swtrprivatedhucanfr02[3] &= (((uint8_t)0xFF) - (((uint8_t)3) << ((uint8_t)6)));
        frm_swtrprivatedhucanfr02[3] |= ((((uint8_t *)data_ref)[0] & ((uint8_t)3)) << ((uint8_t)6));
        break;
    case SIG_STEERWHLTOUCHBDMENU_UB:
        /* Initial codification of the signal sig_SteerWhlTouchBdMenu_UB */
        frm_swtrprivatedhucanfr02[1] &= (((uint8_t)0xFF) - (((uint8_t)1) << ((uint8_t)1)));
        frm_swtrprivatedhucanfr02[1] |= ((((uint8_t *)data_ref)[0] & ((uint8_t)1)) << ((uint8_t)1));
        break;
    case SIG_STEERWHLTOUCHBDMENU:
        /* Initial codification of the signal sig_SteerWhlTouchBdMenu */
        frm_swtrprivatedhucanfr02[2] &= (((uint8_t)0xFF) - (((uint8_t)3)));
        frm_swtrprivatedhucanfr02[2] |= ((((uint8_t *)data_ref)[0] & ((uint8_t)3)));
        break;
    case SIG_STEERWHLTOUCHBDDN_UB:
        /* Initial codification of the signal sig_SteerWhlTouchBdDn_UB */
        frm_swtrprivatedhucanfr02[2] &= (((uint8_t)0xFF) - (((uint8_t)1) << ((uint8_t)4)));
        frm_swtrprivatedhucanfr02[2] |= ((((uint8_t *)data_ref)[0] & ((uint8_t)1)) << ((uint8_t)4));
        break;
    case SIG_STEERWHLTOUCHBDDN:
        /* Initial codification of the signal sig_SteerWhlTouchBdDn */
        frm_swtrprivatedhucanfr02[2] &= (((uint8_t)0xFF) - (((uint8_t)3) << ((uint8_t)2)));
        frm_swtrprivatedhucanfr02[2] |= ((((uint8_t *)data_ref)[0] & ((uint8_t)3)) << ((uint8_t)2));
        break;
    case SIG_SLDVOLCTRLSTS_UB:
        /* Initial codification of the signal sig_SldVolCtrlSts_UB */
        frm_swtrprivatedhucanfr02[3] &= (((uint8_t)0xFF) - (((uint8_t)1) << ((uint8_t)1)));
        frm_swtrprivatedhucanfr02[3] |= ((((uint8_t *)data_ref)[0] & ((uint8_t)1)) << ((uint8_t)1));
        break;
    case SIG_SLDVOLCTRLSTS:
        /* Initial codification of the signal sig_SldVolCtrlSts */
        frm_swtrprivatedhucanfr02[3] &= (((uint8_t)0xFF) - (((uint8_t)7) << ((uint8_t)2)));
        frm_swtrprivatedhucanfr02[3] |= ((((uint8_t *)data_ref)[0] & ((uint8_t)7)) << ((uint8_t)2));
        break;
    case SIG_RIMFCTACTSGUP_UB:
        /* Initial codification of the signal sig_RiMFctActSgUp_UB */
        frm_swtrprivatedhucanfr02[1] &= (((uint8_t)0xFF) - (((uint8_t)1) << ((uint8_t)2)));
        frm_swtrprivatedhucanfr02[1] |= ((((uint8_t *)data_ref)[0] & ((uint8_t)1)) << ((uint8_t)2));
        break;
    case SIG_RIMFCTACTSGUP:
        /* Initial codification of the signal sig_RiMFctActSgUp */
        frm_swtrprivatedhucanfr02[1] &= (((uint8_t)0xFF) - (((uint8_t)3) << ((uint8_t)3)));
        frm_swtrprivatedhucanfr02[1] |= ((((uint8_t *)data_ref)[0] & ((uint8_t)3)) << ((uint8_t)3));
        break;
    case SIG_RIMFCTACTSGRI_UB:
        /* Initial codification of the signal sig_RiMFctActSgRi_UB */
        frm_swtrprivatedhucanfr02[1] &= (((uint8_t)0xFF) - (((uint8_t)1) << ((uint8_t)5)));
        frm_swtrprivatedhucanfr02[1] |= ((((uint8_t *)data_ref)[0] & ((uint8_t)1)) << ((uint8_t)5));
        break;
    case SIG_RIMFCTACTSGRI:
        /* Initial codification of the signal sig_RiMFctActSgRi */
        frm_swtrprivatedhucanfr02[1] &= (((uint8_t)0xFF) - (((uint8_t)3) << ((uint8_t)6)));
        frm_swtrprivatedhucanfr02[1] |= ((((uint8_t *)data_ref)[0] & ((uint8_t)3)) << ((uint8_t)6));
        break;
    case SIG_RIMFCTACTSGLE_UB:
        /* Initial codification of the signal sig_RiMFctActSgLe_UB */
        frm_swtrprivatedhucanfr02[1] &= (((uint8_t)0xFF) - (((uint8_t)1)));
        frm_swtrprivatedhucanfr02[1] |= ((((uint8_t *)data_ref)[0] & ((uint8_t)1)));
        break;
    case SIG_RIMFCTACTSGLE:
        /* Initial codification of the signal sig_RiMFctActSgLe */
        frm_swtrprivatedhucanfr02[0] &= (((uint8_t)0xFF) - (((uint8_t)3)));
        frm_swtrprivatedhucanfr02[0] |= ((((uint8_t *)data_ref)[0] & ((uint8_t)3)));
        break;
    case SIG_RIMFCTACTSGDN_UB:
        /* Initial codification of the signal sig_RiMFctActSgDn_UB */
        frm_swtrprivatedhucanfr02[0] &= (((uint8_t)0xFF) - (((uint8_t)1) << ((uint8_t)2)));
        frm_swtrprivatedhucanfr02[0] |= ((((uint8_t *)data_ref)[0] & ((uint8_t)1)) << ((uint8_t)2));
        break;
    case SIG_RIMFCTACTSGDN:
        /* Initial codification of the signal sig_RiMFctActSgDn */
        frm_swtrprivatedhucanfr02[0] &= (((uint8_t)0xFF) - (((uint8_t)3) << ((uint8_t)3)));
        frm_swtrprivatedhucanfr02[0] |= ((((uint8_t *)data_ref)[0] & ((uint8_t)3)) << ((uint8_t)3));
        break;
    case SIG_RIMFCTACTSGCE_UB:
        /* Initial codification of the signal sig_RiMFctActSgCe_UB */
        frm_swtrprivatedhucanfr02[0] &= (((uint8_t)0xFF) - (((uint8_t)1) << ((uint8_t)5)));
        frm_swtrprivatedhucanfr02[0] |= ((((uint8_t *)data_ref)[0] & ((uint8_t)1)) << ((uint8_t)5));
        break;
    case SIG_RIMFCTACTSGCE:
        /* Initial codification of the signal sig_RiMFctActSgCe */
        frm_swtrprivatedhucanfr02[0] &= (((uint8_t)0xFF) - (((uint8_t)3) << ((uint8_t)6)));
        frm_swtrprivatedhucanfr02[0] |= ((((uint8_t *)data_ref)[0] & ((uint8_t)3)) << ((uint8_t)6));
        break;
    case SIG_STEERWHLTOUCHBDRITOUCHPOSNY:
        /* Initial codification of the signal sig_SteerWhlTouchBdRiTouchPosnY */
        frm_swtrprivatedhucanfr01[3] &= (((uint8_t)0xFF) - (((uint8_t)255)));
        frm_swtrprivatedhucanfr01[3] |= ((((uint8_t *)data_ref)[0] & ((uint8_t)255)));
        break;
    case SIG_STEERWHLTOUCHBDRITOUCHPOSNX:
        /* Initial codification of the signal sig_SteerWhlTouchBdRiTouchPosnX */
        frm_swtrprivatedhucanfr01[2] &= (((uint8_t)0xFF) - (((uint8_t)255)));
        frm_swtrprivatedhucanfr01[2] |= ((((uint8_t *)data_ref)[0] & ((uint8_t)255)));
        break;
    case SIG_STEERWHLTOUCHBDRISTEERWHLTOUCHBDSTS:
        /* Initial codification of the signal sig_SteerWhlTouchBdRiSteerWhlTouchBdSts */
        frm_swtrprivatedhucanfr01[0] &= (((uint8_t)0xFF) - (((uint8_t)3) << ((uint8_t)4)));
        frm_swtrprivatedhucanfr01[0] |= ((((uint8_t *)data_ref)[0] & ((uint8_t)3)) << ((uint8_t)4));
        break;
    case SIG_STEERWHLTOUCHBDRICNTR:
        /* Initial codification of the signal sig_SteerWhlTouchBdRiCntr */
        frm_swtrprivatedhucanfr01[0] &= (((uint8_t)0xFF) - (((uint8_t)15)));
        frm_swtrprivatedhucanfr01[0] |= ((((uint8_t *)data_ref)[0] & ((uint8_t)15)));
        break;
    case SIG_STEERWHLTOUCHBDRICHKS:
        /* Initial codification of the signal sig_SteerWhlTouchBdRiChks */
        frm_swtrprivatedhucanfr01[1] &= (((uint8_t)0xFF) - (((uint8_t)255)));
        frm_swtrprivatedhucanfr01[1] |= ((((uint8_t *)data_ref)[0] & ((uint8_t)255)));
        break;
    case SIG_STEERWHLTOUCHBDRI_UB:
        /* Initial codification of the signal sig_SteerWhlTouchBdRi_UB */
        frm_swtrprivatedhucanfr01[0] &= (((uint8_t)0xFF) - (((uint8_t)1) << ((uint8_t)6)));
        frm_swtrprivatedhucanfr01[0] |= ((((uint8_t *)data_ref)[0] & ((uint8_t)1)) << ((uint8_t)6));
        break;
    case SIG_SWTRPRESSBASELINE:
        /* Initial codification of the signal sig_SwtrPressBaseline */
        frm_swtrpressfr01[1] &= (((uint8_t)0xFF) - (((uint8_t)255)));
        frm_swtrpressfr01[1] |= ((((uint8_t *)data_ref)[ENDIAN_BYTE(1, 2)] & ((uint8_t)255)));
        frm_swtrpressfr01[0] &= ((uint8_t)0xFF) - ((uint8_t)255);
        frm_swtrpressfr01[0] |= ((((uint8_t *)data_ref)[ENDIAN_BYTE(0, 2)] & ((uint8_t)255)));
        break;
    case SIG_SWTRPRESSSIGNAL:
        /* Initial codification of the signal sig_SwtrPressSignal */
        frm_swtrpressfr01[3] &= (((uint8_t)0xFF) - (((uint8_t)255)));
        frm_swtrpressfr01[3] |= ((((uint8_t *)data_ref)[ENDIAN_BYTE(1, 2)] & ((uint8_t)255)));
        frm_swtrpressfr01[2] &= ((uint8_t)0xFF) - ((uint8_t)255);
        frm_swtrpressfr01[2] |= ((((uint8_t *)data_ref)[ENDIAN_BYTE(0, 2)] & ((uint8_t)255)));
        break;
    case SIG_SWTRSENSOR1_BASELINE:
        /* Initial codification of the signal sig_SwtRsensor1_baseline */
        frm_swtrsensorfr01[1] &= (((uint8_t)0xFF) - (((uint8_t)255)));
        frm_swtrsensorfr01[1] |= ((((uint8_t *)data_ref)[ENDIAN_BYTE(1, 2)] & ((uint8_t)255)));
        frm_swtrsensorfr01[0] &= ((uint8_t)0xFF) - ((uint8_t)255);
        frm_swtrsensorfr01[0] |= ((((uint8_t *)data_ref)[ENDIAN_BYTE(0, 2)] & ((uint8_t)255)));
        break;
    case SIG_SWTRSENSOR1_SIGNAL:
        /* Initial codification of the signal sig_SwtRSensor1_signal */
        frm_swtrsensorfr01[3] &= (((uint8_t)0xFF) - (((uint8_t)255)));
        frm_swtrsensorfr01[3] |= ((((uint8_t *)data_ref)[ENDIAN_BYTE(1, 2)] & ((uint8_t)255)));
        frm_swtrsensorfr01[2] &= ((uint8_t)0xFF) - ((uint8_t)255);
        frm_swtrsensorfr01[2] |= ((((uint8_t *)data_ref)[ENDIAN_BYTE(0, 2)] & ((uint8_t)255)));
        break;
    case SIG_SWTRSENSOR2_BASELINE:
        /* Initial codification of the signal sig_SwtRsensor2_baseline */
        frm_swtrsensorfr01[5] &= (((uint8_t)0xFF) - (((uint8_t)255)));
        frm_swtrsensorfr01[5] |= ((((uint8_t *)data_ref)[ENDIAN_BYTE(1, 2)] & ((uint8_t)255)));
        frm_swtrsensorfr01[4] &= ((uint8_t)0xFF) - ((uint8_t)255);
        frm_swtrsensorfr01[4] |= ((((uint8_t *)data_ref)[ENDIAN_BYTE(0, 2)] & ((uint8_t)255)));
        break;
    case SIG_SWTRSENSOR2_SIGNAL:
        /* Initial codification of the signal sig_SwtRSensor2_signal */
        frm_swtrsensorfr01[7] &= (((uint8_t)0xFF) - (((uint8_t)255)));
        frm_swtrsensorfr01[7] |= ((((uint8_t *)data_ref)[ENDIAN_BYTE(1, 2)] & ((uint8_t)255)));
        frm_swtrsensorfr01[6] &= ((uint8_t)0xFF) - ((uint8_t)255);
        frm_swtrsensorfr01[6] |= ((((uint8_t *)data_ref)[ENDIAN_BYTE(0, 2)] & ((uint8_t)255)));
        break;
    case SIG_SWTRSENSOR3_BASELINE:
        /* Initial codification of the signal sig_SwtRsensor3_baseline */
        frm_swtrsensorfr02[1] &= (((uint8_t)0xFF) - (((uint8_t)255)));
        frm_swtrsensorfr02[1] |= ((((uint8_t *)data_ref)[ENDIAN_BYTE(1, 2)] & ((uint8_t)255)));
        frm_swtrsensorfr02[0] &= ((uint8_t)0xFF) - ((uint8_t)255);
        frm_swtrsensorfr02[0] |= ((((uint8_t *)data_ref)[ENDIAN_BYTE(0, 2)] & ((uint8_t)255)));
        break;
    case SIG_SWTRSENSOR4_BASELINE:
        /* Initial codification of the signal sig_SwtRsensor4_baseline */
        frm_swtrsensorfr02[3] &= (((uint8_t)0xFF) - (((uint8_t)255)));
        frm_swtrsensorfr02[3] |= ((((uint8_t *)data_ref)[ENDIAN_BYTE(1, 2)] & ((uint8_t)255)));
        frm_swtrsensorfr02[2] &= ((uint8_t)0xFF) - ((uint8_t)255);
        frm_swtrsensorfr02[2] |= ((((uint8_t *)data_ref)[ENDIAN_BYTE(0, 2)] & ((uint8_t)255)));
        break;
    case SIG_SWTRSENSOR3_SIGNAL:
        /* Initial codification of the signal sig_SwtRSensor3_signal */
        frm_swtrsensorfr02[5] &= (((uint8_t)0xFF) - (((uint8_t)255)));
        frm_swtrsensorfr02[5] |= ((((uint8_t *)data_ref)[ENDIAN_BYTE(1, 2)] & ((uint8_t)255)));
        frm_swtrsensorfr02[4] &= ((uint8_t)0xFF) - ((uint8_t)255);
        frm_swtrsensorfr02[4] |= ((((uint8_t *)data_ref)[ENDIAN_BYTE(0, 2)] & ((uint8_t)255)));
        break;
    case SIG_SWTRSENSOR4_SIGNAL:
        /* Initial codification of the signal sig_SwtRSensor4_signal */
        frm_swtrsensorfr02[7] &= (((uint8_t)0xFF) - (((uint8_t)255)));
        frm_swtrsensorfr02[7] |= ((((uint8_t *)data_ref)[ENDIAN_BYTE(1, 2)] & ((uint8_t)255)));
        frm_swtrsensorfr02[6] &= ((uint8_t)0xFF) - ((uint8_t)255);
        frm_swtrsensorfr02[6] |= ((((uint8_t *)data_ref)[ENDIAN_BYTE(0, 2)] & ((uint8_t)255)));
        break;
    case SIG_SWTRSENSOR5_BASELINE:
        /* Initial codification of the signal sig_SwtRsensor5_baseline */
        frm_swtrsensorfr03[1] &= (((uint8_t)0xFF) - (((uint8_t)255)));
        frm_swtrsensorfr03[1] |= ((((uint8_t *)data_ref)[ENDIAN_BYTE(1, 2)] & ((uint8_t)255)));
        frm_swtrsensorfr03[0] &= ((uint8_t)0xFF) - ((uint8_t)255);
        frm_swtrsensorfr03[0] |= ((((uint8_t *)data_ref)[ENDIAN_BYTE(0, 2)] & ((uint8_t)255)));
        break;
    case SIG_SWTRSENSOR6_BASELINE:
        /* Initial codification of the signal sig_SwtRsensor6_baseline */
        frm_swtrsensorfr03[3] &= (((uint8_t)0xFF) - (((uint8_t)255)));
        frm_swtrsensorfr03[3] |= ((((uint8_t *)data_ref)[ENDIAN_BYTE(1, 2)] & ((uint8_t)255)));
        frm_swtrsensorfr03[2] &= ((uint8_t)0xFF) - ((uint8_t)255);
        frm_swtrsensorfr03[2] |= ((((uint8_t *)data_ref)[ENDIAN_BYTE(0, 2)] & ((uint8_t)255)));
        break;
    case SIG_SWTRSENSOR5_SIGNAL:
        /* Initial codification of the signal sig_SwtRSensor5_signal */
        frm_swtrsensorfr03[5] &= (((uint8_t)0xFF) - (((uint8_t)255)));
        frm_swtrsensorfr03[5] |= ((((uint8_t *)data_ref)[ENDIAN_BYTE(1, 2)] & ((uint8_t)255)));
        frm_swtrsensorfr03[4] &= ((uint8_t)0xFF) - ((uint8_t)255);
        frm_swtrsensorfr03[4] |= ((((uint8_t *)data_ref)[ENDIAN_BYTE(0, 2)] & ((uint8_t)255)));
        break;
    case SIG_SWTRSENSOR6_SIGNAL:
        /* Initial codification of the signal sig_SwtRSensor6_signal */
        frm_swtrsensorfr03[7] &= (((uint8_t)0xFF) - (((uint8_t)255)));
        frm_swtrsensorfr03[7] |= ((((uint8_t *)data_ref)[ENDIAN_BYTE(1, 2)] & ((uint8_t)255)));
        frm_swtrsensorfr03[6] &= ((uint8_t)0xFF) - ((uint8_t)255);
        frm_swtrsensorfr03[6] |= ((((uint8_t *)data_ref)[ENDIAN_BYTE(0, 2)] & ((uint8_t)255)));
        break;
    case SIG_SWTRSENSOR7_BASELINE:
        /* Initial codification of the signal sig_SwtRsensor7_baseline */
        frm_swtrsensorfr04[1] &= (((uint8_t)0xFF) - (((uint8_t)255)));
        frm_swtrsensorfr04[1] |= ((((uint8_t *)data_ref)[ENDIAN_BYTE(1, 2)] & ((uint8_t)255)));
        frm_swtrsensorfr04[0] &= ((uint8_t)0xFF) - ((uint8_t)255);
        frm_swtrsensorfr04[0] |= ((((uint8_t *)data_ref)[ENDIAN_BYTE(0, 2)] & ((uint8_t)255)));
        break;
    case SIG_SWTRSENSOR8_BASELINE:
        /* Initial codification of the signal sig_SwtRsensor8_baseline */
        frm_swtrsensorfr04[3] &= (((uint8_t)0xFF) - (((uint8_t)255)));
        frm_swtrsensorfr04[3] |= ((((uint8_t *)data_ref)[ENDIAN_BYTE(1, 2)] & ((uint8_t)255)));
        frm_swtrsensorfr04[2] &= ((uint8_t)0xFF) - ((uint8_t)255);
        frm_swtrsensorfr04[2] |= ((((uint8_t *)data_ref)[ENDIAN_BYTE(0, 2)] & ((uint8_t)255)));
        break;
    case SIG_SWTRSENSOR7_SIGNAL:
        /* Initial codification of the signal sig_SwtRSensor7_signal */
        frm_swtrsensorfr04[5] &= (((uint8_t)0xFF) - (((uint8_t)255)));
        frm_swtrsensorfr04[5] |= ((((uint8_t *)data_ref)[ENDIAN_BYTE(1, 2)] & ((uint8_t)255)));
        frm_swtrsensorfr04[4] &= ((uint8_t)0xFF) - ((uint8_t)255);
        frm_swtrsensorfr04[4] |= ((((uint8_t *)data_ref)[ENDIAN_BYTE(0, 2)] & ((uint8_t)255)));
        break;
    case SIG_SWTRSENSOR8_SIGNAL:
        /* Initial codification of the signal sig_SwtRSensor8_signal */
        frm_swtrsensorfr04[7] &= (((uint8_t)0xFF) - (((uint8_t)255)));
        frm_swtrsensorfr04[7] |= ((((uint8_t *)data_ref)[ENDIAN_BYTE(1, 2)] & ((uint8_t)255)));
        frm_swtrsensorfr04[6] &= ((uint8_t)0xFF) - ((uint8_t)255);
        frm_swtrsensorfr04[6] |= ((((uint8_t *)data_ref)[ENDIAN_BYTE(0, 2)] & ((uint8_t)255)));
        break;
    case SIG_SWTRSENSOR9_BASELINE:
        /* Initial codification of the signal sig_SwtRsensor9_baseline */
        frm_swtrsensorfr05[1] &= (((uint8_t)0xFF) - (((uint8_t)255)));
        frm_swtrsensorfr05[1] |= ((((uint8_t *)data_ref)[ENDIAN_BYTE(1, 2)] & ((uint8_t)255)));
        frm_swtrsensorfr05[0] &= ((uint8_t)0xFF) - ((uint8_t)255);
        frm_swtrsensorfr05[0] |= ((((uint8_t *)data_ref)[ENDIAN_BYTE(0, 2)] & ((uint8_t)255)));
        break;
    case SIG_SWTRSENSOR10_BASELINE:
        /* Initial codification of the signal sig_SwtRsensor10_baseline */
        frm_swtrsensorfr05[3] &= (((uint8_t)0xFF) - (((uint8_t)255)));
        frm_swtrsensorfr05[3] |= ((((uint8_t *)data_ref)[ENDIAN_BYTE(1, 2)] & ((uint8_t)255)));
        frm_swtrsensorfr05[2] &= ((uint8_t)0xFF) - ((uint8_t)255);
        frm_swtrsensorfr05[2] |= ((((uint8_t *)data_ref)[ENDIAN_BYTE(0, 2)] & ((uint8_t)255)));
        break;
    case SIG_SWTRSENSOR9_SIGNAL:
        /* Initial codification of the signal sig_SwtRSensor9_signal */
        frm_swtrsensorfr05[5] &= (((uint8_t)0xFF) - (((uint8_t)255)));
        frm_swtrsensorfr05[5] |= ((((uint8_t *)data_ref)[ENDIAN_BYTE(1, 2)] & ((uint8_t)255)));
        frm_swtrsensorfr05[4] &= ((uint8_t)0xFF) - ((uint8_t)255);
        frm_swtrsensorfr05[4] |= ((((uint8_t *)data_ref)[ENDIAN_BYTE(0, 2)] & ((uint8_t)255)));
        break;
    case SIG_SWTRSENSOR10_SIGNAL:
        /* Initial codification of the signal sig_SwtRSensor10_signal */
        frm_swtrsensorfr05[7] &= (((uint8_t)0xFF) - (((uint8_t)255)));
        frm_swtrsensorfr05[7] |= ((((uint8_t *)data_ref)[ENDIAN_BYTE(1, 2)] & ((uint8_t)255)));
        frm_swtrsensorfr05[6] &= ((uint8_t)0xFF) - ((uint8_t)255);
        frm_swtrsensorfr05[6] |= ((((uint8_t *)data_ref)[ENDIAN_BYTE(0, 2)] & ((uint8_t)255)));
        break;
    case SIG_SWTRSENSOR11_BASELINE:
        /* Initial codification of the signal sig_SwtRsensor11_baseline */
        frm_swtrsensorfr06[1] &= (((uint8_t)0xFF) - (((uint8_t)255)));
        frm_swtrsensorfr06[1] |= ((((uint8_t *)data_ref)[ENDIAN_BYTE(1, 2)] & ((uint8_t)255)));
        frm_swtrsensorfr06[0] &= ((uint8_t)0xFF) - ((uint8_t)255);
        frm_swtrsensorfr06[0] |= ((((uint8_t *)data_ref)[ENDIAN_BYTE(0, 2)] & ((uint8_t)255)));
        break;
    case SIG_SWTRSENSOR12_BASELINE:
        /* Initial codification of the signal sig_SwtRsensor12_baseline */
        frm_swtrsensorfr06[3] &= (((uint8_t)0xFF) - (((uint8_t)255)));
        frm_swtrsensorfr06[3] |= ((((uint8_t *)data_ref)[ENDIAN_BYTE(1, 2)] & ((uint8_t)255)));
        frm_swtrsensorfr06[2] &= ((uint8_t)0xFF) - ((uint8_t)255);
        frm_swtrsensorfr06[2] |= ((((uint8_t *)data_ref)[ENDIAN_BYTE(0, 2)] & ((uint8_t)255)));
        break;
    case SIG_SWTRSENSOR11_SIGNAL:
        /* Initial codification of the signal sig_SwtRSensor11_signal */
        frm_swtrsensorfr06[5] &= (((uint8_t)0xFF) - (((uint8_t)255)));
        frm_swtrsensorfr06[5] |= ((((uint8_t *)data_ref)[ENDIAN_BYTE(1, 2)] & ((uint8_t)255)));
        frm_swtrsensorfr06[4] &= ((uint8_t)0xFF) - ((uint8_t)255);
        frm_swtrsensorfr06[4] |= ((((uint8_t *)data_ref)[ENDIAN_BYTE(0, 2)] & ((uint8_t)255)));
        break;
    case SIG_SWTRSENSOR12_SIGNAL:
        /* Initial codification of the signal sig_SwtRSensor12_signal */
        frm_swtrsensorfr06[7] &= (((uint8_t)0xFF) - (((uint8_t)255)));
        frm_swtrsensorfr06[7] |= ((((uint8_t *)data_ref)[ENDIAN_BYTE(1, 2)] & ((uint8_t)255)));
        frm_swtrsensorfr06[6] &= ((uint8_t)0xFF) - ((uint8_t)255);
        frm_swtrsensorfr06[6] |= ((((uint8_t *)data_ref)[ENDIAN_BYTE(0, 2)] & ((uint8_t)255)));
        break;
    case SIG_SWTRSENSOR13_BASELINE:
        /* Initial codification of the signal sig_SwtRsensor13_baseline */
        frm_swtrsensorfr07[1] &= (((uint8_t)0xFF) - (((uint8_t)255)));
        frm_swtrsensorfr07[1] |= ((((uint8_t *)data_ref)[ENDIAN_BYTE(1, 2)] & ((uint8_t)255)));
        frm_swtrsensorfr07[0] &= ((uint8_t)0xFF) - ((uint8_t)255);
        frm_swtrsensorfr07[0] |= ((((uint8_t *)data_ref)[ENDIAN_BYTE(0, 2)] & ((uint8_t)255)));
        break;
    case SIG_SWTRSENSOR14_BASELINE:
        /* Initial codification of the signal sig_SwtRsensor14_baseline */
        frm_swtrsensorfr07[3] &= (((uint8_t)0xFF) - (((uint8_t)255)));
        frm_swtrsensorfr07[3] |= ((((uint8_t *)data_ref)[ENDIAN_BYTE(1, 2)] & ((uint8_t)255)));
        frm_swtrsensorfr07[2] &= ((uint8_t)0xFF) - ((uint8_t)255);
        frm_swtrsensorfr07[2] |= ((((uint8_t *)data_ref)[ENDIAN_BYTE(0, 2)] & ((uint8_t)255)));
        break;
    case SIG_SWTRSENSOR13_SIGNAL:
        /* Initial codification of the signal sig_SwtRSensor13_signal */
        frm_swtrsensorfr07[5] &= (((uint8_t)0xFF) - (((uint8_t)255)));
        frm_swtrsensorfr07[5] |= ((((uint8_t *)data_ref)[ENDIAN_BYTE(1, 2)] & ((uint8_t)255)));
        frm_swtrsensorfr07[4] &= ((uint8_t)0xFF) - ((uint8_t)255);
        frm_swtrsensorfr07[4] |= ((((uint8_t *)data_ref)[ENDIAN_BYTE(0, 2)] & ((uint8_t)255)));
        break;
    case SIG_SWTRSENSOR14_SIGNAL:
        /* Initial codification of the signal sig_SwtRSensor14_signal */
        frm_swtrsensorfr07[7] &= (((uint8_t)0xFF) - (((uint8_t)255)));
        frm_swtrsensorfr07[7] |= ((((uint8_t *)data_ref)[ENDIAN_BYTE(1, 2)] & ((uint8_t)255)));
        frm_swtrsensorfr07[6] &= ((uint8_t)0xFF) - ((uint8_t)255);
        frm_swtrsensorfr07[6] |= ((((uint8_t *)data_ref)[ENDIAN_BYTE(0, 2)] & ((uint8_t)255)));
        break;
    case SIG_SWTRSENSOR15_BASELINE:
        /* Initial codification of the signal sig_SwtRsensor15_baseline */
        frm_swtrsensorfr08[1] &= (((uint8_t)0xFF) - (((uint8_t)255)));
        frm_swtrsensorfr08[1] |= ((((uint8_t *)data_ref)[ENDIAN_BYTE(1, 2)] & ((uint8_t)255)));
        frm_swtrsensorfr08[0] &= ((uint8_t)0xFF) - ((uint8_t)255);
        frm_swtrsensorfr08[0] |= ((((uint8_t *)data_ref)[ENDIAN_BYTE(0, 2)] & ((uint8_t)255)));
        break;
    case SIG_SWTRSENSOR16_BASELINE:
        /* Initial codification of the signal sig_SwtRsensor16_baseline */
        frm_swtrsensorfr08[3] &= (((uint8_t)0xFF) - (((uint8_t)255)));
        frm_swtrsensorfr08[3] |= ((((uint8_t *)data_ref)[ENDIAN_BYTE(1, 2)] & ((uint8_t)255)));
        frm_swtrsensorfr08[2] &= ((uint8_t)0xFF) - ((uint8_t)255);
        frm_swtrsensorfr08[2] |= ((((uint8_t *)data_ref)[ENDIAN_BYTE(0, 2)] & ((uint8_t)255)));
        break;
    case SIG_SWTRSENSOR15_SIGNAL:
        /* Initial codification of the signal sig_SwtRSensor15_signal */
        frm_swtrsensorfr08[5] &= (((uint8_t)0xFF) - (((uint8_t)255)));
        frm_swtrsensorfr08[5] |= ((((uint8_t *)data_ref)[ENDIAN_BYTE(1, 2)] & ((uint8_t)255)));
        frm_swtrsensorfr08[4] &= ((uint8_t)0xFF) - ((uint8_t)255);
        frm_swtrsensorfr08[4] |= ((((uint8_t *)data_ref)[ENDIAN_BYTE(0, 2)] & ((uint8_t)255)));
        break;
    case SIG_SWTRSENSOR16_SIGNAL:
        /* Initial codification of the signal sig_SwtRSensor16_signal */
        frm_swtrsensorfr08[7] &= (((uint8_t)0xFF) - (((uint8_t)255)));
        frm_swtrsensorfr08[7] |= ((((uint8_t *)data_ref)[ENDIAN_BYTE(1, 2)] & ((uint8_t)255)));
        frm_swtrsensorfr08[6] &= ((uint8_t)0xFF) - ((uint8_t)255);
        frm_swtrsensorfr08[6] |= ((((uint8_t *)data_ref)[ENDIAN_BYTE(0, 2)] & ((uint8_t)255)));
        break;
    case SIG_DIAGNOSTICREQSWTR:
        /* Initialization of signal sig_DiagnosticReqSWTR */
        sig_diagnosticreqswtr[0] = ((UI_8 *)data_ref)[0];
        sig_diagnosticreqswtr[1] = ((UI_8 *)data_ref)[1];
        sig_diagnosticreqswtr[2] = ((UI_8 *)data_ref)[2];
        sig_diagnosticreqswtr[3] = ((UI_8 *)data_ref)[3];
        sig_diagnosticreqswtr[4] = ((UI_8 *)data_ref)[4];
        sig_diagnosticreqswtr[5] = ((UI_8 *)data_ref)[5];
        sig_diagnosticreqswtr[6] = ((UI_8 *)data_ref)[6];
        sig_diagnosticreqswtr[7] = ((UI_8 *)data_ref)[7];
        sig_len_diagnosticreqswtr = MAX_LEN_SIG_DIAGNOSTICREQSWTR;
        break;
    case SIG_DIAGNOSTICFUNCADDRREQ:
        /* Initialization of signal sig_DiagnosticFuncAddrReq */
        sig_diagnosticfuncaddrreq[0] = ((UI_8 *)data_ref)[0];
        sig_diagnosticfuncaddrreq[1] = ((UI_8 *)data_ref)[1];
        sig_diagnosticfuncaddrreq[2] = ((UI_8 *)data_ref)[2];
        sig_diagnosticfuncaddrreq[3] = ((UI_8 *)data_ref)[3];
        sig_diagnosticfuncaddrreq[4] = ((UI_8 *)data_ref)[4];
        sig_diagnosticfuncaddrreq[5] = ((UI_8 *)data_ref)[5];
        sig_diagnosticfuncaddrreq[6] = ((UI_8 *)data_ref)[6];
        sig_diagnosticfuncaddrreq[7] = ((UI_8 *)data_ref)[7];
        sig_len_diagnosticfuncaddrreq = MAX_LEN_SIG_DIAGNOSTICFUNCADDRREQ;
        break;
    case SIG_DIAGNOSTICRESPSWTR:
        /* Initial codification of the signal sig_DiagnosticRespSWTR */
        frm_diag_physresp_swtr[0] &= (((UI_8)0xFF) - (((UI_8)255)));
        frm_diag_physresp_swtr[0] |= ((((UI_8 *)data_ref)[0] & ((UI_8)255)));
        frm_diag_physresp_swtr[1] = ((UI_8)0);
        frm_diag_physresp_swtr[1] |= (((UI_8 *)data_ref)[1]);
        frm_diag_physresp_swtr[2] = ((UI_8)0);
        frm_diag_physresp_swtr[2] |= (((UI_8 *)data_ref)[2]);
        frm_diag_physresp_swtr[3] = ((UI_8)0);
        frm_diag_physresp_swtr[3] |= (((UI_8 *)data_ref)[3]);
        frm_diag_physresp_swtr[4] = ((UI_8)0);
        frm_diag_physresp_swtr[4] |= (((UI_8 *)data_ref)[4]);
        frm_diag_physresp_swtr[5] = ((UI_8)0);
        frm_diag_physresp_swtr[5] |= (((UI_8 *)data_ref)[5]);
        frm_diag_physresp_swtr[6] = ((UI_8)0);
        frm_diag_physresp_swtr[6] |= (((UI_8 *)data_ref)[6]);
        frm_diag_physresp_swtr[7] &= ((UI_8)0xFF) - ((UI_8)255);
        frm_diag_physresp_swtr[7] |= ((((UI_8 *)data_ref)[7] & ((UI_8)255)));
        /* Set of signal length */
        len_frm_diag_physresp_swtr = MAX_LEN_FRM_DIAG_PHYSRESP_SWTR;
        break;
    default:
        status = E_COM_ID;
        break;
    }
    /* Mutual exclusive access end */
    // ResumeAllInterrupts();
    return status;
}

/*---------------------------------------------------------------------------
| Portability:  Target platform independent
|----------------------------------------------------------------------------
| Routine description:
|  * Consult service for the flag of COM traffic.
|---------------------------------------------------------------------------
| Parameters description:
|  return:
|     COM_FALSE if has not been detected any communication activity since
|               last clear
|     COM_TRUE  if has been detected communication activity since last clear
/---------------------------------------------------------------------------*/
t_flag_value ReadFlagComTrafficSWTR(void)
{
    return com_traffic_swtr;
}

/*---------------------------------------------------------------------------
| Portability:  Target platform independent
|----------------------------------------------------------------------------
| Routine description:
|  * Reset service for the flag of COM traffic.
|---------------------------------------------------------------------------
| Parameters description:
/---------------------------------------------------------------------------*/
void ResetFlagComTrafficSWTR(void)
{
    com_traffic_swtr = COM_FALSE;
}

/*---------------------------------------------------------------------------
| Portability:  Target platform independent
|----------------------------------------------------------------------------
| Routine description:
|  * Consult service to retrieve the state of class 1 (RxNotif),
|    class 3 (Rx_ErrorNotif), class 2 (TxNotif) and class 4 (Tx_ErrorNotif) flags
|---------------------------------------------------------------------------
| Parameters description:
|   message: Identification of the signal.
|   return:
|     COM_FALSE if the flag is down
|     COM_TRUE  if the flag is up
/---------------------------------------------------------------------------*/
t_flag_value ReadFlagTxSig(t_symbolic_name message)
{
    t_flag_value result;
    switch (message)
    {
    case SIG_DIAGCFAILRTOUCHPANSWTRVIBRATIONFLTSTS:
        result = ReadFlagTxSigDiagcFailrTouchPanSWTRVibrationFltSts();
        break;
    case SIG_DIAGCFAILRTOUCHPANSWTRTOUCHDFLTSTS:
        result = ReadFlagTxSigDiagcFailrTouchPanSWTRTouchdFltSts();
        break;
    case SIG_DIAGCFAILRTOUCHPANSWTRSNSRFLTSTS:
        result = ReadFlagTxSigDiagcFailrTouchPanSWTRSnsrFltSts();
        break;
    case SIG_DIAGCFAILRTOUCHPANSWTRCMNFLTSTS:
        result = ReadFlagTxSigDiagcFailrTouchPanSWTRCmnFltSts();
        break;
    case SIG_DIAGCFAILRTOUCHPANSWTR_UB:
        result = ReadFlagTxSigDiagcFailrTouchPanSWTR_UB();
        break;
    case SIG_SWTRSERNONR4:
        result = ReadFlagTxSigSWTRSerNoNr4();
        break;
    case SIG_SWTRSERNONR3:
        result = ReadFlagTxSigSWTRSerNoNr3();
        break;
    case SIG_SWTRSERNONR2:
        result = ReadFlagTxSigSWTRSerNoNr2();
        break;
    case SIG_SWTRSERNONR1:
        result = ReadFlagTxSigSWTRSerNoNr1();
        break;
    case SIG_SWTRSERNO_UB:
        result = ReadFlagTxSigSWTRSerNo_UB();
        break;
    case SIG_SWTRPARTNOCMPLNR4:
        result = ReadFlagTxSigSWTRPartNoCmplNr4();
        break;
    case SIG_SWTRPARTNOCMPLNR3:
        result = ReadFlagTxSigSWTRPartNoCmplNr3();
        break;
    case SIG_SWTRPARTNOCMPLNR2:
        result = ReadFlagTxSigSWTRPartNoCmplNr2();
        break;
    case SIG_SWTRPARTNOCMPLNR1:
        result = ReadFlagTxSigSWTRPartNoCmplNr1();
        break;
    case SIG_SWTRPARTNOCMPLENDSGN3:
        result = ReadFlagTxSigSWTRPartNoCmplEndSgn3();
        break;
    case SIG_SWTRPARTNOCMPLENDSGN2:
        result = ReadFlagTxSigSWTRPartNoCmplEndSgn2();
        break;
    case SIG_SWTRPARTNOCMPLENDSGN1:
        result = ReadFlagTxSigSWTRPartNoCmplEndSgn1();
        break;
    case SIG_SWTRPARTNOCMPL_UB:
        result = ReadFlagTxSigSWTRPartNoCmpl_UB();
        break;
    case SIG_SWTRPARTNO10CMPLNR5:
        result = ReadFlagTxSigSWTRPartNo10CmplNr5();
        break;
    case SIG_SWTRPARTNO10CMPLNR4:
        result = ReadFlagTxSigSWTRPartNo10CmplNr4();
        break;
    case SIG_SWTRPARTNO10CMPLNR3:
        result = ReadFlagTxSigSWTRPartNo10CmplNr3();
        break;
    case SIG_SWTRPARTNO10CMPLNR2:
        result = ReadFlagTxSigSWTRPartNo10CmplNr2();
        break;
    case SIG_SWTRPARTNO10CMPLNR1:
        result = ReadFlagTxSigSWTRPartNo10CmplNr1();
        break;
    case SIG_SWTRPARTNO10CMPLENDSGN3:
        result = ReadFlagTxSigSWTRPartNo10CmplEndSgn3();
        break;
    case SIG_SWTRPARTNO10CMPLENDSGN2:
        result = ReadFlagTxSigSWTRPartNo10CmplEndSgn2();
        break;
    case SIG_SWTRPARTNO10CMPLENDSGN1:
        result = ReadFlagTxSigSWTRPartNo10CmplEndSgn1();
        break;
    case SIG_SWPUPDWNSTSRI_UB:
        result = ReadFlagTxSigSwpUpDwnStsRi_UB();
        break;
    case SIG_SWPUPDWNSTSRI:
        result = ReadFlagTxSigSwpUpDwnStsRi();
        break;
    case SIG_SWPLERISTSRI_UB:
        result = ReadFlagTxSigSwpLeRiStsRi_UB();
        break;
    case SIG_SWPLERISTSRI:
        result = ReadFlagTxSigSwpLeRiStsRi();
        break;
    case SIG_STEERWHLTOUCHBDVOICE_UB:
        result = ReadFlagTxSigSteerWhlTouchBdVoice_UB();
        break;
    case SIG_STEERWHLTOUCHBDVOICE:
        result = ReadFlagTxSigSteerWhlTouchBdVoice();
        break;
    case SIG_STEERWHLTOUCHBDMENU_UB:
        result = ReadFlagTxSigSteerWhlTouchBdMenu_UB();
        break;
    case SIG_STEERWHLTOUCHBDMENU:
        result = ReadFlagTxSigSteerWhlTouchBdMenu();
        break;
    case SIG_STEERWHLTOUCHBDDN_UB:
        result = ReadFlagTxSigSteerWhlTouchBdDn_UB();
        break;
    case SIG_STEERWHLTOUCHBDDN:
        result = ReadFlagTxSigSteerWhlTouchBdDn();
        break;
    case SIG_SLDVOLCTRLSTS_UB:
        result = ReadFlagTxSigSldVolCtrlSts_UB();
        break;
    case SIG_SLDVOLCTRLSTS:
        result = ReadFlagTxSigSldVolCtrlSts();
        break;
    case SIG_RIMFCTACTSGUP_UB:
        result = ReadFlagTxSigRiMFctActSgUp_UB();
        break;
    case SIG_RIMFCTACTSGUP:
        result = ReadFlagTxSigRiMFctActSgUp();
        break;
    case SIG_RIMFCTACTSGRI_UB:
        result = ReadFlagTxSigRiMFctActSgRi_UB();
        break;
    case SIG_RIMFCTACTSGRI:
        result = ReadFlagTxSigRiMFctActSgRi();
        break;
    case SIG_RIMFCTACTSGLE_UB:
        result = ReadFlagTxSigRiMFctActSgLe_UB();
        break;
    case SIG_RIMFCTACTSGLE:
        result = ReadFlagTxSigRiMFctActSgLe();
        break;
    case SIG_RIMFCTACTSGDN_UB:
        result = ReadFlagTxSigRiMFctActSgDn_UB();
        break;
    case SIG_RIMFCTACTSGDN:
        result = ReadFlagTxSigRiMFctActSgDn();
        break;
    case SIG_RIMFCTACTSGCE_UB:
        result = ReadFlagTxSigRiMFctActSgCe_UB();
        break;
    case SIG_RIMFCTACTSGCE:
        result = ReadFlagTxSigRiMFctActSgCe();
        break;
    case SIG_STEERWHLTOUCHBDRITOUCHPOSNY:
        result = ReadFlagTxSigSteerWhlTouchBdRiTouchPosnY();
        break;
    case SIG_STEERWHLTOUCHBDRITOUCHPOSNX:
        result = ReadFlagTxSigSteerWhlTouchBdRiTouchPosnX();
        break;
    case SIG_STEERWHLTOUCHBDRISTEERWHLTOUCHBDSTS:
        result = ReadFlagTxSigSteerWhlTouchBdRiSteerWhlTouchBdSts();
        break;
    case SIG_STEERWHLTOUCHBDRICNTR:
        result = ReadFlagTxSigSteerWhlTouchBdRiCntr();
        break;
    case SIG_STEERWHLTOUCHBDRICHKS:
        result = ReadFlagTxSigSteerWhlTouchBdRiChks();
        break;
    case SIG_STEERWHLTOUCHBDRI_UB:
        result = ReadFlagTxSigSteerWhlTouchBdRi_UB();
        break;
    case SIG_DIAGNOSTICRESPSWTR:
        result = ReadFlagTxSigDiagnosticRespSWTR();
        break;
    default:
        result = COM_FALSE;
        break;
    }
    return result;
}

t_flag_value ReadFlagTxSigDiagcFailrTouchPanSWTRVibrationFltSts(void)
{
    return (((flag_tx0 & ((uint8_t)0x01)) > ((uint8_t)0)) ? COM_TRUE : COM_FALSE);
}

t_flag_value ReadFlagTxSigDiagcFailrTouchPanSWTRTouchdFltSts(void)
{
    return (((flag_tx0 & ((uint8_t)0x02)) > ((uint8_t)0)) ? COM_TRUE : COM_FALSE);
}

t_flag_value ReadFlagTxSigDiagcFailrTouchPanSWTRSnsrFltSts(void)
{
    return (((flag_tx0 & ((uint8_t)0x04)) > ((uint8_t)0)) ? COM_TRUE : COM_FALSE);
}

t_flag_value ReadFlagTxSigDiagcFailrTouchPanSWTRCmnFltSts(void)
{
    return (((flag_tx0 & ((uint8_t)0x08)) > ((uint8_t)0)) ? COM_TRUE : COM_FALSE);
}

t_flag_value ReadFlagTxSigDiagcFailrTouchPanSWTR_UB(void)
{
    return (((flag_tx0 & ((uint8_t)0x10)) > ((uint8_t)0)) ? COM_TRUE : COM_FALSE);
}

t_flag_value ReadFlagTxSigSWTRSerNoNr4(void)
{
    return (((flag_tx0 & ((uint8_t)0x20)) > ((uint8_t)0)) ? COM_TRUE : COM_FALSE);
}

t_flag_value ReadFlagTxSigSWTRSerNoNr3(void)
{
    return (((flag_tx0 & ((uint8_t)0x40)) > ((uint8_t)0)) ? COM_TRUE : COM_FALSE);
}

t_flag_value ReadFlagTxSigSWTRSerNoNr2(void)
{
    return (((flag_tx0 & ((uint8_t)0x80)) > ((uint8_t)0)) ? COM_TRUE : COM_FALSE);
}

t_flag_value ReadFlagTxSigSWTRSerNoNr1(void)
{
    return (((flag_tx1 & ((uint8_t)0x01)) > ((uint8_t)0)) ? COM_TRUE : COM_FALSE);
}

t_flag_value ReadFlagTxSigSWTRSerNo_UB(void)
{
    return (((flag_tx1 & ((uint8_t)0x02)) > ((uint8_t)0)) ? COM_TRUE : COM_FALSE);
}

t_flag_value ReadFlagTxSigSWTRPartNoCmplNr4(void)
{
    return (((flag_tx1 & ((uint8_t)0x04)) > ((uint8_t)0)) ? COM_TRUE : COM_FALSE);
}

t_flag_value ReadFlagTxSigSWTRPartNoCmplNr3(void)
{
    return (((flag_tx1 & ((uint8_t)0x08)) > ((uint8_t)0)) ? COM_TRUE : COM_FALSE);
}

t_flag_value ReadFlagTxSigSWTRPartNoCmplNr2(void)
{
    return (((flag_tx1 & ((uint8_t)0x10)) > ((uint8_t)0)) ? COM_TRUE : COM_FALSE);
}

t_flag_value ReadFlagTxSigSWTRPartNoCmplNr1(void)
{
    return (((flag_tx1 & ((uint8_t)0x20)) > ((uint8_t)0)) ? COM_TRUE : COM_FALSE);
}

t_flag_value ReadFlagTxSigSWTRPartNoCmplEndSgn3(void)
{
    return (((flag_tx1 & ((uint8_t)0x40)) > ((uint8_t)0)) ? COM_TRUE : COM_FALSE);
}

t_flag_value ReadFlagTxSigSWTRPartNoCmplEndSgn2(void)
{
    return (((flag_tx1 & ((uint8_t)0x80)) > ((uint8_t)0)) ? COM_TRUE : COM_FALSE);
}

t_flag_value ReadFlagTxSigSWTRPartNoCmplEndSgn1(void)
{
    return (((flag_tx2 & ((uint8_t)0x01)) > ((uint8_t)0)) ? COM_TRUE : COM_FALSE);
}

t_flag_value ReadFlagTxSigSWTRPartNoCmpl_UB(void)
{
    return (((flag_tx2 & ((uint8_t)0x02)) > ((uint8_t)0)) ? COM_TRUE : COM_FALSE);
}

t_flag_value ReadFlagTxSigSWTRPartNo10CmplNr5(void)
{
    return (((flag_tx2 & ((uint8_t)0x04)) > ((uint8_t)0)) ? COM_TRUE : COM_FALSE);
}

t_flag_value ReadFlagTxSigSWTRPartNo10CmplNr4(void)
{
    return (((flag_tx2 & ((uint8_t)0x08)) > ((uint8_t)0)) ? COM_TRUE : COM_FALSE);
}

t_flag_value ReadFlagTxSigSWTRPartNo10CmplNr3(void)
{
    return (((flag_tx2 & ((uint8_t)0x10)) > ((uint8_t)0)) ? COM_TRUE : COM_FALSE);
}

t_flag_value ReadFlagTxSigSWTRPartNo10CmplNr2(void)
{
    return (((flag_tx2 & ((uint8_t)0x20)) > ((uint8_t)0)) ? COM_TRUE : COM_FALSE);
}

t_flag_value ReadFlagTxSigSWTRPartNo10CmplNr1(void)
{
    return (((flag_tx2 & ((uint8_t)0x40)) > ((uint8_t)0)) ? COM_TRUE : COM_FALSE);
}

t_flag_value ReadFlagTxSigSWTRPartNo10CmplEndSgn3(void)
{
    return (((flag_tx2 & ((uint8_t)0x80)) > ((uint8_t)0)) ? COM_TRUE : COM_FALSE);
}

t_flag_value ReadFlagTxSigSWTRPartNo10CmplEndSgn2(void)
{
    return (((flag_tx3 & ((uint8_t)0x01)) > ((uint8_t)0)) ? COM_TRUE : COM_FALSE);
}

t_flag_value ReadFlagTxSigSWTRPartNo10CmplEndSgn1(void)
{
    return (((flag_tx3 & ((uint8_t)0x02)) > ((uint8_t)0)) ? COM_TRUE : COM_FALSE);
}

t_flag_value ReadFlagTxSigSwpUpDwnStsRi_UB(void)
{
    return (((flag_tx3 & ((uint8_t)0x04)) > ((uint8_t)0)) ? COM_TRUE : COM_FALSE);
}

t_flag_value ReadFlagTxSigSwpUpDwnStsRi(void)
{
    return (((flag_tx3 & ((uint8_t)0x08)) > ((uint8_t)0)) ? COM_TRUE : COM_FALSE);
}

t_flag_value ReadFlagTxSigSwpLeRiStsRi_UB(void)
{
    return (((flag_tx3 & ((uint8_t)0x10)) > ((uint8_t)0)) ? COM_TRUE : COM_FALSE);
}

t_flag_value ReadFlagTxSigSwpLeRiStsRi(void)
{
    return (((flag_tx3 & ((uint8_t)0x20)) > ((uint8_t)0)) ? COM_TRUE : COM_FALSE);
}

t_flag_value ReadFlagTxSigSteerWhlTouchBdVoice_UB(void)
{
    return (((flag_tx3 & ((uint8_t)0x40)) > ((uint8_t)0)) ? COM_TRUE : COM_FALSE);
}

t_flag_value ReadFlagTxSigSteerWhlTouchBdVoice(void)
{
    return (((flag_tx3 & ((uint8_t)0x80)) > ((uint8_t)0)) ? COM_TRUE : COM_FALSE);
}

t_flag_value ReadFlagTxSigSteerWhlTouchBdMenu_UB(void)
{
    return (((flag_tx4 & ((uint8_t)0x01)) > ((uint8_t)0)) ? COM_TRUE : COM_FALSE);
}

t_flag_value ReadFlagTxSigSteerWhlTouchBdMenu(void)
{
    return (((flag_tx4 & ((uint8_t)0x02)) > ((uint8_t)0)) ? COM_TRUE : COM_FALSE);
}

t_flag_value ReadFlagTxSigSteerWhlTouchBdDn_UB(void)
{
    return (((flag_tx4 & ((uint8_t)0x04)) > ((uint8_t)0)) ? COM_TRUE : COM_FALSE);
}

t_flag_value ReadFlagTxSigSteerWhlTouchBdDn(void)
{
    return (((flag_tx4 & ((uint8_t)0x08)) > ((uint8_t)0)) ? COM_TRUE : COM_FALSE);
}

t_flag_value ReadFlagTxSigSldVolCtrlSts_UB(void)
{
    return (((flag_tx4 & ((uint8_t)0x10)) > ((uint8_t)0)) ? COM_TRUE : COM_FALSE);
}

t_flag_value ReadFlagTxSigSldVolCtrlSts(void)
{
    return (((flag_tx4 & ((uint8_t)0x20)) > ((uint8_t)0)) ? COM_TRUE : COM_FALSE);
}

t_flag_value ReadFlagTxSigRiMFctActSgUp_UB(void)
{
    return (((flag_tx4 & ((uint8_t)0x40)) > ((uint8_t)0)) ? COM_TRUE : COM_FALSE);
}

t_flag_value ReadFlagTxSigRiMFctActSgUp(void)
{
    return (((flag_tx4 & ((uint8_t)0x80)) > ((uint8_t)0)) ? COM_TRUE : COM_FALSE);
}

t_flag_value ReadFlagTxSigRiMFctActSgRi_UB(void)
{
    return (((flag_tx5 & ((uint8_t)0x01)) > ((uint8_t)0)) ? COM_TRUE : COM_FALSE);
}

t_flag_value ReadFlagTxSigRiMFctActSgRi(void)
{
    return (((flag_tx5 & ((uint8_t)0x02)) > ((uint8_t)0)) ? COM_TRUE : COM_FALSE);
}

t_flag_value ReadFlagTxSigRiMFctActSgLe_UB(void)
{
    return (((flag_tx5 & ((uint8_t)0x04)) > ((uint8_t)0)) ? COM_TRUE : COM_FALSE);
}

t_flag_value ReadFlagTxSigRiMFctActSgLe(void)
{
    return (((flag_tx5 & ((uint8_t)0x08)) > ((uint8_t)0)) ? COM_TRUE : COM_FALSE);
}

t_flag_value ReadFlagTxSigRiMFctActSgDn_UB(void)
{
    return (((flag_tx5 & ((uint8_t)0x10)) > ((uint8_t)0)) ? COM_TRUE : COM_FALSE);
}

t_flag_value ReadFlagTxSigRiMFctActSgDn(void)
{
    return (((flag_tx5 & ((uint8_t)0x20)) > ((uint8_t)0)) ? COM_TRUE : COM_FALSE);
}

t_flag_value ReadFlagTxSigRiMFctActSgCe_UB(void)
{
    return (((flag_tx5 & ((uint8_t)0x40)) > ((uint8_t)0)) ? COM_TRUE : COM_FALSE);
}

t_flag_value ReadFlagTxSigRiMFctActSgCe(void)
{
    return (((flag_tx5 & ((uint8_t)0x80)) > ((uint8_t)0)) ? COM_TRUE : COM_FALSE);
}

t_flag_value ReadFlagTxSigSteerWhlTouchBdRiTouchPosnY(void)
{
    return (((flag_tx6 & ((uint8_t)0x01)) > ((uint8_t)0)) ? COM_TRUE : COM_FALSE);
}

t_flag_value ReadFlagTxSigSteerWhlTouchBdRiTouchPosnX(void)
{
    return (((flag_tx6 & ((uint8_t)0x02)) > ((uint8_t)0)) ? COM_TRUE : COM_FALSE);
}

t_flag_value ReadFlagTxSigSteerWhlTouchBdRiSteerWhlTouchBdSts(void)
{
    return (((flag_tx6 & ((uint8_t)0x04)) > ((uint8_t)0)) ? COM_TRUE : COM_FALSE);
}

t_flag_value ReadFlagTxSigSteerWhlTouchBdRiCntr(void)
{
    return (((flag_tx6 & ((uint8_t)0x08)) > ((uint8_t)0)) ? COM_TRUE : COM_FALSE);
}

t_flag_value ReadFlagTxSigSteerWhlTouchBdRiChks(void)
{
    return (((flag_tx6 & ((uint8_t)0x10)) > ((uint8_t)0)) ? COM_TRUE : COM_FALSE);
}

t_flag_value ReadFlagTxSigSteerWhlTouchBdRi_UB(void)
{
    return (((flag_tx6 & ((uint8_t)0x20)) > ((uint8_t)0)) ? COM_TRUE : COM_FALSE);
}

t_flag_value ReadFlagTxSigDiagnosticRespSWTR(void)
{
    return (((flag_tx6 & ((UI_8)0x40)) > ((UI_8)0)) ? COM_TRUE : COM_FALSE);
}

/*---------------------------------------------------------------------------
| Portability:  Target platform independent
|----------------------------------------------------------------------------
| Routine description:
|  * Consult service to retrieve the state of class 1 (RxNotif),
|    class 3 (Rx_ErrorNotif), class 2 (TxNotif) and class 4 (Tx_ErrorNotif) flags
|---------------------------------------------------------------------------
| Parameters description:
|   message: Identification of the signal.
|   return:
|     COM_FALSE if the flag is down
|     COM_TRUE  if the flag is up
/---------------------------------------------------------------------------*/
t_flag_value ReadFlagRxSig(t_symbolic_name message)
{
    t_flag_value result;
    switch (message)
    {
    case SIG_DIAGNOSTICREQSWTR:
        result = ReadFlagRxSigDiagnosticReqSWTR();
        break;
    case SIG_DIAGNOSTICFUNCADDRREQ:
        result = ReadFlagRxSigDiagnosticFuncAddrReq();
        break;
    default:
        result = COM_FALSE;
        break;
    }
    return result;
}

/*---------------------------------------------------------------------------
| Portability:  Target platform independent
|----------------------------------------------------------------------------
| Routine description:
|  * Reset service for the notify class 1 (RxNotif) class 3 (RxErrorNotif)
|    class 2 (TxNotif) and class 4 (TxErrorNotif)
|---------------------------------------------------------------------------
| Parameters description:
|   message: Identification of the signal.
/---------------------------------------------------------------------------*/
void ResetFlagTxSig(t_symbolic_name message)
{
    switch (message)
    {
    case SIG_DIAGCFAILRTOUCHPANSWTRVIBRATIONFLTSTS:
        ResetFlagTxSigDiagcFailrTouchPanSWTRVibrationFltSts();
        break;
    case SIG_DIAGCFAILRTOUCHPANSWTRTOUCHDFLTSTS:
        ResetFlagTxSigDiagcFailrTouchPanSWTRTouchdFltSts();
        break;
    case SIG_DIAGCFAILRTOUCHPANSWTRSNSRFLTSTS:
        ResetFlagTxSigDiagcFailrTouchPanSWTRSnsrFltSts();
        break;
    case SIG_DIAGCFAILRTOUCHPANSWTRCMNFLTSTS:
        ResetFlagTxSigDiagcFailrTouchPanSWTRCmnFltSts();
        break;
    case SIG_DIAGCFAILRTOUCHPANSWTR_UB:
        ResetFlagTxSigDiagcFailrTouchPanSWTR_UB();
        break;
    case SIG_SWTRSERNONR4:
        ResetFlagTxSigSWTRSerNoNr4();
        break;
    case SIG_SWTRSERNONR3:
        ResetFlagTxSigSWTRSerNoNr3();
        break;
    case SIG_SWTRSERNONR2:
        ResetFlagTxSigSWTRSerNoNr2();
        break;
    case SIG_SWTRSERNONR1:
        ResetFlagTxSigSWTRSerNoNr1();
        break;
    case SIG_SWTRSERNO_UB:
        ResetFlagTxSigSWTRSerNo_UB();
        break;
    case SIG_SWTRPARTNOCMPLNR4:
        ResetFlagTxSigSWTRPartNoCmplNr4();
        break;
    case SIG_SWTRPARTNOCMPLNR3:
        ResetFlagTxSigSWTRPartNoCmplNr3();
        break;
    case SIG_SWTRPARTNOCMPLNR2:
        ResetFlagTxSigSWTRPartNoCmplNr2();
        break;
    case SIG_SWTRPARTNOCMPLNR1:
        ResetFlagTxSigSWTRPartNoCmplNr1();
        break;
    case SIG_SWTRPARTNOCMPLENDSGN3:
        ResetFlagTxSigSWTRPartNoCmplEndSgn3();
        break;
    case SIG_SWTRPARTNOCMPLENDSGN2:
        ResetFlagTxSigSWTRPartNoCmplEndSgn2();
        break;
    case SIG_SWTRPARTNOCMPLENDSGN1:
        ResetFlagTxSigSWTRPartNoCmplEndSgn1();
        break;
    case SIG_SWTRPARTNOCMPL_UB:
        ResetFlagTxSigSWTRPartNoCmpl_UB();
        break;
    case SIG_SWTRPARTNO10CMPLNR5:
        ResetFlagTxSigSWTRPartNo10CmplNr5();
        break;
    case SIG_SWTRPARTNO10CMPLNR4:
        ResetFlagTxSigSWTRPartNo10CmplNr4();
        break;
    case SIG_SWTRPARTNO10CMPLNR3:
        ResetFlagTxSigSWTRPartNo10CmplNr3();
        break;
    case SIG_SWTRPARTNO10CMPLNR2:
        ResetFlagTxSigSWTRPartNo10CmplNr2();
        break;
    case SIG_SWTRPARTNO10CMPLNR1:
        ResetFlagTxSigSWTRPartNo10CmplNr1();
        break;
    case SIG_SWTRPARTNO10CMPLENDSGN3:
        ResetFlagTxSigSWTRPartNo10CmplEndSgn3();
        break;
    case SIG_SWTRPARTNO10CMPLENDSGN2:
        ResetFlagTxSigSWTRPartNo10CmplEndSgn2();
        break;
    case SIG_SWTRPARTNO10CMPLENDSGN1:
        ResetFlagTxSigSWTRPartNo10CmplEndSgn1();
        break;
    case SIG_SWPUPDWNSTSRI_UB:
        ResetFlagTxSigSwpUpDwnStsRi_UB();
        break;
    case SIG_SWPUPDWNSTSRI:
        ResetFlagTxSigSwpUpDwnStsRi();
        break;
    case SIG_SWPLERISTSRI_UB:
        ResetFlagTxSigSwpLeRiStsRi_UB();
        break;
    case SIG_SWPLERISTSRI:
        ResetFlagTxSigSwpLeRiStsRi();
        break;
    case SIG_STEERWHLTOUCHBDVOICE_UB:
        ResetFlagTxSigSteerWhlTouchBdVoice_UB();
        break;
    case SIG_STEERWHLTOUCHBDVOICE:
        ResetFlagTxSigSteerWhlTouchBdVoice();
        break;
    case SIG_STEERWHLTOUCHBDMENU_UB:
        ResetFlagTxSigSteerWhlTouchBdMenu_UB();
        break;
    case SIG_STEERWHLTOUCHBDMENU:
        ResetFlagTxSigSteerWhlTouchBdMenu();
        break;
    case SIG_STEERWHLTOUCHBDDN_UB:
        ResetFlagTxSigSteerWhlTouchBdDn_UB();
        break;
    case SIG_STEERWHLTOUCHBDDN:
        ResetFlagTxSigSteerWhlTouchBdDn();
        break;
    case SIG_SLDVOLCTRLSTS_UB:
        ResetFlagTxSigSldVolCtrlSts_UB();
        break;
    case SIG_SLDVOLCTRLSTS:
        ResetFlagTxSigSldVolCtrlSts();
        break;
    case SIG_RIMFCTACTSGUP_UB:
        ResetFlagTxSigRiMFctActSgUp_UB();
        break;
    case SIG_RIMFCTACTSGUP:
        ResetFlagTxSigRiMFctActSgUp();
        break;
    case SIG_RIMFCTACTSGRI_UB:
        ResetFlagTxSigRiMFctActSgRi_UB();
        break;
    case SIG_RIMFCTACTSGRI:
        ResetFlagTxSigRiMFctActSgRi();
        break;
    case SIG_RIMFCTACTSGLE_UB:
        ResetFlagTxSigRiMFctActSgLe_UB();
        break;
    case SIG_RIMFCTACTSGLE:
        ResetFlagTxSigRiMFctActSgLe();
        break;
    case SIG_RIMFCTACTSGDN_UB:
        ResetFlagTxSigRiMFctActSgDn_UB();
        break;
    case SIG_RIMFCTACTSGDN:
        ResetFlagTxSigRiMFctActSgDn();
        break;
    case SIG_RIMFCTACTSGCE_UB:
        ResetFlagTxSigRiMFctActSgCe_UB();
        break;
    case SIG_RIMFCTACTSGCE:
        ResetFlagTxSigRiMFctActSgCe();
        break;
    case SIG_STEERWHLTOUCHBDRITOUCHPOSNY:
        ResetFlagTxSigSteerWhlTouchBdRiTouchPosnY();
        break;
    case SIG_STEERWHLTOUCHBDRITOUCHPOSNX:
        ResetFlagTxSigSteerWhlTouchBdRiTouchPosnX();
        break;
    case SIG_STEERWHLTOUCHBDRISTEERWHLTOUCHBDSTS:
        ResetFlagTxSigSteerWhlTouchBdRiSteerWhlTouchBdSts();
        break;
    case SIG_STEERWHLTOUCHBDRICNTR:
        ResetFlagTxSigSteerWhlTouchBdRiCntr();
        break;
    case SIG_STEERWHLTOUCHBDRICHKS:
        ResetFlagTxSigSteerWhlTouchBdRiChks();
        break;
    case SIG_STEERWHLTOUCHBDRI_UB:
        ResetFlagTxSigSteerWhlTouchBdRi_UB();
        break;
    case SIG_DIAGNOSTICRESPSWTR:
        ResetFlagTxSigDiagnosticRespSWTR();
        break;
    default:
        /* Do nothing */
        break;
    }
}

void ResetFlagTxSigDiagcFailrTouchPanSWTRVibrationFltSts(void)
{
    flag_tx0 &= ((uint8_t)0xFE);
}

void ResetFlagTxSigDiagcFailrTouchPanSWTRTouchdFltSts(void)
{
    flag_tx0 &= ((uint8_t)0xFD);
}

void ResetFlagTxSigDiagcFailrTouchPanSWTRSnsrFltSts(void)
{
    flag_tx0 &= ((uint8_t)0xFB);
}

void ResetFlagTxSigDiagcFailrTouchPanSWTRCmnFltSts(void)
{
    flag_tx0 &= ((uint8_t)0xF7);
}

void ResetFlagTxSigDiagcFailrTouchPanSWTR_UB(void)
{
    flag_tx0 &= ((uint8_t)0xEF);
}

void ResetFlagTxSigSWTRSerNoNr4(void)
{
    flag_tx0 &= ((uint8_t)0xDF);
}

void ResetFlagTxSigSWTRSerNoNr3(void)
{
    flag_tx0 &= ((uint8_t)0xBF);
}

void ResetFlagTxSigSWTRSerNoNr2(void)
{
    flag_tx0 &= ((uint8_t)0x7F);
}

void ResetFlagTxSigSWTRSerNoNr1(void)
{
    flag_tx1 &= ((uint8_t)0xFE);
}

void ResetFlagTxSigSWTRSerNo_UB(void)
{
    flag_tx1 &= ((uint8_t)0xFD);
}

void ResetFlagTxSigSWTRPartNoCmplNr4(void)
{
    flag_tx1 &= ((uint8_t)0xFB);
}

void ResetFlagTxSigSWTRPartNoCmplNr3(void)
{
    flag_tx1 &= ((uint8_t)0xF7);
}

void ResetFlagTxSigSWTRPartNoCmplNr2(void)
{
    flag_tx1 &= ((uint8_t)0xEF);
}

void ResetFlagTxSigSWTRPartNoCmplNr1(void)
{
    flag_tx1 &= ((uint8_t)0xDF);
}

void ResetFlagTxSigSWTRPartNoCmplEndSgn3(void)
{
    flag_tx1 &= ((uint8_t)0xBF);
}

void ResetFlagTxSigSWTRPartNoCmplEndSgn2(void)
{
    flag_tx1 &= ((uint8_t)0x7F);
}

void ResetFlagTxSigSWTRPartNoCmplEndSgn1(void)
{
    flag_tx2 &= ((uint8_t)0xFE);
}

void ResetFlagTxSigSWTRPartNoCmpl_UB(void)
{
    flag_tx2 &= ((uint8_t)0xFD);
}

void ResetFlagTxSigSWTRPartNo10CmplNr5(void)
{
    flag_tx2 &= ((uint8_t)0xFB);
}

void ResetFlagTxSigSWTRPartNo10CmplNr4(void)
{
    flag_tx2 &= ((uint8_t)0xF7);
}

void ResetFlagTxSigSWTRPartNo10CmplNr3(void)
{
    flag_tx2 &= ((uint8_t)0xEF);
}

void ResetFlagTxSigSWTRPartNo10CmplNr2(void)
{
    flag_tx2 &= ((uint8_t)0xDF);
}

void ResetFlagTxSigSWTRPartNo10CmplNr1(void)
{
    flag_tx2 &= ((uint8_t)0xBF);
}

void ResetFlagTxSigSWTRPartNo10CmplEndSgn3(void)
{
    flag_tx2 &= ((uint8_t)0x7F);
}

void ResetFlagTxSigSWTRPartNo10CmplEndSgn2(void)
{
    flag_tx3 &= ((uint8_t)0xFE);
}

void ResetFlagTxSigSWTRPartNo10CmplEndSgn1(void)
{
    flag_tx3 &= ((uint8_t)0xFD);
}

void ResetFlagTxSigSwpUpDwnStsRi_UB(void)
{
    flag_tx3 &= ((uint8_t)0xFB);
}

void ResetFlagTxSigSwpUpDwnStsRi(void)
{
    flag_tx3 &= ((uint8_t)0xF7);
}

void ResetFlagTxSigSwpLeRiStsRi_UB(void)
{
    flag_tx3 &= ((uint8_t)0xEF);
}

void ResetFlagTxSigSwpLeRiStsRi(void)
{
    flag_tx3 &= ((uint8_t)0xDF);
}

void ResetFlagTxSigSteerWhlTouchBdVoice_UB(void)
{
    flag_tx3 &= ((uint8_t)0xBF);
}

void ResetFlagTxSigSteerWhlTouchBdVoice(void)
{
    flag_tx3 &= ((uint8_t)0x7F);
}

void ResetFlagTxSigSteerWhlTouchBdMenu_UB(void)
{
    flag_tx4 &= ((uint8_t)0xFE);
}

void ResetFlagTxSigSteerWhlTouchBdMenu(void)
{
    flag_tx4 &= ((uint8_t)0xFD);
}

void ResetFlagTxSigSteerWhlTouchBdDn_UB(void)
{
    flag_tx4 &= ((uint8_t)0xFB);
}

void ResetFlagTxSigSteerWhlTouchBdDn(void)
{
    flag_tx4 &= ((uint8_t)0xF7);
}

void ResetFlagTxSigSldVolCtrlSts_UB(void)
{
    flag_tx4 &= ((uint8_t)0xEF);
}

void ResetFlagTxSigSldVolCtrlSts(void)
{
    flag_tx4 &= ((uint8_t)0xDF);
}

void ResetFlagTxSigRiMFctActSgUp_UB(void)
{
    flag_tx4 &= ((uint8_t)0xBF);
}

void ResetFlagTxSigRiMFctActSgUp(void)
{
    flag_tx4 &= ((uint8_t)0x7F);
}

void ResetFlagTxSigRiMFctActSgRi_UB(void)
{
    flag_tx5 &= ((uint8_t)0xFE);
}

void ResetFlagTxSigRiMFctActSgRi(void)
{
    flag_tx5 &= ((uint8_t)0xFD);
}

void ResetFlagTxSigRiMFctActSgLe_UB(void)
{
    flag_tx5 &= ((uint8_t)0xFB);
}

void ResetFlagTxSigRiMFctActSgLe(void)
{
    flag_tx5 &= ((uint8_t)0xF7);
}

void ResetFlagTxSigRiMFctActSgDn_UB(void)
{
    flag_tx5 &= ((uint8_t)0xEF);
}

void ResetFlagTxSigRiMFctActSgDn(void)
{
    flag_tx5 &= ((uint8_t)0xDF);
}

void ResetFlagTxSigRiMFctActSgCe_UB(void)
{
    flag_tx5 &= ((uint8_t)0xBF);
}

void ResetFlagTxSigRiMFctActSgCe(void)
{
    flag_tx5 &= ((uint8_t)0x7F);
}

void ResetFlagTxSigSteerWhlTouchBdRiTouchPosnY(void)
{
    flag_tx6 &= ((uint8_t)0xFE);
}

void ResetFlagTxSigSteerWhlTouchBdRiTouchPosnX(void)
{
    flag_tx6 &= ((uint8_t)0xFD);
}

void ResetFlagTxSigSteerWhlTouchBdRiSteerWhlTouchBdSts(void)
{
    flag_tx6 &= ((uint8_t)0xFB);
}

void ResetFlagTxSigSteerWhlTouchBdRiCntr(void)
{
    flag_tx6 &= ((uint8_t)0xF7);
}

void ResetFlagTxSigSteerWhlTouchBdRiChks(void)
{
    flag_tx6 &= ((uint8_t)0xEF);
}

void ResetFlagTxSigSteerWhlTouchBdRi_UB(void)
{
    flag_tx6 &= ((uint8_t)0xDF);
}

void ResetFlagTxSigDiagnosticRespSWTR(void)
{
    flag_tx6 &= ((UI_8)0xBF);
}

t_flag_value ReadFlagRxSigDiagnosticReqSWTR(void)
{
    return (((flag_rx0 & ((UI_8)0x01)) > ((UI_8)0)) ? COM_TRUE : COM_FALSE);
}
t_flag_value ReadFlagRxSigDiagnosticFuncAddrReq(void)
{
    return (((flag_rx0 & ((UI_8)0x02)) > ((UI_8)0)) ? COM_TRUE : COM_FALSE);
}

/*---------------------------------------------------------------------------
| Portability:  Target platform independent
|----------------------------------------------------------------------------
| Routine description:
|  * Reset service for the notify class 1 (RxNotif) class 3 (RxErrorNotif)
|    class 2 (TxNotif) and class 4 (TxErrorNotif)
|---------------------------------------------------------------------------
| Parameters description:
|   message: Identification of the signal.
/---------------------------------------------------------------------------*/
void ResetFlagRxSig(t_symbolic_name message)
{
    switch (message)
    {

    case SIG_DIAGNOSTICREQSWTR:
        ResetFlagRxSigDiagnosticReqSWTR();
        break;
    case SIG_DIAGNOSTICFUNCADDRREQ:
        ResetFlagRxSigDiagnosticFuncAddrReq();
        break;
    default:
        /* Do nothing */
        break;
    }
}

void ResetFlagRxSigDiagnosticReqSWTR(void)
{
    flag_rx0 &= ((UI_8)0xFE);
}

void ResetFlagRxSigDiagnosticFuncAddrReq(void)
{
    flag_rx0 &= ((UI_8)0xFD);
}

/*---------------------------------------------------------------------------
| Portability:  Target platform independent
|----------------------------------------------------------------------------
| Routine description:
|  * Main runnable of the OsekCom stack intended to be called periodically by
|    the system scheduler with a period equal to FICOSEK_COM_TASK_TICKS
|---------------------------------------------------------------------------
| Parameters description:
/---------------------------------------------------------------------------*/
void OsekComTask(void)
{
    if (TST_FLAG_OSEK_COM_INIT())
    {
        /* Get timer difference since last task execution */
        time_diff = FICOSEK_COM_TASK_TICKS;

        OsekComDeadlineMonitRx();
        OsekComPeriodicTx();
    }
}

/*---------------------------------------------------------------------------
| Portability:  Target platform independent
|----------------------------------------------------------------------------
| Routine description:
| * Runnable responsible of managing the transmission timers of periodic and
|   mixed frames.
| * The transmission timer value will be rounded down to first multiple of
|   FICOSEK_COM_TASK_TICKS
| ---------------------------------------------------------------------------
| Parameters description:
/ --------------------------------------------------------------------------- */
static void OsekComPeriodicTx(void)
{
    /* Test whether Tx of periodic frames is active */
    if (TST_FLAG_OSEK_COM_PER_TX())
    {
        /* Com frames monitoring */

        /* Tx frame SwtrPrivateDHUCanFr06 end of period monitoring */
        ptt_tx_frm_swtrprivatedhucanfr06 += time_diff;
        if (ptt_tx_frm_swtrprivatedhucanfr06 >= PT_TX_FRM_SWTRPRIVATEDHUCANFR06)
        {
            /* Reset timer */
            ptt_tx_frm_swtrprivatedhucanfr06 = 0; /* Tx frame */
                                                  // SuspendAllInterrupts();
            SET_FLAG_TX_REQ_FRM_SWTRPRIVATEDHUCANFR06();

            OsekComTxReqCallbackSWTR();
            // ResumeAllInterrupts();
        }
        else
        {
            /* Do nothing */
        }

        /* Tx frame SwtrPrivateDHUCanFr05 end of period monitoring */
        ptt_tx_frm_swtrprivatedhucanfr05 += time_diff;
        if (ptt_tx_frm_swtrprivatedhucanfr05 >= PT_TX_FRM_SWTRPRIVATEDHUCANFR05)
        {
            /* Reset timer */
            ptt_tx_frm_swtrprivatedhucanfr05 = 0; /* Tx frame */
                                                  // SuspendAllInterrupts();
            SET_FLAG_TX_REQ_FRM_SWTRPRIVATEDHUCANFR05();

            OsekComTxReqCallbackSWTR();
            // ResumeAllInterrupts();
        }
        else
        {
            /* Do nothing */
        }

        /* Tx frame SwtrPrivateDHUCanFr04 end of period monitoring */
        ptt_tx_frm_swtrprivatedhucanfr04 += time_diff;
        if (ptt_tx_frm_swtrprivatedhucanfr04 >= PT_TX_FRM_SWTRPRIVATEDHUCANFR04)
        {
            /* Reset timer */
            ptt_tx_frm_swtrprivatedhucanfr04 = 0; /* Tx frame */
                                                  //  SuspendAllInterrupts();
            SET_FLAG_TX_REQ_FRM_SWTRPRIVATEDHUCANFR04();

            OsekComTxReqCallbackSWTR();
            //  ResumeAllInterrupts();
        }
        else
        {
            /* Do nothing */
        }

        /* Tx frame SwtrPrivateDHUCanFr03 end of period monitoring */
        ptt_tx_frm_swtrprivatedhucanfr03 += time_diff;
        if (ptt_tx_frm_swtrprivatedhucanfr03 >= PT_TX_FRM_SWTRPRIVATEDHUCANFR03)
        {
            /* Reset timer */
            ptt_tx_frm_swtrprivatedhucanfr03 = 0; /* Tx frame */
                                                  //  SuspendAllInterrupts();
            SET_FLAG_TX_REQ_FRM_SWTRPRIVATEDHUCANFR03();

            OsekComTxReqCallbackSWTR();
            //  ResumeAllInterrupts();
        }
        else
        {
            /* Do nothing */
        }
#if 0
        /* Tx frame SwtrPrivateDHUCanFr02 end of period monitoring */
        ptt_tx_frm_swtrprivatedhucanfr02 += time_diff;
        if (ptt_tx_frm_swtrprivatedhucanfr02 >= PT_TX_FRM_SWTRPRIVATEDHUCANFR02) {
            /* Reset timer */
            ptt_tx_frm_swtrprivatedhucanfr02 = 0;            /* Tx frame */
            //SuspendAllInterrupts();
            SET_FLAG_TX_REQ_FRM_SWTRPRIVATEDHUCANFR02();
            OsekComTxReqCallbackSWTR();
            //ResumeAllInterrupts();
        }
        else {
            /* Do nothing */
        }
#endif
        /* Tx frame SwtrPressFr01 end of period monitoring */
        ptt_tx_frm_swtrpressfr01 += time_diff;
        if (ptt_tx_frm_swtrpressfr01 >= PT_TX_FRM_SWTRPRESSFR01)
        {
            /* Reset timer */
            ptt_tx_frm_swtrpressfr01 = 0; /* Tx frame */
            // SuspendAllInterrupts();
            SET_FLAG_TX_REQ_FRM_SWTRPRESSFR01();

            OsekComTxReqCallbackSWTR();

            // ResumeAllInterrupts();
        }
        else
        {
            /* Do nothing */
        }

        /* Tx frame SwtRSensorFr01 end of period monitoring */
        ptt_tx_frm_swtrsensorfr01 += time_diff;
        if (ptt_tx_frm_swtrsensorfr01 >= PT_TX_FRM_SWTRSENSORFR01)
        {
            /* Reset timer */
            ptt_tx_frm_swtrsensorfr01 = 0; /* Tx frame */
                                           //  SuspendAllInterrupts();
            SET_FLAG_TX_REQ_FRM_SWTRSENSORFR01();

            OsekComTxReqCallbackSWTR();

            // ResumeAllInterrupts();
        }
        else
        {
            /* Do nothing */
        }

        /* Tx frame SwtRSensorFr02 end of period monitoring */
        ptt_tx_frm_swtrsensorfr02 += time_diff;
        if (ptt_tx_frm_swtrsensorfr02 >= PT_TX_FRM_SWTRSENSORFR02)
        {
            /* Reset timer */
            ptt_tx_frm_swtrsensorfr02 = 0; /* Tx frame */
                                           //  SuspendAllInterrupts();
            SET_FLAG_TX_REQ_FRM_SWTRSENSORFR02();

            OsekComTxReqCallbackSWTR();

            //  ResumeAllInterrupts();
        }
        else
        {
            /* Do nothing */
        }

        /* Tx frame SwtRSensorFr03 end of period monitoring */
        ptt_tx_frm_swtrsensorfr03 += time_diff;
        if (ptt_tx_frm_swtrsensorfr03 >= PT_TX_FRM_SWTRSENSORFR03)
        {
            /* Reset timer */
            ptt_tx_frm_swtrsensorfr03 = 0; /* Tx frame */
                                           // SuspendAllInterrupts();
            SET_FLAG_TX_REQ_FRM_SWTRSENSORFR03();

            OsekComTxReqCallbackSWTR();

            // ResumeAllInterrupts();
        }
        else
        {
            /* Do nothing */
        }

        /* Tx frame SwtRSensorFr04 end of period monitoring */
        ptt_tx_frm_swtrsensorfr04 += time_diff;
        if (ptt_tx_frm_swtrsensorfr04 >= PT_TX_FRM_SWTRSENSORFR04)
        {
            /* Reset timer */
            ptt_tx_frm_swtrsensorfr04 = 0; /* Tx frame */
                                           //  SuspendAllInterrupts();
            SET_FLAG_TX_REQ_FRM_SWTRSENSORFR04();

            OsekComTxReqCallbackSWTR();

            //  ResumeAllInterrupts();
        }
        else
        {
            /* Do nothing */
        }

        /* Tx frame SwtRSensorFr05 end of period monitoring */
        ptt_tx_frm_swtrsensorfr05 += time_diff;
        if (ptt_tx_frm_swtrsensorfr05 >= PT_TX_FRM_SWTRSENSORFR05)
        {
            /* Reset timer */
            ptt_tx_frm_swtrsensorfr05 = 0; /* Tx frame */
                                           //  SuspendAllInterrupts();
            SET_FLAG_TX_REQ_FRM_SWTRSENSORFR05();

            OsekComTxReqCallbackSWTR();

            //  ResumeAllInterrupts();
        }
        else
        {
            /* Do nothing */
        }

        /* Tx frame SwtRSensorFr06 end of period monitoring */
        ptt_tx_frm_swtrsensorfr06 += time_diff;
        if (ptt_tx_frm_swtrsensorfr06 >= PT_TX_FRM_SWTRSENSORFR06)
        {
            /* Reset timer */
            ptt_tx_frm_swtrsensorfr06 = 0; /* Tx frame */
                                           // SuspendAllInterrupts();
            SET_FLAG_TX_REQ_FRM_SWTRSENSORFR06();

            OsekComTxReqCallbackSWTR();

            // ResumeAllInterrupts();
        }
        else
        {
            /* Do nothing */
        }

        /* Tx frame SwtRSensorFr07 end of period monitoring */
        ptt_tx_frm_swtrsensorfr07 += time_diff;
        if (ptt_tx_frm_swtrsensorfr07 >= PT_TX_FRM_SWTRSENSORFR07)
        {
            /* Reset timer */
            ptt_tx_frm_swtrsensorfr07 = 0; /* Tx frame */
                                           // SuspendAllInterrupts();
            SET_FLAG_TX_REQ_FRM_SWTRSENSORFR07();

            OsekComTxReqCallbackSWTR();

            // ResumeAllInterrupts();
        }
        else
        {
            /* Do nothing */
        }

        /* Tx frame SwtRSensorFr08 end of period monitoring */
        ptt_tx_frm_swtrsensorfr08 += time_diff;
        if (ptt_tx_frm_swtrsensorfr08 >= PT_TX_FRM_SWTRSENSORFR08)
        {
            /* Reset timer */
            ptt_tx_frm_swtrsensorfr08 = 0; /* Tx frame */
                                           //   SuspendAllInterrupts();

            SET_FLAG_TX_REQ_FRM_SWTRSENSORFR08();

            OsekComTxReqCallbackSWTR();

            //  ResumeAllInterrupts();
        }
        else
        {
            /* Do nothing */
        }
    }
}

/*---------------------------------------------------------------------------
| Portability:  Target platform independent
|----------------------------------------------------------------------------
| Routine description:
| * Runnable responsible of managing the reception time-out timers of
|   periodic and mixed frames.
| * The timer value will be rounded down to first multiple of FICOSEK_COM_TASK_TICKS
| ---------------------------------------------------------------------------
| Parameters description:
/ --------------------------------------------------------------------------- */
static void OsekComDeadlineMonitRx(void)
{
    /* Management of timers of Rx Error Signals */

    /* Increasing Timer */
    dmt_rx_sig_actvnofsteerwhlillmn += time_diff;
    /* Rx deadline case time out signal ActvnOfSteerWhlIllmn */
    if (dmt_rx_sig_actvnofsteerwhlillmn >= TO_RX_SIG_ACTVNOFSTEERWHLILLMN)
    {
        /* Reset monitoring timer */
        dmt_rx_sig_actvnofsteerwhlillmn = 0;
        /* RxError notification callback */
        IhuPrivateDHUCanFr01_Timeout_CALLBACK();
    }
    /* Case normal counting */
    else
    {
        /* Do Nothing */
    }
}

/*---------------------------------------------------------------------------
| Portability:  Target platform independent
|----------------------------------------------------------------------------
| Routine description:
| * Routine responsible of initiating on event transmissions of direct and
|   mixed frames
| ---------------------------------------------------------------------------
| Parameters description:
/ --------------------------------------------------------------------------- */
void OsekComTxReqFrmSwtrPrivateDHUCanFr01(void)
{
    /* Tx frame */

    SET_FLAG_TX_REQ_FRM_SWTRPRIVATEDHUCANFR01();
    OsekComTxReqCallbackSWTR();
}

void OsekComTxReqFrmSwtrPrivateDHUCanFr02(void)
{
    /* Tx frame */

    SET_FLAG_TX_REQ_FRM_SWTRPRIVATEDHUCANFR02();
    OsekComTxReqCallbackSWTR();
}

/*---------------------------------------------------------------------------
| Portability:  Target platform independent
|----------------------------------------------------------------------------
| Routine description:
| * Routine responsible of initiating on event transmissions of direct and
|   mixed frames
| ---------------------------------------------------------------------------
| Parameters description:
/ --------------------------------------------------------------------------- */
static void OsekComTxReqFrmDIAG_PhysResp_SWTR(void)
{
    /* Start of the Tx deadline monitoring timer */
    // SuspendAllInterrupts();
    if (dmt_tx_frm_diag_physresp_swtr == TIMER_CANCEL)
    {
        dmt_tx_frm_diag_physresp_swtr = 0;
    }
    else
    {
        /* Do nothing */
    }
    /* Tx frame */
    SET_FLAG_TX_REQ_FRM_DIAG_PHYSRESP_SWTR();
    // CanTxRequest(0);
    OsekComTxReqCallbackSWTR();
    //  ResumeAllInterrupts();
}
