
#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_DiagcFailrTouchPanSWTRVibrationFltSts */
#define SIG_DIAGCFAILRTOUCHPANSWTRVIBRATIONFLTSTS_FLTSTS_INVALID ((t_sig_diagcfailrtouchpanswtrvibrationfltsts) 3)
#define SIG_DIAGCFAILRTOUCHPANSWTRVIBRATIONFLTSTS_FLTSTS_VIBRATIONOPENCIRC ((t_sig_diagcfailrtouchpanswtrvibrationfltsts) 2)
#define SIG_DIAGCFAILRTOUCHPANSWTRVIBRATIONFLTSTS_FLTSTS_VIBRATIONSHOCIRC ((t_sig_diagcfailrtouchpanswtrvibrationfltsts) 1)
#define SIG_DIAGCFAILRTOUCHPANSWTRVIBRATIONFLTSTS_FLTSTS_NOFLT ((t_sig_diagcfailrtouchpanswtrvibrationfltsts) 0)

/* Acceptable values for the signal sig_DiagcFailrTouchPanSWTRTouchdFltSts */
#define SIG_DIAGCFAILRTOUCHPANSWTRTOUCHDFLTSTS_FLTSTS_TOUCHDOUTDOFRNG ((t_sig_diagcfailrtouchpanswtrtouchdfltsts) 2)
#define SIG_DIAGCFAILRTOUCHPANSWTRTOUCHDFLTSTS_FLTSTS_TOUCHDINVLD ((t_sig_diagcfailrtouchpanswtrtouchdfltsts) 1)
#define SIG_DIAGCFAILRTOUCHPANSWTRTOUCHDFLTSTS_FLTSTS_NOFLT ((t_sig_diagcfailrtouchpanswtrtouchdfltsts) 0)

/* Acceptable values for the signal sig_DiagcFailrTouchPanSWTRSnsrFltSts */
#define SIG_DIAGCFAILRTOUCHPANSWTRSNSRFLTSTS_SNSRFLTSTS_FSNSROPENCIRC ((t_sig_diagcfailrtouchpanswtrsnsrfltsts) 4)
#define SIG_DIAGCFAILRTOUCHPANSWTRSNSRFLTSTS_SNSRFLTSTS_FSNSRSHOCIRCTOBATT ((t_sig_diagcfailrtouchpanswtrsnsrfltsts) 3)
#define SIG_DIAGCFAILRTOUCHPANSWTRSNSRFLTSTS_SNSRFLTSTS_FSNSRSHOCIRCTOGND ((t_sig_diagcfailrtouchpanswtrsnsrfltsts) 2)
#define SIG_DIAGCFAILRTOUCHPANSWTRSNSRFLTSTS_SNSRFLTSTS_FSNSRINVLD ((t_sig_diagcfailrtouchpanswtrsnsrfltsts) 1)
#define SIG_DIAGCFAILRTOUCHPANSWTRSNSRFLTSTS_SNSRFLTSTS_NOFLT ((t_sig_diagcfailrtouchpanswtrsnsrfltsts) 0)

/* Acceptable values for the signal sig_DiagcFailrTouchPanSWTRCmnFltSts */
#define SIG_DIAGCFAILRTOUCHPANSWTRCMNFLTSTS_CMNFLTSTS_OUTDURNG ((t_sig_diagcfailrtouchpanswtrcmnfltsts) 1)
#define SIG_DIAGCFAILRTOUCHPANSWTRCMNFLTSTS_CMNFLTSTS_NOFLT ((t_sig_diagcfailrtouchpanswtrcmnfltsts) 0)

/* Acceptable values for the signal sig_SwpUpDwnStsRi */
#define SIG_SWPUPDWNSTSRI_SWPUPDWNREQSTS_LONGSLIDEDOWN ((t_sig_swpupdwnstsri) 4)
#define SIG_SWPUPDWNSTSRI_SWPUPDWNREQSTS_LONGSLIDEUP ((t_sig_swpupdwnstsri) 3)
#define SIG_SWPUPDWNSTSRI_SWPUPDWNREQSTS_SHORTSLIDEDOWN ((t_sig_swpupdwnstsri) 2)
#define SIG_SWPUPDWNSTSRI_SWPUPDWNREQSTS_SHORTSLIDEUP ((t_sig_swpupdwnstsri) 1)
#define SIG_SWPUPDWNSTSRI_SWPUPDWNREQSTS_IDLE ((t_sig_swpupdwnstsri) 0)

/* Acceptable values for the signal sig_SwpLeRiStsRi */
#define SIG_SWPLERISTSRI_SWPLERIREQSTS_LONGSLIDERIGHT ((t_sig_swpleristsri) 4)
#define SIG_SWPLERISTSRI_SWPLERIREQSTS_LONGSLIDELEFT ((t_sig_swpleristsri) 3)
#define SIG_SWPLERISTSRI_SWPLERIREQSTS_SHORTSLIDERIGHT ((t_sig_swpleristsri) 2)
#define SIG_SWPLERISTSRI_SWPLERIREQSTS_SHORTSLIDELEFT ((t_sig_swpleristsri) 1)
#define SIG_SWPLERISTSRI_SWPLERIREQSTS_IDLE ((t_sig_swpleristsri) 0)

/* Acceptable values for the signal sig_SteerWhlTouchBdVoice */
#define SIG_STEERWHLTOUCHBDVOICE_STEERWHLTOUCHBDSTS_INVALID ((t_sig_steerwhltouchbdvoice) 3)
#define SIG_STEERWHLTOUCHBDVOICE_STEERWHLTOUCHBDSTS_TOUCHANDPRESS ((t_sig_steerwhltouchbdvoice) 2)
#define SIG_STEERWHLTOUCHBDVOICE_STEERWHLTOUCHBDSTS_TOUCH ((t_sig_steerwhltouchbdvoice) 1)
#define SIG_STEERWHLTOUCHBDVOICE_STEERWHLTOUCHBDSTS_NOTACTIVE ((t_sig_steerwhltouchbdvoice) 0)

