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
45 ARC_PDUR_END_OF_MODULES
\r
47 } ARC_PduR_ModuleType;
\r
49 /** PduR_StateType defines the states of which the PDU router can be in */
\r
51 PDUR_UNINIT, /**< PDU Router is not initialized. */
\r
52 PDUR_ONLINE, /**< PDU Router initialized successfully. */
\r
53 PDUR_REDUCED /**< PDU Router initialization did not succeed. Only minimum routing is provided. */
\r
57 PDU_CNLDO, /**< Cancel transfer since data is outdated. */
\r
58 PDU_CNLNB, /**< Cancel transfer since buffer is full. */
\r
59 PDU_CNLOR /**< Cancel transfer of another reason. */
\r
60 } PduR_CancelReasonType;
\r
62 typedef uint8 PduR_ParameterValueType;
\r
65 PDUR_NO_PROVISION, /**< No data provision. */
\r
66 PDUR_TRIGGER_TRANSMIT, /**< Trigger transmit type. */
\r
67 PDUR_DIRECT /**< Data provision type. */
\r
68 } PduR_DataProvisionType;
\r
74 PduR_DataProvisionType BufferType;
\r
80 // uint8 TxIdx; // This is the same as First, hence left out.
\r
88 } PduRTxBuffer_type;
\r
90 typedef uint8 *PduRTxBuffer_type;
\r
93 PDUR_BUFFER_FREE = 0,
\r
94 PDUR_BUFFER_RX_BUSY,
\r
95 PDUR_BUFFER_TX_READY,
\r
97 } PduRTpBufferStatus_type;
\r
100 PduInfoType *pduInfoPtr;
\r
101 PduRTpBufferStatus_type status;
\r
102 const uint16 bufferSize;
\r
103 } PduRTpBufferInfo_type;
\r
108 * Data provision mode for this PDU.
\r
110 const PduR_DataProvisionType DataProvision;
\r
113 * Reference to unique PDU identifier which shall
\r
114 * be used by the PDU router instead of the source identifier.
\r
116 const uint16 DestPduId;
\r
119 * Reference to the assigned Tx buffer.
\r
121 * Comment: Only required for non-TP gateway PDUs.
\r
123 PduRTxBuffer_type * const TxBufferRef;
\r
125 const ARC_PduR_ModuleType DestModule;
\r
127 } PduRDestPdu_type;
\r
130 uint8 ElementBytePosition;
\r
131 uint8 DefaultValueElement[];
\r
132 } PduRDefaultValueElement_type;
\r
136 uint8 PduR_Arc_Dummy; // Needed in order to compile without errors.
\r
137 PduRDefaultValueElement_type *PduRDefaultValueElement;
\r
138 } PduRDefaultValue_type;
\r
142 * Length of PDU data.
\r
144 * Comment: Only required if a TX buffer is configured.
\r
146 const uint16 SduLength;
\r
149 * Chunk size for routing on the fly.
\r
151 * Comment: Only required for TP gateway PDUs.
\r
153 uint16 TpChunkSize;
\r
156 * Specifies the default value of the PDU.
\r
158 * Comment: Only require for gateway operation.
\r
160 PduRDefaultValue_type PduRDefaultValue;
\r
163 * Specifies the source ID of the PDU to be routed.
\r
165 const uint16 SrcPduId;
\r
168 * Specifies the source module for this route.
170 const ARC_PduR_ModuleType SrcModule;
\r
173 * Specifies the destination(s) of the PDU to be routed.
\r
175 const PduRDestPdu_type * const *PduRDestPdus;
\r
177 } PduRRoutingPath_type;
\r
181 * Unique configuration identifier.
\r
183 uint8 PduRConfigurationId;
\r
185 uint8 NRoutingPaths;
\r
188 * The routing table of this PDU router configuration.
\r
190 const PduRRoutingPath_type * const*RoutingPaths;
\r
192 PduRTpBufferInfo_type *TpBuffers;
\r
193 PduRTpBufferInfo_type **TpRouteBuffers;
\r
195 } PduR_PBConfigType;
\r