
#ifndef __OSEKCOM_H
#define __OSEKCOM_H

/*-------------------------------- Includes ------------------------------*/
#include <stddef.h>                     // Defines NULL
#include <stdbool.h>                    // Defines true
#include <stdlib.h>                     // Defines EXIT_FAILURE
#include "definitions.h"                // SYS function prototypes

/*-------------------------------- Defines -------------------------------*/
/* CAN handlers definition */
typedef enum {
    CAN1_HANDLER = 0x00,  /*  CAN1 handler */
    CAN2_HANDLER = 0x01,  /*  CAN2 handler */
    CAN_HANDLER_UNKNOWN = 0xFF
}t_can_handler;

typedef uint8_t t_can_data[8];

#ifndef uint8_t 
typedef  unsigned char uint8_t;
#endif

#ifndef uint16_t 
typedef  unsigned short uint16_t;
#endif

#ifndef bool 
typedef  unsigned char bool;
#endif

/* Theoretical time between two consecutive executions of OsekCom task */
#define FICOSEK_COM_TASK_TICKS (1)

/* Return type of the calls OSEK COM */
#ifndef STD_TYPES_H
    #define E_OK         ((uint8_t)0x00) /* Service call has succeeded        */
#endif    
#define E_COM_ID         ((uint8_t)0x01) /* Given message or mode identifier  */
                             /* is out of range or invalid        */
#define E_COM_LENGTH     ((uint8_t)0x02) /* Given data length is out of range */
#define E_COM_LIMIT      ((uint8_t)0x03) /* Overflow of message queue         */
#define E_COM_NOMSG      ((uint8_t)0x04) /* Message queue is empty            */
#define E_COM_SYS_NOINIT ((uint8_t)0x05) /* User defined E_COM_SYS_??         */


/* Acceptable values for the signal sig_DiagcFailrTouchPanSWTLVibrationFltSts */
#define SIG_DIAGCFAILRTOUCHPANSWTLVIBRATIONFLTSTS_FLTSTS_INVALID ((t_sig_diagcfailrtouchpanswtlvibrationfltsts) 3)
#define SIG_DIAGCFAILRTOUCHPANSWTLVIBRATIONFLTSTS_FLTSTS_VIBRATIONOPENCIRC ((t_sig_diagcfailrtouchpanswtlvibrationfltsts) 2)
#define SIG_DIAGCFAILRTOUCHPANSWTLVIBRATIONFLTSTS_FLTSTS_VIBRATIONSHOCIRC ((t_sig_diagcfailrtouchpanswtlvibrationfltsts) 1)
#define SIG_DIAGCFAILRTOUCHPANSWTLVIBRATIONFLTSTS_FLTSTS_NOFLT ((t_sig_diagcfailrtouchpanswtlvibrationfltsts) 0)

/* Acceptable values for the signal sig_DiagcFailrTouchPanSWTLTouchdFltSts */
#define SIG_DIAGCFAILRTOUCHPANSWTLTOUCHDFLTSTS_FLTSTS_TOUCHDOUTDOFRNG ((t_sig_diagcfailrtouchpanswtltouchdfltsts) 2)
#define SIG_DIAGCFAILRTOUCHPANSWTLTOUCHDFLTSTS_FLTSTS_TOUCHDINVLD ((t_sig_diagcfailrtouchpanswtltouchdfltsts) 1)
#define SIG_DIAGCFAILRTOUCHPANSWTLTOUCHDFLTSTS_FLTSTS_NOFLT ((t_sig_diagcfailrtouchpanswtltouchdfltsts) 0)

/* Acceptable values for the signal sig_DiagcFailrTouchPanSWTLSnsrFltSts */
#define SIG_DIAGCFAILRTOUCHPANSWTLSNSRFLTSTS_SNSRFLTSTS_FSNSROPENCIRC ((t_sig_diagcfailrtouchpanswtlsnsrfltsts) 4)
#define SIG_DIAGCFAILRTOUCHPANSWTLSNSRFLTSTS_SNSRFLTSTS_FSNSRSHOCIRCTOBATT ((t_sig_diagcfailrtouchpanswtlsnsrfltsts) 3)
#define SIG_DIAGCFAILRTOUCHPANSWTLSNSRFLTSTS_SNSRFLTSTS_FSNSRSHOCIRCTOGND ((t_sig_diagcfailrtouchpanswtlsnsrfltsts) 2)
#define SIG_DIAGCFAILRTOUCHPANSWTLSNSRFLTSTS_SNSRFLTSTS_FSNSRINVLD ((t_sig_diagcfailrtouchpanswtlsnsrfltsts) 1)
#define SIG_DIAGCFAILRTOUCHPANSWTLSNSRFLTSTS_SNSRFLTSTS_NOFLT ((t_sig_diagcfailrtouchpanswtlsnsrfltsts) 0)

/* Acceptable values for the signal sig_DiagcFailrTouchPanSWTLCmnFltSts */
#define SIG_DIAGCFAILRTOUCHPANSWTLCMNFLTSTS_CMNFLTSTS_OUTDURNG ((t_sig_diagcfailrtouchpanswtlcmnfltsts) 1)
#define SIG_DIAGCFAILRTOUCHPANSWTLCMNFLTSTS_CMNFLTSTS_NOFLT ((t_sig_diagcfailrtouchpanswtlcmnfltsts) 0)

/* Acceptable values for the signal sig_SwpUpDwnStsLe */
#define SIG_SWPUPDWNSTSLE_SWPUPDWNREQSTS_LONGSLIDEDOWN ((t_sig_swpupdwnstsle) 4)
#define SIG_SWPUPDWNSTSLE_SWPUPDWNREQSTS_LONGSLIDEUP ((t_sig_swpupdwnstsle) 3)
#define SIG_SWPUPDWNSTSLE_SWPUPDWNREQSTS_SHORTSLIDEDOWN ((t_sig_swpupdwnstsle) 2)
#define SIG_SWPUPDWNSTSLE_SWPUPDWNREQSTS_SHORTSLIDEUP ((t_sig_swpupdwnstsle) 1)
#define SIG_SWPUPDWNSTSLE_SWPUPDWNREQSTS_IDLE ((t_sig_swpupdwnstsle) 0)

/* Acceptable values for the signal sig_SwpLeRiStsLe */
#define SIG_SWPLERISTSLE_SWPLERIREQSTS_LONGSLIDERIGHT ((t_sig_swpleristsle) 4)
#define SIG_SWPLERISTSLE_SWPLERIREQSTS_LONGSLIDELEFT ((t_sig_swpleristsle) 3)
#define SIG_SWPLERISTSLE_SWPLERIREQSTS_SHORTSLIDERIGHT ((t_sig_swpleristsle) 2)
#define SIG_SWPLERISTSLE_SWPLERIREQSTS_SHORTSLIDELEFT ((t_sig_swpleristsle) 1)
#define SIG_SWPLERISTSLE_SWPLERIREQSTS_IDLE ((t_sig_swpleristsle) 0)