/* Acceptable values for the signal sig_SteerWhlTouchBdMenu */
#define SIG_STEERWHLTOUCHBDMENU_STEERWHLTOUCHBDSTS_INVALID ((t_sig_steerwhltouchbdmenu) 3)
#define SIG_STEERWHLTOUCHBDMENU_STEERWHLTOUCHBDSTS_TOUCHANDPRESS ((t_sig_steerwhltouchbdmenu) 2)
#define SIG_STEERWHLTOUCHBDMENU_STEERWHLTOUCHBDSTS_TOUCH ((t_sig_steerwhltouchbdmenu) 1)
#define SIG_STEERWHLTOUCHBDMENU_STEERWHLTOUCHBDSTS_NOTACTIVE ((t_sig_steerwhltouchbdmenu) 0)

/* Acceptable values for the signal sig_SteerWhlTouchBdDn */
#define SIG_STEERWHLTOUCHBDDN_STEERWHLTOUCHBDSTS_INVALID ((t_sig_steerwhltouchbddn) 3)
#define SIG_STEERWHLTOUCHBDDN_STEERWHLTOUCHBDSTS_TOUCHANDPRESS ((t_sig_steerwhltouchbddn) 2)
#define SIG_STEERWHLTOUCHBDDN_STEERWHLTOUCHBDSTS_TOUCH ((t_sig_steerwhltouchbddn) 1)
#define SIG_STEERWHLTOUCHBDDN_STEERWHLTOUCHBDSTS_NOTACTIVE ((t_sig_steerwhltouchbddn) 0)

/* Acceptable values for the signal sig_SldVolCtrlSts */
#define SIG_SLDVOLCTRLSTS_SLIPSWITCH_ERROR ((t_sig_sldvolctrlsts) 7)
#define SIG_SLDVOLCTRLSTS_SLIPSWITCH_INCREASETHIRD ((t_sig_sldvolctrlsts) 6)
#define SIG_SLDVOLCTRLSTS_SLIPSWITCH_DECREASETHIRD ((t_sig_sldvolctrlsts) 5)
#define SIG_SLDVOLCTRLSTS_SLIPSWITCH_INCREASEDOUBLE ((t_sig_sldvolctrlsts) 4)
#define SIG_SLDVOLCTRLSTS_SLIPSWITCH_DECREASEDOUBLE ((t_sig_sldvolctrlsts) 3)
#define SIG_SLDVOLCTRLSTS_SLIPSWITCH_VOLUMEINCREASE ((t_sig_sldvolctrlsts) 2)
#define SIG_SLDVOLCTRLSTS_SLIPSWITCH_VOLUMEDECREASE ((t_sig_sldvolctrlsts) 1)
#define SIG_SLDVOLCTRLSTS_SLIPSWITCH_IDLE ((t_sig_sldvolctrlsts) 0)

/* Acceptable values for the signal sig_RiMFctActSgUp */
#define SIG_RIMFCTACTSGUP_STEERWHLTOUCHBDSTS_INVALID ((t_sig_rimfctactsgup) 3)
#define SIG_RIMFCTACTSGUP_STEERWHLTOUCHBDSTS_TOUCHANDPRESS ((t_sig_rimfctactsgup) 2)
#define SIG_RIMFCTACTSGUP_STEERWHLTOUCHBDSTS_TOUCH ((t_sig_rimfctactsgup) 1)
#define SIG_RIMFCTACTSGUP_STEERWHLTOUCHBDSTS_NOTACTIVE ((t_sig_rimfctactsgup) 0)

/* Acceptable values for the signal sig_RiMFctActSgRi */
#define SIG_RIMFCTACTSGRI_STEERWHLTOUCHBDSTS_INVALID ((t_sig_rimfctactsgri) 3)
#define SIG_RIMFCTACTSGRI_STEERWHLTOUCHBDSTS_TOUCHANDPRESS ((t_sig_rimfctactsgri) 2)
#define SIG_RIMFCTACTSGRI_STEERWHLTOUCHBDSTS_TOUCH ((t_sig_rimfctactsgri) 1)
#define SIG_RIMFCTACTSGRI_STEERWHLTOUCHBDSTS_NOTACTIVE ((t_sig_rimfctactsgri) 0)

/* Acceptable values for the signal sig_RiMFctActSgLe */
#define SIG_RIMFCTACTSGLE_STEERWHLTOUCHBDSTS_INVALID ((t_sig_rimfctactsgle) 3)
#define SIG_RIMFCTACTSGLE_STEERWHLTOUCHBDSTS_TOUCHANDPRESS ((t_sig_rimfctactsgle) 2)
#define SIG_RIMFCTACTSGLE_STEERWHLTOUCHBDSTS_TOUCH ((t_sig_rimfctactsgle) 1)
#define SIG_RIMFCTACTSGLE_STEERWHLTOUCHBDSTS_NOTACTIVE ((t_sig_rimfctactsgle) 0)

/* Acceptable values for the signal sig_RiMFctActSgDn */
#define SIG_RIMFCTACTSGDN_STEERWHLTOUCHBDSTS_INVALID ((t_sig_rimfctactsgdn) 3)
#define SIG_RIMFCTACTSGDN_STEERWHLTOUCHBDSTS_TOUCHANDPRESS ((t_sig_rimfctactsgdn) 2)
#define SIG_RIMFCTACTSGDN_STEERWHLTOUCHBDSTS_TOUCH ((t_sig_rimfctactsgdn) 1)
#define SIG_RIMFCTACTSGDN_STEERWHLTOUCHBDSTS_NOTACTIVE ((t_sig_rimfctactsgdn) 0)

