1 /* -------------------------------- Arctic Core ------------------------------
\r
2 * Arctic Core - the open source AUTOSAR platform http://arccore.com
\r
4 * Copyright (C) 2009 ArcCore AB <contact@arccore.com>
\r
6 * This source code is free software; you can redistribute it and/or modify it
\r
7 * under the terms of the GNU General Public License version 2 as published by the
\r
8 * Free Software Foundation; See <http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt>.
\r
10 * This program is distributed in the hope that it will be useful, but
\r
11 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
\r
12 * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
\r
14 * -------------------------------- Arctic Core ------------------------------*/
\r
16 /** @addtogroup PduR PDU Router
\r
19 /** @file PduR_Types.h
\r
20 * Type definitions for PDU Router.
\r
23 #ifndef PDUR_TYPES_H
\r
24 #define PDUR_TYPES_H
\r
26 #include "ComStack_Types.h"
\r
29 ARC_PDUR_UP_MODULES = 0,
\r
33 ARC_PDUR_LOIF_MODULES,
\r
38 ARC_PDUR_LOTP_MODULES,
\r
44 ARC_PDUR_END_OF_MODULES
\r
46 } ARC_PduR_ModuleType;
\r
48 /** PduR_StateType defines the states of which the PDU router can be in */
\r
50 PDUR_UNINIT, /**< PDU Router is not initialized. */
\r
51 PDUR_ONLINE, /**< PDU Router initialized successfully. */
\r
52 PDUR_REDUCED /**< PDU Router initialization did not succeed. Only minimum routing is provided. */
\r
56 PDU_CNLDO, /**< Cancel transfer since data is outdated. */
\r
57 PDU_CNLNB, /**< Cancel transfer since buffer is full. */
\r
58 PDU_CNLOR /**< Cancel transfer of another reason. */
\r
59 } PduR_CancelReasonType;
\r
61 typedef uint8 PduR_ParameterValueType;
\r
64 PDUR_NO_PROVISION, /**< No data provision. */
\r
65 PDUR_TRIGGER_TRANSMIT, /**< Trigger transmit type. */
\r
66 PDUR_DIRECT /**< Data provision type. */
\r
67 } PduR_DataProvisionType;
\r
73 PduR_DataProvisionType BufferType;
\r
79 // uint8 TxIdx; // This is the same as First, hence left out.
\r
87 } PduRTxBuffer_type;
\r
89 typedef uint8 *PduRTxBuffer_type;
\r
92 PDUR_BUFFER_FREE = 0,
\r
93 PDUR_BUFFER_RX_BUSY,
\r
94 PDUR_BUFFER_TX_READY,
\r
96 } PduRTpBufferStatus_type;
\r
99 PduInfoType *pduInfoPtr;
\r
100 PduRTpBufferStatus_type status;
\r
101 const uint16 bufferSize;
\r
102 } PduRTpBufferInfo_type;
\r
107 * Data provision mode for this PDU.
\r
109 const PduR_DataProvisionType DataProvision;
\r
112 * Reference to unique PDU identifier which shall
\r
113 * be used by the PDU router instead of the source identifier.
\r
115 const uint16 DestPduId;
\r
118 * Reference to the assigned Tx buffer.
\r
120 * Comment: Only required for non-TP gateway PDUs.
\r
122 PduRTxBuffer_type * const TxBufferRef;
\r
124 const ARC_PduR_ModuleType DestModule;
\r
126 } PduRDestPdu_type;
\r
129 uint8 ElementBytePosition;
\r
130 uint8 DefaultValueElement[];
\r
131 } PduRDefaultValueElement_type;
\r
135 uint8 PduR_Arc_Dummy; // Needed in order to compile without errors.
\r
136 PduRDefaultValueElement_type *PduRDefaultValueElement;
\r
137 } PduRDefaultValue_type;
\r
141 * Length of PDU data.
\r
143 * Comment: Only required if a TX buffer is configured.
\r
145 const uint16 SduLength;
\r
148 * Chunk size for routing on the fly.
\r
150 * Comment: Only required for TP gateway PDUs.
\r
152 uint16 TpChunkSize;
\r
155 * Specifies the default value of the PDU.
\r
157 * Comment: Only require for gateway operation.
\r
159 PduRDefaultValue_type PduRDefaultValue;
\r
162 * Specifies the source ID of the PDU to be routed.
\r
164 const uint16 SrcPduId;
\r
167 * Specifies the source module for this route.
169 const ARC_PduR_ModuleType SrcModule;
\r
172 * Specifies the destination(s) of the PDU to be routed.
\r
174 const PduRDestPdu_type * const *PduRDestPdus;
\r
176 } PduRRoutingPath_type;
\r
180 * Unique configuration identifier.
\r
182 uint8 PduRConfigurationId;
\r
184 uint8 NRoutingPaths;
\r
187 * The routing table of this PDU router configuration.
\r
189 const PduRRoutingPath_type * const*RoutingPaths;
\r
191 PduRTpBufferInfo_type *TpBuffers;
\r
192 PduRTpBufferInfo_type **TpRouteBuffers;
\r
194 } PduR_PBConfigType;
\r