/* Acceptable values for the signal sig_SteerWhlTouchBdCrsResuSteerWhlTouchBdSts */
#define SIG_STEERWHLTOUCHBDCRSRESUSTEERWHLTOUCHBDSTS_STEERWHLTOUCHBDSTS_INVALID ((t_sig_steerwhltouchbdcrsresusteerwhltouchbdsts) 3)
#define SIG_STEERWHLTOUCHBDCRSRESUSTEERWHLTOUCHBDSTS_STEERWHLTOUCHBDSTS_TOUCHANDPRESS ((t_sig_steerwhltouchbdcrsresusteerwhltouchbdsts) 2)
#define SIG_STEERWHLTOUCHBDCRSRESUSTEERWHLTOUCHBDSTS_STEERWHLTOUCHBDSTS_TOUCH ((t_sig_steerwhltouchbdcrsresusteerwhltouchbdsts) 1)
#define SIG_STEERWHLTOUCHBDCRSRESUSTEERWHLTOUCHBDSTS_STEERWHLTOUCHBDSTS_NOTACTIVE ((t_sig_steerwhltouchbdcrsresusteerwhltouchbdsts) 0)

/* Acceptable values for the signal sig_SteerWhlTouchBdCrsResuQf1 */
#define SIG_STEERWHLTOUCHBDCRSRESUQF1_QF1_DATACALCDWITHDEVDEFD ((t_sig_steerwhltouchbdcrsresuqf1) 3)
#define SIG_STEERWHLTOUCHBDCRSRESUQF1_QF1_DEVOFDATANOTWITHINRNGALLWD ((t_sig_steerwhltouchbdcrsresuqf1) 2)
#define SIG_STEERWHLTOUCHBDCRSRESUQF1_QF1_DATATMPUNDEFDANDEVLNINPROGS ((t_sig_steerwhltouchbdcrsresuqf1) 1)
#define SIG_STEERWHLTOUCHBDCRSRESUQF1_QF1_DEVOFDATAUNDEFD ((t_sig_steerwhltouchbdcrsresuqf1) 0)

/* Acceptable values for the signal sig_SteerWhlTouchBdCnclSteerWhlTouchBdSts */
#define SIG_STEERWHLTOUCHBDCNCLSTEERWHLTOUCHBDSTS_STEERWHLTOUCHBDSTS_INVALID ((t_sig_steerwhltouchbdcnclsteerwhltouchbdsts) 3)
#define SIG_STEERWHLTOUCHBDCNCLSTEERWHLTOUCHBDSTS_STEERWHLTOUCHBDSTS_TOUCHANDPRESS ((t_sig_steerwhltouchbdcnclsteerwhltouchbdsts) 2)
#define SIG_STEERWHLTOUCHBDCNCLSTEERWHLTOUCHBDSTS_STEERWHLTOUCHBDSTS_TOUCH ((t_sig_steerwhltouchbdcnclsteerwhltouchbdsts) 1)
#define SIG_STEERWHLTOUCHBDCNCLSTEERWHLTOUCHBDSTS_STEERWHLTOUCHBDSTS_NOTACTIVE ((t_sig_steerwhltouchbdcnclsteerwhltouchbdsts) 0)

/* Acceptable values for the signal sig_SteerWhlTouchBdCnclQf1 */
#define SIG_STEERWHLTOUCHBDCNCLQF1_QF1_DATACALCDWITHDEVDEFD ((t_sig_steerwhltouchbdcnclqf1) 3)
#define SIG_STEERWHLTOUCHBDCNCLQF1_QF1_DEVOFDATANOTWITHINRNGALLWD ((t_sig_steerwhltouchbdcnclqf1) 2)
#define SIG_STEERWHLTOUCHBDCNCLQF1_QF1_DATATMPUNDEFDANDEVLNINPROGS ((t_sig_steerwhltouchbdcnclqf1) 1)
#define SIG_STEERWHLTOUCHBDCNCLQF1_QF1_DEVOFDATAUNDEFD ((t_sig_steerwhltouchbdcnclqf1) 0)

/* Acceptable values for the signal sig_SteerWhlTouchBdADAS */
#define SIG_STEERWHLTOUCHBDADAS_STEERWHLTOUCHBDSTS_INVALID ((t_sig_steerwhltouchbdadas) 3)
#define SIG_STEERWHLTOUCHBDADAS_STEERWHLTOUCHBDSTS_TOUCHANDPRESS ((t_sig_steerwhltouchbdadas) 2)
#define SIG_STEERWHLTOUCHBDADAS_STEERWHLTOUCHBDSTS_TOUCH ((t_sig_steerwhltouchbdadas) 1)
#define SIG_STEERWHLTOUCHBDADAS_STEERWHLTOUCHBDSTS_NOTACTIVE ((t_sig_steerwhltouchbdadas) 0)

/* Acceptable values for the signal sig_LeMFctActSgUp */
#define SIG_LEMFCTACTSGUP_STEERWHLTOUCHBDSTS_INVALID ((t_sig_lemfctactsgup) 3)
#define SIG_LEMFCTACTSGUP_STEERWHLTOUCHBDSTS_TOUCHANDPRESS ((t_sig_lemfctactsgup) 2)
#define SIG_LEMFCTACTSGUP_STEERWHLTOUCHBDSTS_TOUCH ((t_sig_lemfctactsgup) 1)
#define SIG_LEMFCTACTSGUP_STEERWHLTOUCHBDSTS_NOTACTIVE ((t_sig_lemfctactsgup) 0)

/* Acceptable values for the signal sig_LeMFctActSgRi */
#define SIG_LEMFCTACTSGRI_STEERWHLTOUCHBDSTS_INVALID ((t_sig_lemfctactsgri) 3)
#define SIG_LEMFCTACTSGRI_STEERWHLTOUCHBDSTS_TOUCHANDPRESS ((t_sig_lemfctactsgri) 2)
#define SIG_LEMFCTACTSGRI_STEERWHLTOUCHBDSTS_TOUCH ((t_sig_lemfctactsgri) 1)
#define SIG_LEMFCTACTSGRI_STEERWHLTOUCHBDSTS_NOTACTIVE ((t_sig_lemfctactsgri) 0)

/* Acceptable values for the signal sig_LeMFctActSgLe */
#define SIG_LEMFCTACTSGLE_STEERWHLTOUCHBDSTS_INVALID ((t_sig_lemfctactsgle) 3)
#define SIG_LEMFCTACTSGLE_STEERWHLTOUCHBDSTS_TOUCHANDPRESS ((t_sig_lemfctactsgle) 2)
#define SIG_LEMFCTACTSGLE_STEERWHLTOUCHBDSTS_TOUCH ((t_sig_lemfctactsgle) 1)
#define SIG_LEMFCTACTSGLE_STEERWHLTOUCHBDSTS_NOTACTIVE ((t_sig_lemfctactsgle) 0)

/* Acceptable values for the signal sig_LeMFctActSgDn */
#define SIG_LEMFCTACTSGDN_STEERWHLTOUCHBDSTS_INVALID ((t_sig_lemfctactsgdn) 3)
#define SIG_LEMFCTACTSGDN_STEERWHLTOUCHBDSTS_TOUCHANDPRESS ((t_sig_lemfctactsgdn) 2)
#define SIG_LEMFCTACTSGDN_STEERWHLTOUCHBDSTS_TOUCH ((t_sig_lemfctactsgdn) 1)
#define SIG_LEMFCTACTSGDN_STEERWHLTOUCHBDSTS_NOTACTIVE ((t_sig_lemfctactsgdn) 0)