/* Acceptable values for the signal sig_RiMFctActSgCe */
#define SIG_RIMFCTACTSGCE_STEERWHLTOUCHBDSTS_INVALID ((t_sig_rimfctactsgce) 3)
#define SIG_RIMFCTACTSGCE_STEERWHLTOUCHBDSTS_TOUCHANDPRESS ((t_sig_rimfctactsgce) 2)
#define SIG_RIMFCTACTSGCE_STEERWHLTOUCHBDSTS_TOUCH ((t_sig_rimfctactsgce) 1)
#define SIG_RIMFCTACTSGCE_STEERWHLTOUCHBDSTS_NOTACTIVE ((t_sig_rimfctactsgce) 0)

/* Acceptable values for the signal sig_SteerWhlTouchBdRiSteerWhlTouchBdSts */
#define SIG_STEERWHLTOUCHBDRISTEERWHLTOUCHBDSTS_STEERWHLTOUCHBDSTS_INVALID ((t_sig_steerwhltouchbdristeerwhltouchbdsts) 3)
#define SIG_STEERWHLTOUCHBDRISTEERWHLTOUCHBDSTS_STEERWHLTOUCHBDSTS_TOUCHANDPRESS ((t_sig_steerwhltouchbdristeerwhltouchbdsts) 2)
#define SIG_STEERWHLTOUCHBDRISTEERWHLTOUCHBDSTS_STEERWHLTOUCHBDSTS_TOUCH ((t_sig_steerwhltouchbdristeerwhltouchbdsts) 1)
#define SIG_STEERWHLTOUCHBDRISTEERWHLTOUCHBDSTS_STEERWHLTOUCHBDSTS_NOTACTIVE ((t_sig_steerwhltouchbdristeerwhltouchbdsts) 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_SWTR (((uint16_t) 0x1000U) & NODE_ID_MASK) /* Symbolic name of the node SWTR */