/* Acceptable values for the signal sig_LeMFctActSgCe */
#define SIG_LEMFCTACTSGCE_STEERWHLTOUCHBDSTS_INVALID ((t_sig_lemfctactsgce) 3)
#define SIG_LEMFCTACTSGCE_STEERWHLTOUCHBDSTS_TOUCHANDPRESS ((t_sig_lemfctactsgce) 2)
#define SIG_LEMFCTACTSGCE_STEERWHLTOUCHBDSTS_TOUCH ((t_sig_lemfctactsgce) 1)
#define SIG_LEMFCTACTSGCE_STEERWHLTOUCHBDSTS_NOTACTIVE ((t_sig_lemfctactsgce) 0)

/* Acceptable values for the signal sig_SteerWhlTouchBdLeSteerWhlTouchBdSts */
#define SIG_STEERWHLTOUCHBDLESTEERWHLTOUCHBDSTS_STEERWHLTOUCHBDSTS_INVALID ((t_sig_steerwhltouchbdlesteerwhltouchbdsts) 3)
#define SIG_STEERWHLTOUCHBDLESTEERWHLTOUCHBDSTS_STEERWHLTOUCHBDSTS_TOUCHANDPRESS ((t_sig_steerwhltouchbdlesteerwhltouchbdsts) 2)
#define SIG_STEERWHLTOUCHBDLESTEERWHLTOUCHBDSTS_STEERWHLTOUCHBDSTS_TOUCH ((t_sig_steerwhltouchbdlesteerwhltouchbdsts) 1)
#define SIG_STEERWHLTOUCHBDLESTEERWHLTOUCHBDSTS_STEERWHLTOUCHBDSTS_NOTACTIVE ((t_sig_steerwhltouchbdlesteerwhltouchbdsts) 0)

/* Acceptable values for the signal sig_TwliBriSts */
#define SIG_TWLIBRISTS_TWLIBRISTS1_DAY ((t_sig_twlibrists) 1)
#define SIG_TWLIBRISTS_TWLIBRISTS1_NIGHT ((t_sig_twlibrists) 0)

/* Acceptable values for the signal sig_ActvnOfSteerWhlIllmn */
#define SIG_ACTVNOFSTEERWHLILLMN_BOOLEAN_TRUE ((t_sig_actvnofsteerwhlillmn) 1)
#define SIG_ACTVNOFSTEERWHLILLMN_BOOLEAN_FALSE ((t_sig_actvnofsteerwhlillmn) 0)
/* Node id */ 
#define NODE_ID_MASK ((uint16_t) 0xF000U) /* Mask to get nodes id */
#define NODE_ID_SWTL (((uint16_t) 0x1000U) & NODE_ID_MASK) /* Symbolic name of the node SWTL */

/* Symbolic names for Tx signals with static length */ 
/* First Tx signal */
#define FIRST_TX_STA_LEN_SIGNAL_SYMBOLIC_NAME ((~NODE_ID_MASK) & SIG_DIAGCFAILRTOUCHPANSWTLCMNFLTSTS)
#define SIG_DIAGCFAILRTOUCHPANSWTLCMNFLTSTS (((uint16_t) 1) | NODE_ID_SWTL) /* Symbolic name of the signal DiagcFailrTouchPanSWTLCmnFltSts */
#define SIG_DIAGCFAILRTOUCHPANSWTLSNSRFLTSTS (((uint16_t) 2) | NODE_ID_SWTL) /* Symbolic name of the signal DiagcFailrTouchPanSWTLSnsrFltSts */
#define SIG_DIAGCFAILRTOUCHPANSWTLTOUCHDFLTSTS (((uint16_t) 3) | NODE_ID_SWTL) /* Symbolic name of the signal DiagcFailrTouchPanSWTLTouchdFltSts */
#define SIG_DIAGCFAILRTOUCHPANSWTLVIBRATIONFLTSTS (((uint16_t) 4) | NODE_ID_SWTL) /* Symbolic name of the signal DiagcFailrTouchPanSWTLVibrationFltSts */
#define SIG_DIAGCFAILRTOUCHPANSWTL_UB (((uint16_t) 5) | NODE_ID_SWTL) /* Symbolic name of the signal DiagcFailrTouchPanSWTL_UB */
#define SIG_LEMFCTACTSGCE (((uint16_t) 6) | NODE_ID_SWTL) /* Symbolic name of the signal LeMFctActSgCe */
#define SIG_LEMFCTACTSGCE_UB (((uint16_t) 7) | NODE_ID_SWTL) /* Symbolic name of the signal LeMFctActSgCe_UB */
#define SIG_LEMFCTACTSGDN (((uint16_t) 8) | NODE_ID_SWTL) /* Symbolic name of the signal LeMFctActSgDn */
#define SIG_LEMFCTACTSGDN_UB (((uint16_t) 9) | NODE_ID_SWTL) /* Symbolic name of the signal LeMFctActSgDn_UB */
#define SIG_LEMFCTACTSGLE (((uint16_t) 10) | NODE_ID_SWTL) /* Symbolic name of the signal LeMFctActSgLe */
#define SIG_LEMFCTACTSGLE_UB (((uint16_t) 11) | NODE_ID_SWTL) /* Symbolic name of the signal LeMFctActSgLe_UB */
#define SIG_LEMFCTACTSGRI (((uint16_t) 12) | NODE_ID_SWTL) /* Symbolic name of the signal LeMFctActSgRi */
#define SIG_LEMFCTACTSGRI_UB (((uint16_t) 13) | NODE_ID_SWTL) /* Symbolic name of the signal LeMFctActSgRi_UB */
#define SIG_LEMFCTACTSGUP (((uint16_t) 14) | NODE_ID_SWTL) /* Symbolic name of the signal LeMFctActSgUp */
#define SIG_LEMFCTACTSGUP_UB (((uint16_t) 15) | NODE_ID_SWTL) /* Symbolic name of the signal LeMFctActSgUp_UB */
#define SIG_STEERWHLTOUCHBDADAS (((uint16_t) 16) | NODE_ID_SWTL) /* Symbolic name of the signal SteerWhlTouchBdADAS */
#define SIG_STEERWHLTOUCHBDADAS_UB (((uint16_t) 17) | NODE_ID_SWTL) /* Symbolic name of the signal SteerWhlTouchBdADAS_UB */
#define SIG_STEERWHLTOUCHBDCNCLCHKS (((uint16_t) 18) | NODE_ID_SWTL) /* Symbolic name of the signal SteerWhlTouchBdCnclChks */
#define SIG_STEERWHLTOUCHBDCNCLCNTR (((uint16_t) 19) | NODE_ID_SWTL) /* Symbolic name of the signal SteerWhlTouchBdCnclCntr */
#define SIG_STEERWHLTOUCHBDCNCLQF1 (((uint16_t) 20) | NODE_ID_SWTL) /* Symbolic name of the signal SteerWhlTouchBdCnclQf1 */
#define SIG_STEERWHLTOUCHBDCNCLSTEERWHLTOUCHBDSTS (((uint16_t) 21) | NODE_ID_SWTL) /* Symbolic name of the signal SteerWhlTouchBdCnclSteerWhlTouchBdSts */
#define SIG_STEERWHLTOUCHBDCNCL_UB (((uint16_t) 22) | NODE_ID_SWTL) /* Symbolic name of the signal SteerWhlTouchBdCncl_UB */
#define SIG_STEERWHLTOUCHBDCRSRESUQF1 (((uint16_t) 23) | NODE_ID_SWTL) /* Symbolic name of the signal SteerWhlTouchBdCrsResuQf1 */
#define SIG_STEERWHLTOUCHBDCRSRESUSTEERWHLTOUCHBDSTS (((uint16_t) 24) | NODE_ID_SWTL) /* Symbolic name of the signal SteerWhlTouchBdCrsResuSteerWhlTouchBdSts */
#define SIG_STEERWHLTOUCHBDCRSRESU_UB (((uint16_t) 25) | NODE_ID_SWTL) /* Symbolic name of the signal SteerWhlTouchBdCrsResu_UB */
#define SIG_STEERWHLTOUCHBDLECHKS (((uint16_t) 26) | NODE_ID_SWTL) /* Symbolic name of the signal SteerWhlTouchBdLeChks */
#define SIG_STEERWHLTOUCHBDLECNTR (((uint16_t) 27) | NODE_ID_SWTL) /* Symbolic name of the signal SteerWhlTouchBdLeCntr */
#define SIG_STEERWHLTOUCHBDLESTEERWHLTOUCHBDSTS (((uint16_t) 28) | NODE_ID_SWTL) /* Symbolic name of the signal SteerWhlTouchBdLeSteerWhlTouchBdSts */
#define SIG_STEERWHLTOUCHBDLETOUCHPOSNX (((uint16_t) 29) | NODE_ID_SWTL) /* Symbolic name of the signal SteerWhlTouchBdLeTouchPosnX */
#define SIG_STEERWHLTOUCHBDLETOUCHPOSNY (((uint16_t) 30) | NODE_ID_SWTL) /* Symbolic name of the signal SteerWhlTouchBdLeTouchPosnY */
#define SIG_STEERWHLTOUCHBDLE_UB (((uint16_t) 31) | NODE_ID_SWTL) /* Symbolic name of the signal SteerWhlTouchBdLe_UB */
#define SIG_SWPLERISTSLE (((uint16_t) 32) | NODE_ID_SWTL) /* Symbolic name of the signal SwpLeRiStsLe */
#define SIG_SWPLERISTSLE_UB (((uint16_t) 33) | NODE_ID_SWTL) /* Symbolic name of the signal SwpLeRiStsLe_UB */
#define SIG_SWPUPDWNSTSLE (((uint16_t) 34) | NODE_ID_SWTL) /* Symbolic name of the signal SwpUpDwnStsLe */
#define SIG_SWPUPDWNSTSLE_UB (((uint16_t) 35) | NODE_ID_SWTL) /* Symbolic name of the signal SwpUpDwnStsLe_UB */
#define SIG_SWTLPARTNO10CMPLENDSGN1 (((uint16_t) 36) | NODE_ID_SWTL) /* Symbolic name of the signal SWTLPartNo10CmplEndSgn1 */
#define SIG_SWTLPARTNO10CMPLENDSGN2 (((uint16_t) 37) | NODE_ID_SWTL) /* Symbolic name of the signal SWTLPartNo10CmplEndSgn2 */
#define SIG_SWTLPARTNO10CMPLENDSGN3 (((uint16_t) 38) | NODE_ID_SWTL) /* Symbolic name of the signal SWTLPartNo10CmplEndSgn3 */
#define SIG_SWTLPARTNO10CMPLNR1 (((uint16_t) 39) | NODE_ID_SWTL) /* Symbolic name of the signal SWTLPartNo10CmplNr1 */
#define SIG_SWTLPARTNO10CMPLNR2 (((uint16_t) 40) | NODE_ID_SWTL) /* Symbolic name of the signal SWTLPartNo10CmplNr2 */
#define SIG_SWTLPARTNO10CMPLNR3 (((uint16_t) 41) | NODE_ID_SWTL) /* Symbolic name of the signal SWTLPartNo10CmplNr3 */
#define SIG_SWTLPARTNO10CMPLNR4 (((uint16_t) 42) | NODE_ID_SWTL) /* Symbolic name of the signal SWTLPartNo10CmplNr4 */
#define SIG_SWTLPARTNO10CMPLNR5 (((uint16_t) 43) | NODE_ID_SWTL) /* Symbolic name of the signal SWTLPartNo10CmplNr5 */
#define SIG_SWTLPARTNOCMPLENDSGN1 (((uint16_t) 44) | NODE_ID_SWTL) /* Symbolic name of the signal SWTLPartNoCmplEndSgn1 */
#define SIG_SWTLPARTNOCMPLENDSGN2 (((uint16_t) 45) | NODE_ID_SWTL) /* Symbolic name of the signal SWTLPartNoCmplEndSgn2 */
#define SIG_SWTLPARTNOCMPLENDSGN3 (((uint16_t) 46) | NODE_ID_SWTL) /* Symbolic name of the signal SWTLPartNoCmplEndSgn3 */
#define SIG_SWTLPARTNOCMPLNR1 (((uint16_t) 47) | NODE_ID_SWTL) /* Symbolic name of the signal SWTLPartNoCmplNr1 */
#define SIG_SWTLPARTNOCMPLNR2 (((uint16_t) 48) | NODE_ID_SWTL) /* Symbolic name of the signal SWTLPartNoCmplNr2 */
#define SIG_SWTLPARTNOCMPLNR3 (((uint16_t) 49) | NODE_ID_SWTL) /* Symbolic name of the signal SWTLPartNoCmplNr3 */
#define SIG_SWTLPARTNOCMPLNR4 (((uint16_t) 50) | NODE_ID_SWTL) /* Symbolic name of the signal SWTLPartNoCmplNr4 */
#define SIG_SWTLPARTNOCMPL_UB (((uint16_t) 51) | NODE_ID_SWTL) /* Symbolic name of the signal SWTLPartNoCmpl_UB */
#define SIG_SWTLPRESSBASELINE (((uint16_t) 52) | NODE_ID_SWTL) /* Symbolic name of the signal SwtlPressBaseline */
#define SIG_SWTLPRESSSIGNAL (((uint16_t) 53) | NODE_ID_SWTL) /* Symbolic name of the signal SwtlPressSignal */
#define SIG_SWTLSENSOR10_BASELINE (((uint16_t) 54) | NODE_ID_SWTL) /* Symbolic name of the signal SwtLsensor10_baseline */
#define SIG_SWTLSENSOR10_SIGNAL (((uint16_t) 55) | NODE_ID_SWTL) /* Symbolic name of the signal SwtLSensor10_signal */
#define SIG_SWTLSENSOR11_BASELINE (((uint16_t) 56) | NODE_ID_SWTL) /* Symbolic name of the signal SwtLsensor11_baseline */
#define SIG_SWTLSENSOR11_SIGNAL (((uint16_t) 57) | NODE_ID_SWTL) /* Symbolic name of the signal SwtLSensor11_signal */
#define SIG_SWTLSENSOR12_BASELINE (((uint16_t) 58) | NODE_ID_SWTL) /* Symbolic name of the signal SwtLsensor12_baseline */
#define SIG_SWTLSENSOR12_SIGNAL (((uint16_t) 59) | NODE_ID_SWTL) /* Symbolic name of the signal SwtLSensor12_signal */
#define SIG_SWTLSENSOR13_BASELINE (((uint16_t) 60) | NODE_ID_SWTL) /* Symbolic name of the signal SwtLsensor13_baseline */
#define SIG_SWTLSENSOR13_SIGNAL (((uint16_t) 61) | NODE_ID_SWTL) /* Symbolic name of the signal SwtLSensor13_signal */
#define SIG_SWTLSENSOR14_BASELINE (((uint16_t) 62) | NODE_ID_SWTL) /* Symbolic name of the signal SwtLsensor14_baseline */
#define SIG_SWTLSENSOR14_SIGNAL (((uint16_t) 63) | NODE_ID_SWTL) /* Symbolic name of the signal SwtLSensor14_signal */
#define SIG_SWTLSENSOR15_BASELINE (((uint16_t) 64) | NODE_ID_SWTL) /* Symbolic name of the signal SwtLsensor15_baseline */
#define SIG_SWTLSENSOR15_SIGNAL (((uint16_t) 65) | NODE_ID_SWTL) /* Symbolic name of the signal SwtLSensor15_signal */
#define SIG_SWTLSENSOR16_BASELINE (((uint16_t) 66) | NODE_ID_SWTL) /* Symbolic name of the signal SwtLsensor16_baseline */
#define SIG_SWTLSENSOR16_SIGNAL (((uint16_t) 67) | NODE_ID_SWTL) /* Symbolic name of the signal SwtLSensor16_signal */
#define SIG_SWTLSENSOR1_BASELINE (((uint16_t) 68) | NODE_ID_SWTL) /* Symbolic name of the signal SwtLsensor1_baseline */
#define SIG_SWTLSENSOR1_SIGNAL (((uint16_t) 69) | NODE_ID_SWTL) /* Symbolic name of the signal SwtLSensor1_signal */
#define SIG_SWTLSENSOR2_BASELINE (((uint16_t) 70) | NODE_ID_SWTL) /* Symbolic name of the signal SwtLSensor2_baseline */
#define SIG_SWTLSENSOR2_SINGAL (((uint16_t) 71) | NODE_ID_SWTL) /* Symbolic name of the signal SwtLSensor2_singal */
#define SIG_SWTLSENSOR3_BASELINE (((uint16_t) 72) | NODE_ID_SWTL) /* Symbolic name of the signal SwtLsensor3_baseline */
#define SIG_SWTLSENSOR3_SIGNAL (((uint16_t) 73) | NODE_ID_SWTL) /* Symbolic name of the signal SwtLSensor3_signal */
#define SIG_SWTLSENSOR4_BASELINE (((uint16_t) 74) | NODE_ID_SWTL) /* Symbolic name of the signal SwtLsensor4_baseline */
#define SIG_SWTLSENSOR4_SIGNAL (((uint16_t) 75) | NODE_ID_SWTL) /* Symbolic name of the signal SwtLSensor4_signal */
#define SIG_SWTLSENSOR5_BASELINE (((uint16_t) 76) | NODE_ID_SWTL) /* Symbolic name of the signal SwtLsensor5_baseline */
#define SIG_SWTLSENSOR5_SIGNAL (((uint16_t) 77) | NODE_ID_SWTL) /* Symbolic name of the signal SwtLSensor5_signal */
#define SIG_SWTLSENSOR6_BASELINE (((uint16_t) 78) | NODE_ID_SWTL) /* Symbolic name of the signal SwtLsensor6_baseline */
#define SIG_SWTLSENSOR6_SIGNAL (((uint16_t) 79) | NODE_ID_SWTL) /* Symbolic name of the signal SwtLSensor6_signal */
#define SIG_SWTLSENSOR7_BASELINE (((uint16_t) 80) | NODE_ID_SWTL) /* Symbolic name of the signal SwtLsensor7_baseline */
#define SIG_SWTLSENSOR7_SIGNAL (((uint16_t) 81) | NODE_ID_SWTL) /* Symbolic name of the signal SwtLSensor7_signal */
#define SIG_SWTLSENSOR8_BASELINE (((uint16_t) 82) | NODE_ID_SWTL) /* Symbolic name of the signal SwtLsensor8_baseline */
#define SIG_SWTLSENSOR8_SIGNAL (((uint16_t) 83) | NODE_ID_SWTL) /* Symbolic name of the signal SwtLSensor8_signal */
#define SIG_SWTLSENSOR9_BASELINE (((uint16_t) 84) | NODE_ID_SWTL) /* Symbolic name of the signal SwtLsensor9_baseline */
#define SIG_SWTLSENSOR9_SIGNAL (((uint16_t) 85) | NODE_ID_SWTL) /* Symbolic name of the signal SwtLSensor9_signal */
#define SIG_SWTLSERNONR1 (((uint16_t) 86) | NODE_ID_SWTL) /* Symbolic name of the signal SWTLSerNoNr1 */
#define SIG_SWTLSERNONR2 (((uint16_t) 87) | NODE_ID_SWTL) /* Symbolic name of the signal SWTLSerNoNr2 */
#define SIG_SWTLSERNONR3 (((uint16_t) 88) | NODE_ID_SWTL) /* Symbolic name of the signal SWTLSerNoNr3 */
#define SIG_SWTLSERNONR4 (((uint16_t) 89) | NODE_ID_SWTL) /* Symbolic name of the signal SWTLSerNoNr4 */
#define SIG_SWTLSERNO_UB (((uint16_t) 90) | NODE_ID_SWTL) /* Symbolic name of the signal SWTLSerNo_UB */