/* Symbolic names for Tx signals with static length */ 
/* First Tx signal */
#define FIRST_TX_STA_LEN_SIGNAL_SYMBOLIC_NAME ((~NODE_ID_MASK) & SIG_DIAGCFAILRTOUCHPANSWTRCMNFLTSTS)
#define SIG_DIAGCFAILRTOUCHPANSWTRCMNFLTSTS (((uint16_t) 1) | NODE_ID_SWTR) /* Symbolic name of the signal DiagcFailrTouchPanSWTRCmnFltSts */
#define SIG_DIAGCFAILRTOUCHPANSWTRSNSRFLTSTS (((uint16_t) 2) | NODE_ID_SWTR) /* Symbolic name of the signal DiagcFailrTouchPanSWTRSnsrFltSts */
#define SIG_DIAGCFAILRTOUCHPANSWTRTOUCHDFLTSTS (((uint16_t) 3) | NODE_ID_SWTR) /* Symbolic name of the signal DiagcFailrTouchPanSWTRTouchdFltSts */
#define SIG_DIAGCFAILRTOUCHPANSWTRVIBRATIONFLTSTS (((uint16_t) 4) | NODE_ID_SWTR) /* Symbolic name of the signal DiagcFailrTouchPanSWTRVibrationFltSts */
#define SIG_DIAGCFAILRTOUCHPANSWTR_UB (((uint16_t) 5) | NODE_ID_SWTR) /* Symbolic name of the signal DiagcFailrTouchPanSWTR_UB */
#define SIG_RIMFCTACTSGCE (((uint16_t) 6) | NODE_ID_SWTR) /* Symbolic name of the signal RiMFctActSgCe */
#define SIG_RIMFCTACTSGCE_UB (((uint16_t) 7) | NODE_ID_SWTR) /* Symbolic name of the signal RiMFctActSgCe_UB */
#define SIG_RIMFCTACTSGDN (((uint16_t) 8) | NODE_ID_SWTR) /* Symbolic name of the signal RiMFctActSgDn */
#define SIG_RIMFCTACTSGDN_UB (((uint16_t) 9) | NODE_ID_SWTR) /* Symbolic name of the signal RiMFctActSgDn_UB */
#define SIG_RIMFCTACTSGLE (((uint16_t) 10) | NODE_ID_SWTR) /* Symbolic name of the signal RiMFctActSgLe */
#define SIG_RIMFCTACTSGLE_UB (((uint16_t) 11) | NODE_ID_SWTR) /* Symbolic name of the signal RiMFctActSgLe_UB */
#define SIG_RIMFCTACTSGRI (((uint16_t) 12) | NODE_ID_SWTR) /* Symbolic name of the signal RiMFctActSgRi */
#define SIG_RIMFCTACTSGRI_UB (((uint16_t) 13) | NODE_ID_SWTR) /* Symbolic name of the signal RiMFctActSgRi_UB */
#define SIG_RIMFCTACTSGUP (((uint16_t) 14) | NODE_ID_SWTR) /* Symbolic name of the signal RiMFctActSgUp */
#define SIG_RIMFCTACTSGUP_UB (((uint16_t) 15) | NODE_ID_SWTR) /* Symbolic name of the signal RiMFctActSgUp_UB */
#define SIG_SLDVOLCTRLSTS (((uint16_t) 16) | NODE_ID_SWTR) /* Symbolic name of the signal SldVolCtrlSts */
#define SIG_SLDVOLCTRLSTS_UB (((uint16_t) 17) | NODE_ID_SWTR) /* Symbolic name of the signal SldVolCtrlSts_UB */
#define SIG_STEERWHLTOUCHBDDN (((uint16_t) 18) | NODE_ID_SWTR) /* Symbolic name of the signal SteerWhlTouchBdDn */
#define SIG_STEERWHLTOUCHBDDN_UB (((uint16_t) 19) | NODE_ID_SWTR) /* Symbolic name of the signal SteerWhlTouchBdDn_UB */
#define SIG_STEERWHLTOUCHBDMENU (((uint16_t) 20) | NODE_ID_SWTR) /* Symbolic name of the signal SteerWhlTouchBdMenu */
#define SIG_STEERWHLTOUCHBDMENU_UB (((uint16_t) 21) | NODE_ID_SWTR) /* Symbolic name of the signal SteerWhlTouchBdMenu_UB */
#define SIG_STEERWHLTOUCHBDRICHKS (((uint16_t) 22) | NODE_ID_SWTR) /* Symbolic name of the signal SteerWhlTouchBdRiChks */
#define SIG_STEERWHLTOUCHBDRICNTR (((uint16_t) 23) | NODE_ID_SWTR) /* Symbolic name of the signal SteerWhlTouchBdRiCntr */
#define SIG_STEERWHLTOUCHBDRISTEERWHLTOUCHBDSTS (((uint16_t) 24) | NODE_ID_SWTR) /* Symbolic name of the signal SteerWhlTouchBdRiSteerWhlTouchBdSts */
#define SIG_STEERWHLTOUCHBDRITOUCHPOSNX (((uint16_t) 25) | NODE_ID_SWTR) /* Symbolic name of the signal SteerWhlTouchBdRiTouchPosnX */
#define SIG_STEERWHLTOUCHBDRITOUCHPOSNY (((uint16_t) 26) | NODE_ID_SWTR) /* Symbolic name of the signal SteerWhlTouchBdRiTouchPosnY */
#define SIG_STEERWHLTOUCHBDRI_UB (((uint16_t) 27) | NODE_ID_SWTR) /* Symbolic name of the signal SteerWhlTouchBdRi_UB */
#define SIG_STEERWHLTOUCHBDVOICE (((uint16_t) 28) | NODE_ID_SWTR) /* Symbolic name of the signal SteerWhlTouchBdVoice */
#define SIG_STEERWHLTOUCHBDVOICE_UB (((uint16_t) 29) | NODE_ID_SWTR) /* Symbolic name of the signal SteerWhlTouchBdVoice_UB */
#define SIG_SWPLERISTSRI (((uint16_t) 30) | NODE_ID_SWTR) /* Symbolic name of the signal SwpLeRiStsRi */
#define SIG_SWPLERISTSRI_UB (((uint16_t) 31) | NODE_ID_SWTR) /* Symbolic name of the signal SwpLeRiStsRi_UB */
#define SIG_SWPUPDWNSTSRI (((uint16_t) 32) | NODE_ID_SWTR) /* Symbolic name of the signal SwpUpDwnStsRi */
#define SIG_SWPUPDWNSTSRI_UB (((uint16_t) 33) | NODE_ID_SWTR) /* Symbolic name of the signal SwpUpDwnStsRi_UB */
#define SIG_SWTRPARTNO10CMPLENDSGN1 (((uint16_t) 34) | NODE_ID_SWTR) /* Symbolic name of the signal SWTRPartNo10CmplEndSgn1 */
#define SIG_SWTRPARTNO10CMPLENDSGN2 (((uint16_t) 35) | NODE_ID_SWTR) /* Symbolic name of the signal SWTRPartNo10CmplEndSgn2 */
#define SIG_SWTRPARTNO10CMPLENDSGN3 (((uint16_t) 36) | NODE_ID_SWTR) /* Symbolic name of the signal SWTRPartNo10CmplEndSgn3 */
#define SIG_SWTRPARTNO10CMPLNR1 (((uint16_t) 37) | NODE_ID_SWTR) /* Symbolic name of the signal SWTRPartNo10CmplNr1 */
#define SIG_SWTRPARTNO10CMPLNR2 (((uint16_t) 38) | NODE_ID_SWTR) /* Symbolic name of the signal SWTRPartNo10CmplNr2 */
#define SIG_SWTRPARTNO10CMPLNR3 (((uint16_t) 39) | NODE_ID_SWTR) /* Symbolic name of the signal SWTRPartNo10CmplNr3 */
#define SIG_SWTRPARTNO10CMPLNR4 (((uint16_t) 40) | NODE_ID_SWTR) /* Symbolic name of the signal SWTRPartNo10CmplNr4 */
#define SIG_SWTRPARTNO10CMPLNR5 (((uint16_t) 41) | NODE_ID_SWTR) /* Symbolic name of the signal SWTRPartNo10CmplNr5 */
#define SIG_SWTRPARTNOCMPLENDSGN1 (((uint16_t) 42) | NODE_ID_SWTR) /* Symbolic name of the signal SWTRPartNoCmplEndSgn1 */
#define SIG_SWTRPARTNOCMPLENDSGN2 (((uint16_t) 43) | NODE_ID_SWTR) /* Symbolic name of the signal SWTRPartNoCmplEndSgn2 */
#define SIG_SWTRPARTNOCMPLENDSGN3 (((uint16_t) 44) | NODE_ID_SWTR) /* Symbolic name of the signal SWTRPartNoCmplEndSgn3 */
#define SIG_SWTRPARTNOCMPLNR1 (((uint16_t) 45) | NODE_ID_SWTR) /* Symbolic name of the signal SWTRPartNoCmplNr1 */
#define SIG_SWTRPARTNOCMPLNR2 (((uint16_t) 46) | NODE_ID_SWTR) /* Symbolic name of the signal SWTRPartNoCmplNr2 */
#define SIG_SWTRPARTNOCMPLNR3 (((uint16_t) 47) | NODE_ID_SWTR) /* Symbolic name of the signal SWTRPartNoCmplNr3 */
#define SIG_SWTRPARTNOCMPLNR4 (((uint16_t) 48) | NODE_ID_SWTR) /* Symbolic name of the signal SWTRPartNoCmplNr4 */
#define SIG_SWTRPARTNOCMPL_UB (((uint16_t) 49) | NODE_ID_SWTR) /* Symbolic name of the signal SWTRPartNoCmpl_UB */
#define SIG_SWTRPRESSBASELINE (((uint16_t) 50) | NODE_ID_SWTR) /* Symbolic name of the signal SwtrPressBaseline */
#define SIG_SWTRPRESSSIGNAL (((uint16_t) 51) | NODE_ID_SWTR) /* Symbolic name of the signal SwtrPressSignal */
#define SIG_SWTRSENSOR10_BASELINE (((uint16_t) 52) | NODE_ID_SWTR) /* Symbolic name of the signal SwtRsensor10_baseline */
#define SIG_SWTRSENSOR10_SIGNAL (((uint16_t) 53) | NODE_ID_SWTR) /* Symbolic name of the signal SwtRSensor10_signal */
#define SIG_SWTRSENSOR11_BASELINE (((uint16_t) 54) | NODE_ID_SWTR) /* Symbolic name of the signal SwtRsensor11_baseline */
#define SIG_SWTRSENSOR11_SIGNAL (((uint16_t) 55) | NODE_ID_SWTR) /* Symbolic name of the signal SwtRSensor11_signal */
#define SIG_SWTRSENSOR12_BASELINE (((uint16_t) 56) | NODE_ID_SWTR) /* Symbolic name of the signal SwtRsensor12_baseline */
#define SIG_SWTRSENSOR12_SIGNAL (((uint16_t) 57) | NODE_ID_SWTR) /* Symbolic name of the signal SwtRSensor12_signal */
#define SIG_SWTRSENSOR13_BASELINE (((uint16_t) 58) | NODE_ID_SWTR) /* Symbolic name of the signal SwtRsensor13_baseline */
#define SIG_SWTRSENSOR13_SIGNAL (((uint16_t) 59) | NODE_ID_SWTR) /* Symbolic name of the signal SwtRSensor13_signal */
#define SIG_SWTRSENSOR14_BASELINE (((uint16_t) 60) | NODE_ID_SWTR) /* Symbolic name of the signal SwtRsensor14_baseline */
#define SIG_SWTRSENSOR14_SIGNAL (((uint16_t) 61) | NODE_ID_SWTR) /* Symbolic name of the signal SwtRSensor14_signal */
#define SIG_SWTRSENSOR15_BASELINE (((uint16_t) 62) | NODE_ID_SWTR) /* Symbolic name of the signal SwtRsensor15_baseline */
#define SIG_SWTRSENSOR15_SIGNAL (((uint16_t) 63) | NODE_ID_SWTR) /* Symbolic name of the signal SwtRSensor15_signal */
#define SIG_SWTRSENSOR16_BASELINE (((uint16_t) 64) | NODE_ID_SWTR) /* Symbolic name of the signal SwtRsensor16_baseline */
#define SIG_SWTRSENSOR16_SIGNAL (((uint16_t) 65) | NODE_ID_SWTR) /* Symbolic name of the signal SwtRSensor16_signal */
#define SIG_SWTRSENSOR1_BASELINE (((uint16_t) 66) | NODE_ID_SWTR) /* Symbolic name of the signal SwtRsensor1_baseline */
#define SIG_SWTRSENSOR1_SIGNAL (((uint16_t) 67) | NODE_ID_SWTR) /* Symbolic name of the signal SwtRSensor1_signal */
#define SIG_SWTRSENSOR2_BASELINE (((uint16_t) 68) | NODE_ID_SWTR) /* Symbolic name of the signal SwtRsensor2_baseline */
#define SIG_SWTRSENSOR2_SIGNAL (((uint16_t) 69) | NODE_ID_SWTR) /* Symbolic name of the signal SwtRSensor2_signal */
#define SIG_SWTRSENSOR3_BASELINE (((uint16_t) 70) | NODE_ID_SWTR) /* Symbolic name of the signal SwtRsensor3_baseline */
#define SIG_SWTRSENSOR3_SIGNAL (((uint16_t) 71) | NODE_ID_SWTR) /* Symbolic name of the signal SwtRSensor3_signal */
#define SIG_SWTRSENSOR4_BASELINE (((uint16_t) 72) | NODE_ID_SWTR) /* Symbolic name of the signal SwtRsensor4_baseline */
#define SIG_SWTRSENSOR4_SIGNAL (((uint16_t) 73) | NODE_ID_SWTR) /* Symbolic name of the signal SwtRSensor4_signal */
#define SIG_SWTRSENSOR5_BASELINE (((uint16_t) 74) | NODE_ID_SWTR) /* Symbolic name of the signal SwtRsensor5_baseline */
#define SIG_SWTRSENSOR5_SIGNAL (((uint16_t) 75) | NODE_ID_SWTR) /* Symbolic name of the signal SwtRSensor5_signal */
#define SIG_SWTRSENSOR6_BASELINE (((uint16_t) 76) | NODE_ID_SWTR) /* Symbolic name of the signal SwtRsensor6_baseline */
#define SIG_SWTRSENSOR6_SIGNAL (((uint16_t) 77) | NODE_ID_SWTR) /* Symbolic name of the signal SwtRSensor6_signal */
#define SIG_SWTRSENSOR7_BASELINE (((uint16_t) 78) | NODE_ID_SWTR) /* Symbolic name of the signal SwtRsensor7_baseline */
#define SIG_SWTRSENSOR7_SIGNAL (((uint16_t) 79) | NODE_ID_SWTR) /* Symbolic name of the signal SwtRSensor7_signal */
#define SIG_SWTRSENSOR8_BASELINE (((uint16_t) 80) | NODE_ID_SWTR) /* Symbolic name of the signal SwtRsensor8_baseline */
#define SIG_SWTRSENSOR8_SIGNAL (((uint16_t) 81) | NODE_ID_SWTR) /* Symbolic name of the signal SwtRSensor8_signal */
#define SIG_SWTRSENSOR9_BASELINE (((uint16_t) 82) | NODE_ID_SWTR) /* Symbolic name of the signal SwtRsensor9_baseline */
#define SIG_SWTRSENSOR9_SIGNAL (((uint16_t) 83) | NODE_ID_SWTR) /* Symbolic name of the signal SwtRSensor9_signal */
#define SIG_SWTRSERNONR1 (((uint16_t) 84) | NODE_ID_SWTR) /* Symbolic name of the signal SWTRSerNoNr1 */
#define SIG_SWTRSERNONR2 (((uint16_t) 85) | NODE_ID_SWTR) /* Symbolic name of the signal SWTRSerNoNr2 */
#define SIG_SWTRSERNONR3 (((uint16_t) 86) | NODE_ID_SWTR) /* Symbolic name of the signal SWTRSerNoNr3 */
#define SIG_SWTRSERNONR4 (((uint16_t) 87) | NODE_ID_SWTR) /* Symbolic name of the signal SWTRSerNoNr4 */
#define SIG_SWTRSERNO_UB (((uint16_t) 88) | NODE_ID_SWTR) /* Symbolic name of the signal SWTRSerNo_UB */
/* Last Tx signal */
#define LAST_TX_STA_LEN_SIGNAL_SYMBOLIC_NAME ((~NODE_ID_MASK) & SIG_SWTRSERNO_UB)