/* Symbolic names for Tx signals with dynamic length */ 
/* First Tx signal */
#define FIRST_TX_DYN_LEN_SIGNAL_SYMBOLIC_NAME ((~NODE_ID_MASK) & SIG_DIAGNOSTICRESPSWTL)
#define SIG_DIAGNOSTICRESPSWTL (((UI_16) 91) | NODE_ID_SWTL) /* Symbolic name of the signal SIG_DIAGNOSTICRESPSWTL */
/* Last Tx signal */
#define LAST_TX_DYN_LEN_SIGNAL_SYMBOLIC_NAME ((~NODE_ID_MASK) & SIG_DIAGNOSTICRESPSWTL)
/* Last Tx signal */
#define LAST_TX_STA_LEN_SIGNAL_SYMBOLIC_NAME ((~NODE_ID_MASK) & SIG_DIAGNOSTICRESPSWTL)


/* Symbolic names for Rx signals */ 
#define SIG_ACTVNOFSTEERWHLILLMN (((uint16_t) 92) | NODE_ID_SWTL) /* Symbolic name of the signal ActvnOfSteerWhlIllmn */
#define SIG_ACTVNOFSTEERWHLILLMN_UB (((uint16_t) 93) | NODE_ID_SWTL) /* Symbolic name of the signal ActvnOfSteerWhlIllmn_UB */
#define SIG_INTRBRISTS (((uint16_t) 94) | NODE_ID_SWTL) /* Symbolic name of the signal IntrBriSts */
#define SIG_INTRBRISTS_UB (((uint16_t) 95) | NODE_ID_SWTL) /* Symbolic name of the signal IntrBriSts_UB */
#define SIG_SWTOFKEYTONE (((uint16_t) 96) | NODE_ID_SWTL) /* Symbolic name of the signal SwtOfKeyTone */
#define SIG_SWTOFKEYTONE_UB (((uint16_t) 97) | NODE_ID_SWTL) /* Symbolic name of the signal SwtOfKeyTone_UB */
#define SIG_TWLIBRISTS (((uint16_t) 98) | NODE_ID_SWTL) /* Symbolic name of the signal TwliBriSts */
#define SIG_TWLIBRISTS_UB (((uint16_t) 99) | NODE_ID_SWTL) /* Symbolic name of the signal TwliBriSts_UB */

/*Symbolic names for Rx signals with dynamic length*/
#define SIG_DIAGNOSTICREQSWTL (((UI_16) 100) | NODE_ID_SWTL) /* Symbolic name of the signal SIG_DIAGNOSTICREQSWTL */
#define SIG_DIAGNOSTICFUNCADDRREQ (((UI_16) 101) | NODE_ID_SWTL) /* Symbolic name of the signal DiagnosticFuncAddrReq */
/* Last Rx signal */
#define LAST_RX_STA_LEN_SIGNAL_SYMBOLIC_NAME ((~NODE_ID_MASK) & SIG_DIAGNOSTICFUNCADDRREQ)

/* Last OsekCom signal */
#define LAST_OSEK_COM_SIGNAL_SYMBOLIC_NAME ((uint16_t) 101) 

/* Symbolic names for Dummy signal */ 
#define SIGDUMMY ((uint16_t)0x0FFF) /* Symbolic name of the signal SIGDUMMY */


/*----------------------------- Data Types -------------------------------*/
/* Type definition of internal signals */
typedef uint8_t t_sig_diagcfailrtouchpanswtlvibrationfltsts;
typedef uint8_t t_sig_diagcfailrtouchpanswtltouchdfltsts;
typedef uint8_t t_sig_diagcfailrtouchpanswtlsnsrfltsts;
typedef uint8_t t_sig_diagcfailrtouchpanswtlcmnfltsts;
typedef uint8_t t_sig_diagcfailrtouchpanswtl_ub;
typedef uint8_t t_sig_swtlsernonr4;
typedef uint8_t t_sig_swtlsernonr3;
typedef uint8_t t_sig_swtlsernonr2;
typedef uint8_t t_sig_swtlsernonr1;
typedef uint8_t t_sig_swtlserno_ub;
typedef uint8_t t_sig_swtlpartnocmplnr4;
typedef uint8_t t_sig_swtlpartnocmplnr3;
typedef uint8_t t_sig_swtlpartnocmplnr2;
typedef uint8_t t_sig_swtlpartnocmplnr1;
typedef uint8_t t_sig_swtlpartnocmplendsgn3;
typedef uint8_t t_sig_swtlpartnocmplendsgn2;
typedef uint8_t t_sig_swtlpartnocmplendsgn1;
typedef uint8_t t_sig_swtlpartnocmpl_ub;
typedef uint8_t t_sig_swtlpartno10cmplnr5;
typedef uint8_t t_sig_swtlpartno10cmplnr4;
typedef uint8_t t_sig_swtlpartno10cmplnr3;
typedef uint8_t t_sig_swtlpartno10cmplnr2;
typedef uint8_t t_sig_swtlpartno10cmplnr1;
typedef uint8_t t_sig_swtlpartno10cmplendsgn3;
typedef uint8_t t_sig_swtlpartno10cmplendsgn2;
typedef uint8_t t_sig_swtlpartno10cmplendsgn1;
typedef uint8_t t_sig_swpupdwnstsle_ub;
typedef uint8_t t_sig_swpupdwnstsle;
typedef uint8_t t_sig_swpleristsle_ub;
typedef uint8_t t_sig_swpleristsle;
typedef uint8_t t_sig_steerwhltouchbdcrsresusteerwhltouchbdsts;
typedef uint8_t t_sig_steerwhltouchbdcrsresuqf1;
typedef uint8_t t_sig_steerwhltouchbdcrsresu_ub;
typedef uint8_t t_sig_steerwhltouchbdcnclsteerwhltouchbdsts;
typedef uint8_t t_sig_steerwhltouchbdcnclqf1;
typedef uint8_t t_sig_steerwhltouchbdcnclcntr;
typedef uint8_t t_sig_steerwhltouchbdcnclchks;
typedef uint8_t t_sig_steerwhltouchbdcncl_ub;
typedef uint8_t t_sig_steerwhltouchbdadas_ub;
typedef uint8_t t_sig_steerwhltouchbdadas;
typedef uint8_t t_sig_lemfctactsgup_ub;
typedef uint8_t t_sig_lemfctactsgup;
typedef uint8_t t_sig_lemfctactsgri_ub;
typedef uint8_t t_sig_lemfctactsgri;
typedef uint8_t t_sig_lemfctactsgle_ub;
typedef uint8_t t_sig_lemfctactsgle;
typedef uint8_t t_sig_lemfctactsgdn_ub;
typedef uint8_t t_sig_lemfctactsgdn;
typedef uint8_t t_sig_lemfctactsgce_ub;
typedef uint8_t t_sig_lemfctactsgce;
typedef uint8_t t_sig_steerwhltouchbdletouchposny;
typedef uint8_t t_sig_steerwhltouchbdletouchposnx;
typedef uint8_t t_sig_steerwhltouchbdlesteerwhltouchbdsts;
typedef uint8_t t_sig_steerwhltouchbdlecntr;
typedef uint8_t t_sig_steerwhltouchbdlechks;
typedef uint8_t t_sig_steerwhltouchbdle_ub;
typedef uint16_t t_sig_swtlpressbaseline;
typedef uint16_t t_sig_swtlpresssignal;
typedef uint16_t t_sig_swtlsensor1_baseline;
typedef uint16_t t_sig_swtlsensor1_signal;
typedef uint16_t t_sig_swtlsensor2_baseline;
typedef uint16_t t_sig_swtlsensor2_singal;
typedef uint16_t t_sig_swtlsensor3_baseline;
typedef uint16_t t_sig_swtlsensor3_signal;
typedef uint16_t t_sig_swtlsensor4_baseline;
typedef uint16_t t_sig_swtlsensor4_signal;
typedef uint16_t t_sig_swtlsensor5_baseline;
typedef uint16_t t_sig_swtlsensor5_signal;
typedef uint16_t t_sig_swtlsensor6_baseline;
typedef uint16_t t_sig_swtlsensor6_signal;
typedef uint16_t t_sig_swtlsensor7_baseline;
typedef uint16_t t_sig_swtlsensor7_signal;
typedef uint16_t t_sig_swtlsensor8_baseline;
typedef uint16_t t_sig_swtlsensor8_signal;
typedef uint16_t t_sig_swtlsensor9_baseline;
typedef uint16_t t_sig_swtlsensor9_signal;
typedef uint16_t t_sig_swtlsensor10_baseline;
typedef uint16_t t_sig_swtlsensor10_signal;
typedef uint16_t t_sig_swtlsensor11_baseline;
typedef uint16_t t_sig_swtlsensor11_signal;
typedef uint16_t t_sig_swtlsensor12_baseline;
typedef uint16_t t_sig_swtlsensor12_signal;
typedef uint16_t t_sig_swtlsensor13_baseline;
typedef uint16_t t_sig_swtlsensor13_signal;
typedef uint16_t t_sig_swtlsensor14_baseline;
typedef uint16_t t_sig_swtlsensor14_signal;
typedef uint16_t t_sig_swtlsensor15_baseline;
typedef uint16_t t_sig_swtlsensor15_signal;
typedef uint16_t t_sig_swtlsensor16_baseline;
typedef uint16_t t_sig_swtlsensor16_signal;
typedef uint8_t t_sig_twlibrists_ub;
typedef uint8_t t_sig_twlibrists;
typedef uint8_t t_sig_swtofkeytone_ub;
typedef uint8_t t_sig_swtofkeytone;
typedef uint8_t t_sig_intrbrists_ub;
typedef uint8_t t_sig_intrbrists;
typedef uint8_t t_sig_actvnofsteerwhlillmn_ub;
typedef uint8_t t_sig_actvnofsteerwhlillmn;