/* Symbolic names for Tx signals with dynamic length */ 
/* First Tx signal */
#define FIRST_TX_DYN_LEN_SIGNAL_SYMBOLIC_NAME ((~NODE_ID_MASK) & SIG_DIAGNOSTICRESPSWTR)
#define SIG_DIAGNOSTICRESPSWTR (((UI_16) 89) | NODE_ID_SWTR) /* Symbolic name of the signal SIG_DIAGNOSTICRESPSWTR */
/* Last Tx signal */
#define LAST_TX_DYN_LEN_SIGNAL_SYMBOLIC_NAME ((~NODE_ID_MASK) & SIG_DIAGNOSTICRESPSWTR)

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

/*Symbolic names for Rx signals with dynamic length*/
#define SIG_DIAGNOSTICREQSWTR (((UI_16) 98) | NODE_ID_SWTR) /* Symbolic name of the signal SIG_DIAGNOSTICREQSWTR */
#define SIG_DIAGNOSTICFUNCADDRREQ (((UI_16) 99) | NODE_ID_SWTR) /* 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) 99) 

/* 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_diagcfailrtouchpanswtrvibrationfltsts;
typedef uint8_t t_sig_diagcfailrtouchpanswtrtouchdfltsts;
typedef uint8_t t_sig_diagcfailrtouchpanswtrsnsrfltsts;
typedef uint8_t t_sig_diagcfailrtouchpanswtrcmnfltsts;
typedef uint8_t t_sig_diagcfailrtouchpanswtr_ub;
typedef uint8_t t_sig_swtrsernonr4;
typedef uint8_t t_sig_swtrsernonr3;
typedef uint8_t t_sig_swtrsernonr2;
typedef uint8_t t_sig_swtrsernonr1;
typedef uint8_t t_sig_swtrserno_ub;
typedef uint8_t t_sig_swtrpartnocmplnr4;
typedef uint8_t t_sig_swtrpartnocmplnr3;
typedef uint8_t t_sig_swtrpartnocmplnr2;
typedef uint8_t t_sig_swtrpartnocmplnr1;
typedef uint8_t t_sig_swtrpartnocmplendsgn3;
typedef uint8_t t_sig_swtrpartnocmplendsgn2;
typedef uint8_t t_sig_swtrpartnocmplendsgn1;
typedef uint8_t t_sig_swtrpartnocmpl_ub;
typedef uint8_t t_sig_swtrpartno10cmplnr5;
typedef uint8_t t_sig_swtrpartno10cmplnr4;
typedef uint8_t t_sig_swtrpartno10cmplnr3;
typedef uint8_t t_sig_swtrpartno10cmplnr2;
typedef uint8_t t_sig_swtrpartno10cmplnr1;
typedef uint8_t t_sig_swtrpartno10cmplendsgn3;
typedef uint8_t t_sig_swtrpartno10cmplendsgn2;
typedef uint8_t t_sig_swtrpartno10cmplendsgn1;
typedef uint8_t t_sig_swpupdwnstsri_ub;
typedef uint8_t t_sig_swpupdwnstsri;
typedef uint8_t t_sig_swpleristsri_ub;
typedef uint8_t t_sig_swpleristsri;
typedef uint8_t t_sig_steerwhltouchbdvoice_ub;
typedef uint8_t t_sig_steerwhltouchbdvoice;
typedef uint8_t t_sig_steerwhltouchbdmenu_ub;
typedef uint8_t t_sig_steerwhltouchbdmenu;
typedef uint8_t t_sig_steerwhltouchbddn_ub;
typedef uint8_t t_sig_steerwhltouchbddn;
typedef uint8_t t_sig_sldvolctrlsts_ub;
typedef uint8_t t_sig_sldvolctrlsts;
typedef uint8_t t_sig_rimfctactsgup_ub;
typedef uint8_t t_sig_rimfctactsgup;
typedef uint8_t t_sig_rimfctactsgri_ub;
typedef uint8_t t_sig_rimfctactsgri;
typedef uint8_t t_sig_rimfctactsgle_ub;
typedef uint8_t t_sig_rimfctactsgle;
typedef uint8_t t_sig_rimfctactsgdn_ub;
typedef uint8_t t_sig_rimfctactsgdn;
typedef uint8_t t_sig_rimfctactsgce_ub;
typedef uint8_t t_sig_rimfctactsgce;
typedef uint8_t t_sig_steerwhltouchbdritouchposny;
typedef uint8_t t_sig_steerwhltouchbdritouchposnx;
typedef uint8_t t_sig_steerwhltouchbdristeerwhltouchbdsts;
typedef uint8_t t_sig_steerwhltouchbdricntr;
typedef uint8_t t_sig_steerwhltouchbdrichks;
typedef uint8_t t_sig_steerwhltouchbdri_ub;
typedef uint16_t t_sig_swtrpressbaseline;
typedef uint16_t t_sig_swtrpresssignal;
typedef uint16_t t_sig_swtrsensor1_baseline;
typedef uint16_t t_sig_swtrsensor1_signal;
typedef uint16_t t_sig_swtrsensor2_baseline;
typedef uint16_t t_sig_swtrsensor2_signal;
typedef uint16_t t_sig_swtrsensor3_baseline;
typedef uint16_t t_sig_swtrsensor4_baseline;
typedef uint16_t t_sig_swtrsensor3_signal;
typedef uint16_t t_sig_swtrsensor4_signal;
typedef uint16_t t_sig_swtrsensor5_baseline;
typedef uint16_t t_sig_swtrsensor6_baseline;
typedef uint16_t t_sig_swtrsensor5_signal;
typedef uint16_t t_sig_swtrsensor6_signal;
typedef uint16_t t_sig_swtrsensor7_baseline;
typedef uint16_t t_sig_swtrsensor8_baseline;
typedef uint16_t t_sig_swtrsensor7_signal;
typedef uint16_t t_sig_swtrsensor8_signal;
typedef uint16_t t_sig_swtrsensor9_baseline;
typedef uint16_t t_sig_swtrsensor10_baseline;
typedef uint16_t t_sig_swtrsensor9_signal;
typedef uint16_t t_sig_swtrsensor10_signal;
typedef uint16_t t_sig_swtrsensor11_baseline;
typedef uint16_t t_sig_swtrsensor12_baseline;
typedef uint16_t t_sig_swtrsensor11_signal;
typedef uint16_t t_sig_swtrsensor12_signal;
typedef uint16_t t_sig_swtrsensor13_baseline;
typedef uint16_t t_sig_swtrsensor14_baseline;
typedef uint16_t t_sig_swtrsensor13_signal;
typedef uint16_t t_sig_swtrsensor14_signal;
typedef uint16_t t_sig_swtrsensor15_baseline;
typedef uint16_t t_sig_swtrsensor16_baseline;
typedef uint16_t t_sig_swtrsensor15_signal;
typedef uint16_t t_sig_swtrsensor16_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 OsekComRxNotifCallbackSWTR(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 OsekComTxReqCallbackSWTR(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);

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

/*---------------------------------------------------------------------------
| Portability:  Target platform independent
|----------------------------------------------------------------------------
| Routine description:
|  * Reset service for the flag of COM traffic.
|---------------------------------------------------------------------------
| Parameters description:
/---------------------------------------------------------------------------*/
void ResetFlagComTrafficSWTR(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 ReadFlagTxSigDiagcFailrTouchPanSWTRVibrationFltSts(void);
t_flag_value ReadFlagTxSigDiagcFailrTouchPanSWTRTouchdFltSts(void);
t_flag_value ReadFlagTxSigDiagcFailrTouchPanSWTRSnsrFltSts(void);
t_flag_value ReadFlagTxSigDiagcFailrTouchPanSWTRCmnFltSts(void);
t_flag_value ReadFlagTxSigDiagcFailrTouchPanSWTR_UB(void);
t_flag_value ReadFlagTxSigSWTRSerNoNr4(void);
t_flag_value ReadFlagTxSigSWTRSerNoNr3(void);
t_flag_value ReadFlagTxSigSWTRSerNoNr2(void);
t_flag_value ReadFlagTxSigSWTRSerNoNr1(void);
t_flag_value ReadFlagTxSigSWTRSerNo_UB(void);
t_flag_value ReadFlagTxSigSWTRPartNoCmplNr4(void);
t_flag_value ReadFlagTxSigSWTRPartNoCmplNr3(void);
t_flag_value ReadFlagTxSigSWTRPartNoCmplNr2(void);
t_flag_value ReadFlagTxSigSWTRPartNoCmplNr1(void);
t_flag_value ReadFlagTxSigSWTRPartNoCmplEndSgn3(void);
t_flag_value ReadFlagTxSigSWTRPartNoCmplEndSgn2(void);
t_flag_value ReadFlagTxSigSWTRPartNoCmplEndSgn1(void);
t_flag_value ReadFlagTxSigSWTRPartNoCmpl_UB(void);
t_flag_value ReadFlagTxSigSWTRPartNo10CmplNr5(void);
t_flag_value ReadFlagTxSigSWTRPartNo10CmplNr4(void);
t_flag_value ReadFlagTxSigSWTRPartNo10CmplNr3(void);
t_flag_value ReadFlagTxSigSWTRPartNo10CmplNr2(void);
t_flag_value ReadFlagTxSigSWTRPartNo10CmplNr1(void);
t_flag_value ReadFlagTxSigSWTRPartNo10CmplEndSgn3(void);
t_flag_value ReadFlagTxSigSWTRPartNo10CmplEndSgn2(void);
t_flag_value ReadFlagTxSigSWTRPartNo10CmplEndSgn1(void);
t_flag_value ReadFlagTxSigSwpUpDwnStsRi_UB(void);
t_flag_value ReadFlagTxSigSwpUpDwnStsRi(void);
t_flag_value ReadFlagTxSigSwpLeRiStsRi_UB(void);
t_flag_value ReadFlagTxSigSwpLeRiStsRi(void);
t_flag_value ReadFlagTxSigSteerWhlTouchBdVoice_UB(void);
t_flag_value ReadFlagTxSigSteerWhlTouchBdVoice(void);
t_flag_value ReadFlagTxSigSteerWhlTouchBdMenu_UB(void);
t_flag_value ReadFlagTxSigSteerWhlTouchBdMenu(void);
t_flag_value ReadFlagTxSigSteerWhlTouchBdDn_UB(void);
t_flag_value ReadFlagTxSigSteerWhlTouchBdDn(void);
t_flag_value ReadFlagTxSigSldVolCtrlSts_UB(void);
t_flag_value ReadFlagTxSigSldVolCtrlSts(void);
t_flag_value ReadFlagTxSigRiMFctActSgUp_UB(void);
t_flag_value ReadFlagTxSigRiMFctActSgUp(void);
t_flag_value ReadFlagTxSigRiMFctActSgRi_UB(void);
t_flag_value ReadFlagTxSigRiMFctActSgRi(void);
t_flag_value ReadFlagTxSigRiMFctActSgLe_UB(void);
t_flag_value ReadFlagTxSigRiMFctActSgLe(void);
t_flag_value ReadFlagTxSigRiMFctActSgDn_UB(void);
t_flag_value ReadFlagTxSigRiMFctActSgDn(void);
t_flag_value ReadFlagTxSigRiMFctActSgCe_UB(void);
t_flag_value ReadFlagTxSigRiMFctActSgCe(void);
t_flag_value ReadFlagTxSigSteerWhlTouchBdRiTouchPosnY(void);
t_flag_value ReadFlagTxSigSteerWhlTouchBdRiTouchPosnX(void);
t_flag_value ReadFlagTxSigSteerWhlTouchBdRiSteerWhlTouchBdSts(void);
t_flag_value ReadFlagTxSigSteerWhlTouchBdRiCntr(void);
t_flag_value ReadFlagTxSigSteerWhlTouchBdRiChks(void);
t_flag_value ReadFlagTxSigSteerWhlTouchBdRi_UB(void);
t_flag_value ReadFlagTxSigDiagnosticRespSWTR(void);
t_flag_value ReadFlagRxSigDiagnosticReqSWTR(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 ResetFlagTxSigDiagcFailrTouchPanSWTRVibrationFltSts(void);
void ResetFlagTxSigDiagcFailrTouchPanSWTRTouchdFltSts(void);
void ResetFlagTxSigDiagcFailrTouchPanSWTRSnsrFltSts(void);
void ResetFlagTxSigDiagcFailrTouchPanSWTRCmnFltSts(void);
void ResetFlagTxSigDiagcFailrTouchPanSWTR_UB(void);
void ResetFlagTxSigSWTRSerNoNr4(void);
void ResetFlagTxSigSWTRSerNoNr3(void);
void ResetFlagTxSigSWTRSerNoNr2(void);
void ResetFlagTxSigSWTRSerNoNr1(void);
void ResetFlagTxSigSWTRSerNo_UB(void);
void ResetFlagTxSigSWTRPartNoCmplNr4(void);
void ResetFlagTxSigSWTRPartNoCmplNr3(void);
void ResetFlagTxSigSWTRPartNoCmplNr2(void);
void ResetFlagTxSigSWTRPartNoCmplNr1(void);
void ResetFlagTxSigSWTRPartNoCmplEndSgn3(void);
void ResetFlagTxSigSWTRPartNoCmplEndSgn2(void);
void ResetFlagTxSigSWTRPartNoCmplEndSgn1(void);
void ResetFlagTxSigSWTRPartNoCmpl_UB(void);
void ResetFlagTxSigSWTRPartNo10CmplNr5(void);
void ResetFlagTxSigSWTRPartNo10CmplNr4(void);
void ResetFlagTxSigSWTRPartNo10CmplNr3(void);
void ResetFlagTxSigSWTRPartNo10CmplNr2(void);
void ResetFlagTxSigSWTRPartNo10CmplNr1(void);
void ResetFlagTxSigSWTRPartNo10CmplEndSgn3(void);
void ResetFlagTxSigSWTRPartNo10CmplEndSgn2(void);
void ResetFlagTxSigSWTRPartNo10CmplEndSgn1(void);
void ResetFlagTxSigSwpUpDwnStsRi_UB(void);
void ResetFlagTxSigSwpUpDwnStsRi(void);
void ResetFlagTxSigSwpLeRiStsRi_UB(void);
void ResetFlagTxSigSwpLeRiStsRi(void);
void ResetFlagTxSigSteerWhlTouchBdVoice_UB(void);
void ResetFlagTxSigSteerWhlTouchBdVoice(void);
void ResetFlagTxSigSteerWhlTouchBdMenu_UB(void);
void ResetFlagTxSigSteerWhlTouchBdMenu(void);
void ResetFlagTxSigSteerWhlTouchBdDn_UB(void);
void ResetFlagTxSigSteerWhlTouchBdDn(void);
void ResetFlagTxSigSldVolCtrlSts_UB(void);
void ResetFlagTxSigSldVolCtrlSts(void);
void ResetFlagTxSigRiMFctActSgUp_UB(void);
void ResetFlagTxSigRiMFctActSgUp(void);
void ResetFlagTxSigRiMFctActSgRi_UB(void);
void ResetFlagTxSigRiMFctActSgRi(void);
void ResetFlagTxSigRiMFctActSgLe_UB(void);
void ResetFlagTxSigRiMFctActSgLe(void);
void ResetFlagTxSigRiMFctActSgDn_UB(void);
void ResetFlagTxSigRiMFctActSgDn(void);
void ResetFlagTxSigRiMFctActSgCe_UB(void);
void ResetFlagTxSigRiMFctActSgCe(void);
void ResetFlagTxSigSteerWhlTouchBdRiTouchPosnY(void);
void ResetFlagTxSigSteerWhlTouchBdRiTouchPosnX(void);
void ResetFlagTxSigSteerWhlTouchBdRiSteerWhlTouchBdSts(void);
void ResetFlagTxSigSteerWhlTouchBdRiCntr(void);
void ResetFlagTxSigSteerWhlTouchBdRiChks(void);
void ResetFlagTxSigSteerWhlTouchBdRi_UB(void);
void ResetFlagTxSigDiagnosticRespSWTR(void);
void ResetFlagRxSig(t_symbolic_name message);
void ResetFlagRxSigDiagnosticReqSWTR(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 OsekComTxReqFrmSwtrPrivateDHUCanFr01(void);
void OsekComTxReqFrmSwtrPrivateDHUCanFr02(void);
#endif