#ifndef _OSEKCOM_H
#define _OSEKCOM_H

/* Type definition of the symbolic names for signals */
typedef uint16_t t_symbolic_name;
typedef uint16_t t_symbolic_frm_name;

/* Return type of the calls OSEK COM */
typedef uint8_t t_status_type;

/* Structure of data type passed by reference in */
/* the calls of OSEK COM                         */
typedef void *t_application_data_ref;
typedef void *t_length_ref; 

/* Flag types of OSEK COM */
typedef enum {
    COM_FALSE = 0x00, /* Flag down  */
    COM_TRUE  = 0x01  /* Flag up */
} t_flag_value;

/* Stop mode of OSEK COM */
typedef enum {
    COM_SHUTDOWN_IMMEDIATE = 0 /* Apagat immediat */
} t_com_shutdown_mode_type;

/* Initialize mode of OSEK COM */
typedef enum {
    COM_NORMAL_MODE = 0 /* No es processen trames de COM de Debug */
} t_com_application_mode_type;

#endif


	
/*--------------------------- Global Variables ---------------------------*/

/*----------- Prototypes of Callback Function Provided by User  ----------*/
    
/*---------------------------------------------------------------------------
| Portability:  Target platform independent
|----------------------------------------------------------------------------
| Routine description:
| * Notification Callbacks provided by user for class 1 (RxNotif), 3 (RxErrorNotif)
|   2 (TxNotif) and 4 (TxErrorNotif)
| ---------------------------------------------------------------------------
| Parameters description:
/ ------------------------------------------------- -------------------------- */
#define COMCallback(CallbackRoutineName) void CallbackRoutineName(void)

COMCallback(IhuPrivateDHUCanFr01_CALLBACK);
COMCallback(IhuPrivateDHUCanFr01_Timeout_CALLBACK);


/* --------------------------- Routine Prototypes --------------------------- */
typedef uint8_t t_com_buf_hdl;
/*---------------------------------------------------------------------------
| 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 OsekComRxNotifCallbackSWTL(t_com_buf_hdl bhdl);

/*---------------------------------------------------------------------------
| 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 OsekComTxReqCallbackSWTL(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 OsekComTxNotifCallbackSWTL(t_com_buf_hdl bhdl);

/*---------------------------------------------------------------------------
| 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);

/*---------------------------------------------------------------------------
| 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);

/*---------------------------------------------------------------------------
| 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);

/*---------------------------------------------------------------------------
| 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);

/*---------------------------------------------------------------------------
| 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);

/*---------------------------------------------------------------------------
| 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);

/*---------------------------------------------------------------------------
| 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).
/---------------------------------------------------------------------------*/
#define OSEK_SENDMESSAGE
t_status_type SendMessage(t_symbolic_name message,
                          t_application_data_ref data_ref);

/*---------------------------------------------------------------------------
| 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);

/*---------------------------------------------------------------------------
| 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 ReadFlagComTrafficSWTL(void);

/*---------------------------------------------------------------------------
| Portability:  Target platform independent
|----------------------------------------------------------------------------
| Routine description:
|  * Reset service for the flag of COM traffic.
|---------------------------------------------------------------------------
| Parameters description:
/---------------------------------------------------------------------------*/
void ResetFlagComTrafficSWTL(void);

/*---------------------------------------------------------------------------
| 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 ReadFlagTxSigDiagcFailrTouchPanSWTLVibrationFltSts(void);
t_flag_value ReadFlagTxSigDiagcFailrTouchPanSWTLTouchdFltSts(void);
t_flag_value ReadFlagTxSigDiagcFailrTouchPanSWTLSnsrFltSts(void);
t_flag_value ReadFlagTxSigDiagcFailrTouchPanSWTLCmnFltSts(void);
t_flag_value ReadFlagTxSigDiagcFailrTouchPanSWTL_UB(void);
t_flag_value ReadFlagTxSigSWTLSerNoNr4(void);
t_flag_value ReadFlagTxSigSWTLSerNoNr3(void);
t_flag_value ReadFlagTxSigSWTLSerNoNr2(void);
t_flag_value ReadFlagTxSigSWTLSerNoNr1(void);
t_flag_value ReadFlagTxSigSWTLSerNo_UB(void);
t_flag_value ReadFlagTxSigSWTLPartNoCmplNr4(void);
t_flag_value ReadFlagTxSigSWTLPartNoCmplNr3(void);
t_flag_value ReadFlagTxSigSWTLPartNoCmplNr2(void);
t_flag_value ReadFlagTxSigSWTLPartNoCmplNr1(void);
t_flag_value ReadFlagTxSigSWTLPartNoCmplEndSgn3(void);
t_flag_value ReadFlagTxSigSWTLPartNoCmplEndSgn2(void);
t_flag_value ReadFlagTxSigSWTLPartNoCmplEndSgn1(void);
t_flag_value ReadFlagTxSigSWTLPartNoCmpl_UB(void);
t_flag_value ReadFlagTxSigSWTLPartNo10CmplNr5(void);
t_flag_value ReadFlagTxSigSWTLPartNo10CmplNr4(void);
t_flag_value ReadFlagTxSigSWTLPartNo10CmplNr3(void);
t_flag_value ReadFlagTxSigSWTLPartNo10CmplNr2(void);
t_flag_value ReadFlagTxSigSWTLPartNo10CmplNr1(void);
t_flag_value ReadFlagTxSigSWTLPartNo10CmplEndSgn3(void);
t_flag_value ReadFlagTxSigSWTLPartNo10CmplEndSgn2(void);
t_flag_value ReadFlagTxSigSWTLPartNo10CmplEndSgn1(void);
t_flag_value ReadFlagTxSigSwpUpDwnStsLe_UB(void);
t_flag_value ReadFlagTxSigSwpUpDwnStsLe(void);
t_flag_value ReadFlagTxSigSwpLeRiStsLe_UB(void);
t_flag_value ReadFlagTxSigSwpLeRiStsLe(void);
t_flag_value ReadFlagTxSigSteerWhlTouchBdCrsResuSteerWhlTouchBdSts(void);
t_flag_value ReadFlagTxSigSteerWhlTouchBdCrsResuQf1(void);
t_flag_value ReadFlagTxSigSteerWhlTouchBdCrsResu_UB(void);
t_flag_value ReadFlagTxSigSteerWhlTouchBdCnclSteerWhlTouchBdSts(void);
t_flag_value ReadFlagTxSigSteerWhlTouchBdCnclQf1(void);
t_flag_value ReadFlagTxSigSteerWhlTouchBdCnclCntr(void);
t_flag_value ReadFlagTxSigSteerWhlTouchBdCnclChks(void);
t_flag_value ReadFlagTxSigSteerWhlTouchBdCncl_UB(void);
t_flag_value ReadFlagTxSigSteerWhlTouchBdADAS_UB(void);
t_flag_value ReadFlagTxSigSteerWhlTouchBdADAS(void);
t_flag_value ReadFlagTxSigLeMFctActSgUp_UB(void);
t_flag_value ReadFlagTxSigLeMFctActSgUp(void);
t_flag_value ReadFlagTxSigLeMFctActSgRi_UB(void);
t_flag_value ReadFlagTxSigLeMFctActSgRi(void);
t_flag_value ReadFlagTxSigLeMFctActSgLe_UB(void);
t_flag_value ReadFlagTxSigLeMFctActSgLe(void);
t_flag_value ReadFlagTxSigLeMFctActSgDn_UB(void);
t_flag_value ReadFlagTxSigLeMFctActSgDn(void);
t_flag_value ReadFlagTxSigLeMFctActSgCe_UB(void);
t_flag_value ReadFlagTxSigLeMFctActSgCe(void);
t_flag_value ReadFlagTxSigSteerWhlTouchBdLeTouchPosnY(void);
t_flag_value ReadFlagTxSigSteerWhlTouchBdLeTouchPosnX(void);
t_flag_value ReadFlagTxSigSteerWhlTouchBdLeSteerWhlTouchBdSts(void);
t_flag_value ReadFlagTxSigSteerWhlTouchBdLeCntr(void);
t_flag_value ReadFlagTxSigSteerWhlTouchBdLeChks(void);
t_flag_value ReadFlagTxSigSteerWhlTouchBdLe_UB(void);
t_flag_value ReadFlagTxSigDiagnosticRespSWTL(void);
t_flag_value ReadFlagRxSigDiagnosticReqSWTL(void);
t_flag_value ReadFlagRxSigDiagnosticFuncAddrReq(void);
/*---------------------------------------------------------------------------
| 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);
void ResetFlagTxSigDiagcFailrTouchPanSWTLVibrationFltSts(void);
void ResetFlagTxSigDiagcFailrTouchPanSWTLTouchdFltSts(void);
void ResetFlagTxSigDiagcFailrTouchPanSWTLSnsrFltSts(void);
void ResetFlagTxSigDiagcFailrTouchPanSWTLCmnFltSts(void);
void ResetFlagTxSigDiagcFailrTouchPanSWTL_UB(void);
void ResetFlagTxSigSWTLSerNoNr4(void);
void ResetFlagTxSigSWTLSerNoNr3(void);
void ResetFlagTxSigSWTLSerNoNr2(void);
void ResetFlagTxSigSWTLSerNoNr1(void);
void ResetFlagTxSigSWTLSerNo_UB(void);
void ResetFlagTxSigSWTLPartNoCmplNr4(void);
void ResetFlagTxSigSWTLPartNoCmplNr3(void);
void ResetFlagTxSigSWTLPartNoCmplNr2(void);
void ResetFlagTxSigSWTLPartNoCmplNr1(void);
void ResetFlagTxSigSWTLPartNoCmplEndSgn3(void);
void ResetFlagTxSigSWTLPartNoCmplEndSgn2(void);
void ResetFlagTxSigSWTLPartNoCmplEndSgn1(void);
void ResetFlagTxSigSWTLPartNoCmpl_UB(void);
void ResetFlagTxSigSWTLPartNo10CmplNr5(void);
void ResetFlagTxSigSWTLPartNo10CmplNr4(void);
void ResetFlagTxSigSWTLPartNo10CmplNr3(void);
void ResetFlagTxSigSWTLPartNo10CmplNr2(void);
void ResetFlagTxSigSWTLPartNo10CmplNr1(void);
void ResetFlagTxSigSWTLPartNo10CmplEndSgn3(void);
void ResetFlagTxSigSWTLPartNo10CmplEndSgn2(void);
void ResetFlagTxSigSWTLPartNo10CmplEndSgn1(void);
void ResetFlagTxSigSwpUpDwnStsLe_UB(void);
void ResetFlagTxSigSwpUpDwnStsLe(void);
void ResetFlagTxSigSwpLeRiStsLe_UB(void);
void ResetFlagTxSigSwpLeRiStsLe(void);
void ResetFlagTxSigSteerWhlTouchBdCrsResuSteerWhlTouchBdSts(void);
void ResetFlagTxSigSteerWhlTouchBdCrsResuQf1(void);
void ResetFlagTxSigSteerWhlTouchBdCrsResu_UB(void);
void ResetFlagTxSigSteerWhlTouchBdCnclSteerWhlTouchBdSts(void);
void ResetFlagTxSigSteerWhlTouchBdCnclQf1(void);
void ResetFlagTxSigSteerWhlTouchBdCnclCntr(void);
void ResetFlagTxSigSteerWhlTouchBdCnclChks(void);
void ResetFlagTxSigSteerWhlTouchBdCncl_UB(void);
void ResetFlagTxSigSteerWhlTouchBdADAS_UB(void);
void ResetFlagTxSigSteerWhlTouchBdADAS(void);
void ResetFlagTxSigLeMFctActSgUp_UB(void);
void ResetFlagTxSigLeMFctActSgUp(void);
void ResetFlagTxSigLeMFctActSgRi_UB(void);
void ResetFlagTxSigLeMFctActSgRi(void);
void ResetFlagTxSigLeMFctActSgLe_UB(void);
void ResetFlagTxSigLeMFctActSgLe(void);
void ResetFlagTxSigLeMFctActSgDn_UB(void);
void ResetFlagTxSigLeMFctActSgDn(void);
void ResetFlagTxSigLeMFctActSgCe_UB(void);
void ResetFlagTxSigLeMFctActSgCe(void);
void ResetFlagTxSigSteerWhlTouchBdLeTouchPosnY(void);
void ResetFlagTxSigSteerWhlTouchBdLeTouchPosnX(void);
void ResetFlagTxSigSteerWhlTouchBdLeSteerWhlTouchBdSts(void);
void ResetFlagTxSigSteerWhlTouchBdLeCntr(void);
void ResetFlagTxSigSteerWhlTouchBdLeChks(void);
void ResetFlagTxSigSteerWhlTouchBdLe_UB(void);
void ResetFlagTxSigDiagnosticRespSWTL(void);
void ResetFlagRxSig(t_symbolic_name message);
void ResetFlagRxSigDiagnosticReqSWTL(void);
void ResetFlagRxSigDiagnosticFuncAddrReq(void);
/*---------------------------------------------------------------------------
| 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);
void OsekComTxReqFrmSwtlPrivateDHUCanFr01(void);
void OsekComTxReqFrmSwtlPrivateDHUCanFr02(void);



void OsekComSetFR09data(uint8_t data[]);
void OsekComSetFR0Adata(uint8_t data[]);
void OsekComSetFR0Bdata(uint8_t data[]);
void OsekComSetFR0Cdata(uint8_t data[]);



#endif
