Daniel Krueger | 9d7164c | 2008-12-19 11:41:57 -0800 | [diff] [blame] | 1 | /**************************************************************************** |
| 2 | |
| 3 | (c) SYSTEC electronic GmbH, D-07973 Greiz, August-Bebel-Str. 29 |
| 4 | www.systec-electronic.com |
| 5 | |
| 6 | Project: openPOWERLINK |
| 7 | |
| 8 | Description: include file for EPL frames |
| 9 | |
| 10 | License: |
| 11 | |
| 12 | Redistribution and use in source and binary forms, with or without |
| 13 | modification, are permitted provided that the following conditions |
| 14 | are met: |
| 15 | |
| 16 | 1. Redistributions of source code must retain the above copyright |
| 17 | notice, this list of conditions and the following disclaimer. |
| 18 | |
| 19 | 2. Redistributions in binary form must reproduce the above copyright |
| 20 | notice, this list of conditions and the following disclaimer in the |
| 21 | documentation and/or other materials provided with the distribution. |
| 22 | |
| 23 | 3. Neither the name of SYSTEC electronic GmbH nor the names of its |
| 24 | contributors may be used to endorse or promote products derived |
| 25 | from this software without prior written permission. For written |
| 26 | permission, please contact info@systec-electronic.com. |
| 27 | |
| 28 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS |
| 29 | "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT |
| 30 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS |
| 31 | FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE |
| 32 | COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, |
| 33 | INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, |
| 34 | BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; |
| 35 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER |
| 36 | CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT |
| 37 | LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN |
| 38 | ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE |
| 39 | POSSIBILITY OF SUCH DAMAGE. |
| 40 | |
| 41 | Severability Clause: |
| 42 | |
| 43 | If a provision of this License is or becomes illegal, invalid or |
| 44 | unenforceable in any jurisdiction, that shall not affect: |
| 45 | 1. the validity or enforceability in that jurisdiction of any other |
| 46 | provision of this License; or |
| 47 | 2. the validity or enforceability in other jurisdictions of that or |
| 48 | any other provision of this License. |
| 49 | |
| 50 | ------------------------------------------------------------------------- |
| 51 | |
| 52 | $RCSfile: EplFrame.h,v $ |
| 53 | |
| 54 | $Author: D.Krueger $ |
| 55 | |
| 56 | $Revision: 1.5 $ $Date: 2008/06/23 14:56:33 $ |
| 57 | |
| 58 | $State: Exp $ |
| 59 | |
| 60 | Build Environment: |
| 61 | GCC V3.4 |
| 62 | |
| 63 | ------------------------------------------------------------------------- |
| 64 | |
| 65 | Revision History: |
| 66 | |
| 67 | 2006/05/22 d.k.: start of the implementation, version 1.00 |
| 68 | |
Daniel Krueger | 9d7164c | 2008-12-19 11:41:57 -0800 | [diff] [blame] | 69 | ****************************************************************************/ |
| 70 | |
| 71 | #ifndef _EPL_FRAME_H_ |
| 72 | #define _EPL_FRAME_H_ |
| 73 | |
Daniel Krueger | 9d7164c | 2008-12-19 11:41:57 -0800 | [diff] [blame] | 74 | //--------------------------------------------------------------------------- |
| 75 | // const defines |
| 76 | //--------------------------------------------------------------------------- |
| 77 | |
Daniel Krueger | 9d7164c | 2008-12-19 11:41:57 -0800 | [diff] [blame] | 78 | // defines for EplFrame.m_wFlag |
Greg Kroah-Hartman | e0ca059 | 2008-12-19 17:09:38 -0800 | [diff] [blame] | 79 | #define EPL_FRAME_FLAG1_RD 0x01 // ready (PReq, PRes) |
| 80 | #define EPL_FRAME_FLAG1_ER 0x02 // exception reset (error signalling) (SoA) |
| 81 | #define EPL_FRAME_FLAG1_EA 0x04 // exception acknowledge (error signalling) (PReq, SoA) |
| 82 | #define EPL_FRAME_FLAG1_EC 0x08 // exception clear (error signalling) (StatusRes) |
| 83 | #define EPL_FRAME_FLAG1_EN 0x10 // exception new (error signalling) (PRes, StatusRes) |
| 84 | #define EPL_FRAME_FLAG1_MS 0x20 // multiplexed slot (PReq) |
| 85 | #define EPL_FRAME_FLAG1_PS 0x40 // prescaled slot (SoC) |
| 86 | #define EPL_FRAME_FLAG1_MC 0x80 // multiplexed cycle completed (SoC) |
| 87 | #define EPL_FRAME_FLAG2_RS 0x07 // number of pending requests to send (PRes, StatusRes, IdentRes) |
| 88 | #define EPL_FRAME_FLAG2_PR 0x38 // priority of requested asynch. frame (PRes, StatusRes, IdentRes) |
| 89 | #define EPL_FRAME_FLAG2_PR_SHIFT 3 // shift of priority of requested asynch. frame |
Daniel Krueger | 9d7164c | 2008-12-19 11:41:57 -0800 | [diff] [blame] | 90 | |
| 91 | // error history/status entry types |
| 92 | #define EPL_ERR_ENTRYTYPE_STATUS 0x8000 |
| 93 | #define EPL_ERR_ENTRYTYPE_HISTORY 0x0000 |
| 94 | #define EPL_ERR_ENTRYTYPE_EMCY 0x4000 |
| 95 | #define EPL_ERR_ENTRYTYPE_MODE_ACTIVE 0x1000 |
| 96 | #define EPL_ERR_ENTRYTYPE_MODE_CLEARED 0x2000 |
| 97 | #define EPL_ERR_ENTRYTYPE_MODE_OCCURRED 0x3000 |
| 98 | #define EPL_ERR_ENTRYTYPE_MODE_MASK 0x3000 |
| 99 | #define EPL_ERR_ENTRYTYPE_PROF_VENDOR 0x0001 |
| 100 | #define EPL_ERR_ENTRYTYPE_PROF_EPL 0x0002 |
| 101 | #define EPL_ERR_ENTRYTYPE_PROF_MASK 0x0FFF |
| 102 | |
| 103 | // defines for EPL version / PDO version |
Greg Kroah-Hartman | e0ca059 | 2008-12-19 17:09:38 -0800 | [diff] [blame] | 104 | #define EPL_VERSION_SUB 0x0F // sub version |
| 105 | #define EPL_VERSION_MAIN 0xF0 // main version |
Daniel Krueger | 9d7164c | 2008-12-19 11:41:57 -0800 | [diff] [blame] | 106 | |
| 107 | //--------------------------------------------------------------------------- |
| 108 | // typedef |
| 109 | //--------------------------------------------------------------------------- |
| 110 | |
Daniel Krueger | 9d7164c | 2008-12-19 11:41:57 -0800 | [diff] [blame] | 111 | // $$$ d.k.: move this definition to global.h |
| 112 | // byte-align structures |
| 113 | #ifdef _MSC_VER |
| 114 | # pragma pack( push, packing ) |
| 115 | # pragma pack( 1 ) |
| 116 | # define PACK_STRUCT |
| 117 | #elif defined( __GNUC__ ) |
| 118 | # define PACK_STRUCT __attribute__((packed)) |
| 119 | #else |
| 120 | # error you must byte-align these structures with the appropriate compiler directives |
| 121 | #endif |
| 122 | |
Greg Kroah-Hartman | e0ca059 | 2008-12-19 17:09:38 -0800 | [diff] [blame] | 123 | typedef struct { |
| 124 | // Offset 17 |
Greg Kroah-Hartman | 2ed53cf | 2009-03-23 12:36:38 -0700 | [diff] [blame] | 125 | u8 m_le_bRes1; // reserved |
Greg Kroah-Hartman | e0ca059 | 2008-12-19 17:09:38 -0800 | [diff] [blame] | 126 | // Offset 18 |
Greg Kroah-Hartman | 2ed53cf | 2009-03-23 12:36:38 -0700 | [diff] [blame] | 127 | u8 m_le_bFlag1; // Flags: MC, PS |
Greg Kroah-Hartman | e0ca059 | 2008-12-19 17:09:38 -0800 | [diff] [blame] | 128 | // Offset 19 |
Greg Kroah-Hartman | 2ed53cf | 2009-03-23 12:36:38 -0700 | [diff] [blame] | 129 | u8 m_le_bFlag2; // Flags: res |
Greg Kroah-Hartman | e0ca059 | 2008-12-19 17:09:38 -0800 | [diff] [blame] | 130 | // Offset 20 |
| 131 | tEplNetTime m_le_NetTime; // supported if D_NMT_NetTimeIsRealTime_BOOL is set |
| 132 | // Offset 28 |
Greg Kroah-Hartman | a5c30d9 | 2009-03-23 12:43:05 -0700 | [diff] [blame] | 133 | u64 m_le_RelativeTime; // in us (supported if D_NMT_RelativeTime_BOOL is set) |
Daniel Krueger | 9d7164c | 2008-12-19 11:41:57 -0800 | [diff] [blame] | 134 | |
| 135 | } PACK_STRUCT tEplSocFrame; |
| 136 | |
Greg Kroah-Hartman | e0ca059 | 2008-12-19 17:09:38 -0800 | [diff] [blame] | 137 | typedef struct { |
| 138 | // Offset 17 |
Greg Kroah-Hartman | 2ed53cf | 2009-03-23 12:36:38 -0700 | [diff] [blame] | 139 | u8 m_le_bRes1; // reserved |
Greg Kroah-Hartman | e0ca059 | 2008-12-19 17:09:38 -0800 | [diff] [blame] | 140 | // Offset 18 |
Greg Kroah-Hartman | 2ed53cf | 2009-03-23 12:36:38 -0700 | [diff] [blame] | 141 | u8 m_le_bFlag1; // Flags: MS, EA, RD |
Greg Kroah-Hartman | e0ca059 | 2008-12-19 17:09:38 -0800 | [diff] [blame] | 142 | // Offset 19 |
Greg Kroah-Hartman | 2ed53cf | 2009-03-23 12:36:38 -0700 | [diff] [blame] | 143 | u8 m_le_bFlag2; // Flags: res |
Greg Kroah-Hartman | e0ca059 | 2008-12-19 17:09:38 -0800 | [diff] [blame] | 144 | // Offset 20 |
Greg Kroah-Hartman | 2ed53cf | 2009-03-23 12:36:38 -0700 | [diff] [blame] | 145 | u8 m_le_bPdoVersion; |
Greg Kroah-Hartman | e0ca059 | 2008-12-19 17:09:38 -0800 | [diff] [blame] | 146 | // Offset 21 |
Greg Kroah-Hartman | 2ed53cf | 2009-03-23 12:36:38 -0700 | [diff] [blame] | 147 | u8 m_le_bRes2; // reserved |
Greg Kroah-Hartman | e0ca059 | 2008-12-19 17:09:38 -0800 | [diff] [blame] | 148 | // Offset 22 |
Greg Kroah-Hartman | dcf5371 | 2009-03-23 12:57:39 -0700 | [diff] [blame] | 149 | u16 m_le_wSize; |
Greg Kroah-Hartman | e0ca059 | 2008-12-19 17:09:38 -0800 | [diff] [blame] | 150 | // Offset 24 |
Greg Kroah-Hartman | 2ed53cf | 2009-03-23 12:36:38 -0700 | [diff] [blame] | 151 | u8 m_le_abPayload[256 /*D_NMT_IsochrRxMaxPayload_U16 */ ]; |
Daniel Krueger | 9d7164c | 2008-12-19 11:41:57 -0800 | [diff] [blame] | 152 | |
| 153 | } PACK_STRUCT tEplPreqFrame; |
| 154 | |
Greg Kroah-Hartman | e0ca059 | 2008-12-19 17:09:38 -0800 | [diff] [blame] | 155 | typedef struct { |
| 156 | // Offset 17 |
Greg Kroah-Hartman | 2ed53cf | 2009-03-23 12:36:38 -0700 | [diff] [blame] | 157 | u8 m_le_bNmtStatus; // NMT state |
Greg Kroah-Hartman | e0ca059 | 2008-12-19 17:09:38 -0800 | [diff] [blame] | 158 | // Offset 18 |
Greg Kroah-Hartman | 2ed53cf | 2009-03-23 12:36:38 -0700 | [diff] [blame] | 159 | u8 m_le_bFlag1; // Flags: MS, EN, RD |
Greg Kroah-Hartman | e0ca059 | 2008-12-19 17:09:38 -0800 | [diff] [blame] | 160 | // Offset 19 |
Greg Kroah-Hartman | 2ed53cf | 2009-03-23 12:36:38 -0700 | [diff] [blame] | 161 | u8 m_le_bFlag2; // Flags: PR, RS |
Greg Kroah-Hartman | e0ca059 | 2008-12-19 17:09:38 -0800 | [diff] [blame] | 162 | // Offset 20 |
Greg Kroah-Hartman | 2ed53cf | 2009-03-23 12:36:38 -0700 | [diff] [blame] | 163 | u8 m_le_bPdoVersion; |
Greg Kroah-Hartman | e0ca059 | 2008-12-19 17:09:38 -0800 | [diff] [blame] | 164 | // Offset 21 |
Greg Kroah-Hartman | 2ed53cf | 2009-03-23 12:36:38 -0700 | [diff] [blame] | 165 | u8 m_le_bRes2; // reserved |
Greg Kroah-Hartman | e0ca059 | 2008-12-19 17:09:38 -0800 | [diff] [blame] | 166 | // Offset 22 |
Greg Kroah-Hartman | dcf5371 | 2009-03-23 12:57:39 -0700 | [diff] [blame] | 167 | u16 m_le_wSize; |
Greg Kroah-Hartman | e0ca059 | 2008-12-19 17:09:38 -0800 | [diff] [blame] | 168 | // Offset 24 |
Greg Kroah-Hartman | 2ed53cf | 2009-03-23 12:36:38 -0700 | [diff] [blame] | 169 | u8 m_le_abPayload[256 /*D_NMT_IsochrRxMaxPayload_U16 |
Greg Kroah-Hartman | e0ca059 | 2008-12-19 17:09:38 -0800 | [diff] [blame] | 170 | / D_NMT_IsochrTxMaxPayload_U16 */ ]; |
Daniel Krueger | 9d7164c | 2008-12-19 11:41:57 -0800 | [diff] [blame] | 171 | |
| 172 | } PACK_STRUCT tEplPresFrame; |
| 173 | |
Greg Kroah-Hartman | e0ca059 | 2008-12-19 17:09:38 -0800 | [diff] [blame] | 174 | typedef struct { |
| 175 | // Offset 17 |
Greg Kroah-Hartman | 2ed53cf | 2009-03-23 12:36:38 -0700 | [diff] [blame] | 176 | u8 m_le_bNmtStatus; // NMT state |
Greg Kroah-Hartman | e0ca059 | 2008-12-19 17:09:38 -0800 | [diff] [blame] | 177 | // Offset 18 |
Greg Kroah-Hartman | 2ed53cf | 2009-03-23 12:36:38 -0700 | [diff] [blame] | 178 | u8 m_le_bFlag1; // Flags: EA, ER |
Greg Kroah-Hartman | e0ca059 | 2008-12-19 17:09:38 -0800 | [diff] [blame] | 179 | // Offset 19 |
Greg Kroah-Hartman | 2ed53cf | 2009-03-23 12:36:38 -0700 | [diff] [blame] | 180 | u8 m_le_bFlag2; // Flags: res |
Greg Kroah-Hartman | e0ca059 | 2008-12-19 17:09:38 -0800 | [diff] [blame] | 181 | // Offset 20 |
Greg Kroah-Hartman | 2ed53cf | 2009-03-23 12:36:38 -0700 | [diff] [blame] | 182 | u8 m_le_bReqServiceId; |
Greg Kroah-Hartman | e0ca059 | 2008-12-19 17:09:38 -0800 | [diff] [blame] | 183 | // Offset 21 |
Greg Kroah-Hartman | 2ed53cf | 2009-03-23 12:36:38 -0700 | [diff] [blame] | 184 | u8 m_le_bReqServiceTarget; |
Greg Kroah-Hartman | e0ca059 | 2008-12-19 17:09:38 -0800 | [diff] [blame] | 185 | // Offset 22 |
Greg Kroah-Hartman | 2ed53cf | 2009-03-23 12:36:38 -0700 | [diff] [blame] | 186 | u8 m_le_bEplVersion; |
Daniel Krueger | 9d7164c | 2008-12-19 11:41:57 -0800 | [diff] [blame] | 187 | |
| 188 | } PACK_STRUCT tEplSoaFrame; |
| 189 | |
Greg Kroah-Hartman | e0ca059 | 2008-12-19 17:09:38 -0800 | [diff] [blame] | 190 | typedef struct { |
Greg Kroah-Hartman | dcf5371 | 2009-03-23 12:57:39 -0700 | [diff] [blame] | 191 | u16 m_wEntryType; |
| 192 | u16 m_wErrorCode; |
Greg Kroah-Hartman | e0ca059 | 2008-12-19 17:09:38 -0800 | [diff] [blame] | 193 | tEplNetTime m_TimeStamp; |
Greg Kroah-Hartman | 2ed53cf | 2009-03-23 12:36:38 -0700 | [diff] [blame] | 194 | u8 m_abAddInfo[8]; |
Daniel Krueger | 9d7164c | 2008-12-19 11:41:57 -0800 | [diff] [blame] | 195 | |
| 196 | } PACK_STRUCT tEplErrHistoryEntry; |
| 197 | |
Greg Kroah-Hartman | e0ca059 | 2008-12-19 17:09:38 -0800 | [diff] [blame] | 198 | typedef struct { |
| 199 | // Offset 18 |
Greg Kroah-Hartman | 2ed53cf | 2009-03-23 12:36:38 -0700 | [diff] [blame] | 200 | u8 m_le_bFlag1; // Flags: EN, EC |
| 201 | u8 m_le_bFlag2; // Flags: PR, RS |
| 202 | u8 m_le_bNmtStatus; // NMT state |
| 203 | u8 m_le_bRes1[3]; |
Greg Kroah-Hartman | a5c30d9 | 2009-03-23 12:43:05 -0700 | [diff] [blame] | 204 | u64 m_le_qwStaticError; // static error bit field |
Greg Kroah-Hartman | e0ca059 | 2008-12-19 17:09:38 -0800 | [diff] [blame] | 205 | tEplErrHistoryEntry m_le_aErrHistoryEntry[14]; |
Daniel Krueger | 9d7164c | 2008-12-19 11:41:57 -0800 | [diff] [blame] | 206 | |
| 207 | } PACK_STRUCT tEplStatusResponse; |
| 208 | |
Greg Kroah-Hartman | e0ca059 | 2008-12-19 17:09:38 -0800 | [diff] [blame] | 209 | typedef struct { |
| 210 | // Offset 18 |
Greg Kroah-Hartman | 2ed53cf | 2009-03-23 12:36:38 -0700 | [diff] [blame] | 211 | u8 m_le_bFlag1; // Flags: res |
| 212 | u8 m_le_bFlag2; // Flags: PR, RS |
| 213 | u8 m_le_bNmtStatus; // NMT state |
| 214 | u8 m_le_bIdentRespFlags; // Flags: FW |
| 215 | u8 m_le_bEplProfileVersion; |
| 216 | u8 m_le_bRes1; |
Greg Kroah-Hartman | d539cfb | 2009-03-23 12:51:37 -0700 | [diff] [blame] | 217 | u32 m_le_dwFeatureFlags; // NMT_FeatureFlags_U32 |
Greg Kroah-Hartman | dcf5371 | 2009-03-23 12:57:39 -0700 | [diff] [blame] | 218 | u16 m_le_wMtu; // NMT_CycleTiming_REC.AsyncMTU_U16: C_IP_MIN_MTU - C_IP_MAX_MTU |
| 219 | u16 m_le_wPollInSize; // NMT_CycleTiming_REC.PReqActPayload_U16 |
| 220 | u16 m_le_wPollOutSize; // NMT_CycleTiming_REC.PResActPayload_U16 |
Greg Kroah-Hartman | d539cfb | 2009-03-23 12:51:37 -0700 | [diff] [blame] | 221 | u32 m_le_dwResponseTime; // NMT_CycleTiming_REC.PResMaxLatency_U32 |
Greg Kroah-Hartman | dcf5371 | 2009-03-23 12:57:39 -0700 | [diff] [blame] | 222 | u16 m_le_wRes2; |
Greg Kroah-Hartman | d539cfb | 2009-03-23 12:51:37 -0700 | [diff] [blame] | 223 | u32 m_le_dwDeviceType; // NMT_DeviceType_U32 |
| 224 | u32 m_le_dwVendorId; // NMT_IdentityObject_REC.VendorId_U32 |
| 225 | u32 m_le_dwProductCode; // NMT_IdentityObject_REC.ProductCode_U32 |
| 226 | u32 m_le_dwRevisionNumber; // NMT_IdentityObject_REC.RevisionNo_U32 |
| 227 | u32 m_le_dwSerialNumber; // NMT_IdentityObject_REC.SerialNo_U32 |
Greg Kroah-Hartman | a5c30d9 | 2009-03-23 12:43:05 -0700 | [diff] [blame] | 228 | u64 m_le_qwVendorSpecificExt1; |
Greg Kroah-Hartman | d539cfb | 2009-03-23 12:51:37 -0700 | [diff] [blame] | 229 | u32 m_le_dwVerifyConfigurationDate; // CFM_VerifyConfiguration_REC.ConfDate_U32 |
| 230 | u32 m_le_dwVerifyConfigurationTime; // CFM_VerifyConfiguration_REC.ConfTime_U32 |
| 231 | u32 m_le_dwApplicationSwDate; // PDL_LocVerApplSw_REC.ApplSwDate_U32 on programmable device or date portion of NMT_ManufactSwVers_VS on non-programmable device |
| 232 | u32 m_le_dwApplicationSwTime; // PDL_LocVerApplSw_REC.ApplSwTime_U32 on programmable device or time portion of NMT_ManufactSwVers_VS on non-programmable device |
| 233 | u32 m_le_dwIpAddress; |
| 234 | u32 m_le_dwSubnetMask; |
| 235 | u32 m_le_dwDefaultGateway; |
Greg Kroah-Hartman | 2ed53cf | 2009-03-23 12:36:38 -0700 | [diff] [blame] | 236 | u8 m_le_sHostname[32]; |
| 237 | u8 m_le_abVendorSpecificExt2[48]; |
Daniel Krueger | 9d7164c | 2008-12-19 11:41:57 -0800 | [diff] [blame] | 238 | |
| 239 | } PACK_STRUCT tEplIdentResponse; |
| 240 | |
Greg Kroah-Hartman | e0ca059 | 2008-12-19 17:09:38 -0800 | [diff] [blame] | 241 | typedef struct { |
| 242 | // Offset 18 |
Greg Kroah-Hartman | 2ed53cf | 2009-03-23 12:36:38 -0700 | [diff] [blame] | 243 | u8 m_le_bNmtCommandId; |
| 244 | u8 m_le_bRes1; |
| 245 | u8 m_le_abNmtCommandData[32]; |
Daniel Krueger | 9d7164c | 2008-12-19 11:41:57 -0800 | [diff] [blame] | 246 | |
| 247 | } PACK_STRUCT tEplNmtCommandService; |
| 248 | |
Greg Kroah-Hartman | e0ca059 | 2008-12-19 17:09:38 -0800 | [diff] [blame] | 249 | typedef struct { |
Greg Kroah-Hartman | 2ed53cf | 2009-03-23 12:36:38 -0700 | [diff] [blame] | 250 | u8 m_le_bReserved; |
| 251 | u8 m_le_bTransactionId; |
| 252 | u8 m_le_bFlags; |
| 253 | u8 m_le_bCommandId; |
Greg Kroah-Hartman | dcf5371 | 2009-03-23 12:57:39 -0700 | [diff] [blame] | 254 | u16 m_le_wSegmentSize; |
| 255 | u16 m_le_wReserved; |
Greg Kroah-Hartman | 2ed53cf | 2009-03-23 12:36:38 -0700 | [diff] [blame] | 256 | u8 m_le_abCommandData[8]; // just reserve a minimum number of bytes as a placeholder |
Daniel Krueger | 9d7164c | 2008-12-19 11:41:57 -0800 | [diff] [blame] | 257 | |
Greg Kroah-Hartman | e0ca059 | 2008-12-19 17:09:38 -0800 | [diff] [blame] | 258 | } PACK_STRUCT tEplAsySdoCom; |
Daniel Krueger | 9d7164c | 2008-12-19 11:41:57 -0800 | [diff] [blame] | 259 | |
| 260 | // asynchronous SDO Sequence Header |
Greg Kroah-Hartman | e0ca059 | 2008-12-19 17:09:38 -0800 | [diff] [blame] | 261 | typedef struct { |
Greg Kroah-Hartman | 2ed53cf | 2009-03-23 12:36:38 -0700 | [diff] [blame] | 262 | u8 m_le_bRecSeqNumCon; |
| 263 | u8 m_le_bSendSeqNumCon; |
| 264 | u8 m_le_abReserved[2]; |
Greg Kroah-Hartman | e0ca059 | 2008-12-19 17:09:38 -0800 | [diff] [blame] | 265 | tEplAsySdoCom m_le_abSdoSeqPayload; |
Daniel Krueger | 9d7164c | 2008-12-19 11:41:57 -0800 | [diff] [blame] | 266 | |
| 267 | } PACK_STRUCT tEplAsySdoSeq; |
| 268 | |
Greg Kroah-Hartman | e0ca059 | 2008-12-19 17:09:38 -0800 | [diff] [blame] | 269 | typedef struct { |
| 270 | // Offset 18 |
Greg Kroah-Hartman | 2ed53cf | 2009-03-23 12:36:38 -0700 | [diff] [blame] | 271 | u8 m_le_bNmtCommandId; |
| 272 | u8 m_le_bTargetNodeId; |
| 273 | u8 m_le_abNmtCommandData[32]; |
Daniel Krueger | 9d7164c | 2008-12-19 11:41:57 -0800 | [diff] [blame] | 274 | |
| 275 | } PACK_STRUCT tEplNmtRequestService; |
| 276 | |
Greg Kroah-Hartman | e0ca059 | 2008-12-19 17:09:38 -0800 | [diff] [blame] | 277 | typedef union { |
| 278 | // Offset 18 |
| 279 | tEplStatusResponse m_StatusResponse; |
| 280 | tEplIdentResponse m_IdentResponse; |
| 281 | tEplNmtCommandService m_NmtCommandService; |
| 282 | tEplNmtRequestService m_NmtRequestService; |
| 283 | tEplAsySdoSeq m_SdoSequenceFrame; |
Greg Kroah-Hartman | 2ed53cf | 2009-03-23 12:36:38 -0700 | [diff] [blame] | 284 | u8 m_le_abPayload[256 /*D_NMT_ASndTxMaxPayload_U16 |
Greg Kroah-Hartman | e0ca059 | 2008-12-19 17:09:38 -0800 | [diff] [blame] | 285 | / D_NMT_ASndRxMaxPayload_U16 */ ]; |
Daniel Krueger | 9d7164c | 2008-12-19 11:41:57 -0800 | [diff] [blame] | 286 | |
| 287 | } tEplAsndPayload; |
| 288 | |
Greg Kroah-Hartman | e0ca059 | 2008-12-19 17:09:38 -0800 | [diff] [blame] | 289 | typedef struct { |
| 290 | // Offset 17 |
Greg Kroah-Hartman | 2ed53cf | 2009-03-23 12:36:38 -0700 | [diff] [blame] | 291 | u8 m_le_bServiceId; |
Greg Kroah-Hartman | e0ca059 | 2008-12-19 17:09:38 -0800 | [diff] [blame] | 292 | // Offset 18 |
| 293 | tEplAsndPayload m_Payload; |
Daniel Krueger | 9d7164c | 2008-12-19 11:41:57 -0800 | [diff] [blame] | 294 | |
| 295 | } PACK_STRUCT tEplAsndFrame; |
| 296 | |
Greg Kroah-Hartman | e0ca059 | 2008-12-19 17:09:38 -0800 | [diff] [blame] | 297 | typedef union { |
| 298 | // Offset 17 |
| 299 | tEplSocFrame m_Soc; |
| 300 | tEplPreqFrame m_Preq; |
| 301 | tEplPresFrame m_Pres; |
| 302 | tEplSoaFrame m_Soa; |
| 303 | tEplAsndFrame m_Asnd; |
Daniel Krueger | 9d7164c | 2008-12-19 11:41:57 -0800 | [diff] [blame] | 304 | |
| 305 | } tEplFrameData; |
| 306 | |
Greg Kroah-Hartman | e0ca059 | 2008-12-19 17:09:38 -0800 | [diff] [blame] | 307 | typedef struct { |
| 308 | // Offset 0 |
Greg Kroah-Hartman | 2ed53cf | 2009-03-23 12:36:38 -0700 | [diff] [blame] | 309 | u8 m_be_abDstMac[6]; // MAC address of the addressed nodes |
Greg Kroah-Hartman | e0ca059 | 2008-12-19 17:09:38 -0800 | [diff] [blame] | 310 | // Offset 6 |
Greg Kroah-Hartman | 2ed53cf | 2009-03-23 12:36:38 -0700 | [diff] [blame] | 311 | u8 m_be_abSrcMac[6]; // MAC address of the transmitting node |
Greg Kroah-Hartman | e0ca059 | 2008-12-19 17:09:38 -0800 | [diff] [blame] | 312 | // Offset 12 |
Greg Kroah-Hartman | dcf5371 | 2009-03-23 12:57:39 -0700 | [diff] [blame] | 313 | u16 m_be_wEtherType; // Ethernet message type (big endian) |
Greg Kroah-Hartman | e0ca059 | 2008-12-19 17:09:38 -0800 | [diff] [blame] | 314 | // Offset 14 |
Greg Kroah-Hartman | 2ed53cf | 2009-03-23 12:36:38 -0700 | [diff] [blame] | 315 | u8 m_le_bMessageType; // EPL message type |
Greg Kroah-Hartman | e0ca059 | 2008-12-19 17:09:38 -0800 | [diff] [blame] | 316 | // Offset 15 |
Greg Kroah-Hartman | 2ed53cf | 2009-03-23 12:36:38 -0700 | [diff] [blame] | 317 | u8 m_le_bDstNodeId; // EPL node ID of the addressed nodes |
Greg Kroah-Hartman | e0ca059 | 2008-12-19 17:09:38 -0800 | [diff] [blame] | 318 | // Offset 16 |
Greg Kroah-Hartman | 2ed53cf | 2009-03-23 12:36:38 -0700 | [diff] [blame] | 319 | u8 m_le_bSrcNodeId; // EPL node ID of the transmitting node |
Greg Kroah-Hartman | e0ca059 | 2008-12-19 17:09:38 -0800 | [diff] [blame] | 320 | // Offset 17 |
| 321 | tEplFrameData m_Data; |
Daniel Krueger | 9d7164c | 2008-12-19 11:41:57 -0800 | [diff] [blame] | 322 | |
| 323 | } PACK_STRUCT tEplFrame; |
| 324 | |
| 325 | // un-byte-align structures |
| 326 | #ifdef _MSC_VER |
| 327 | # pragma pack( pop, packing ) |
| 328 | #endif |
| 329 | |
Greg Kroah-Hartman | e0ca059 | 2008-12-19 17:09:38 -0800 | [diff] [blame] | 330 | typedef enum { |
| 331 | kEplMsgTypeNonEpl = 0x00, |
| 332 | kEplMsgTypeSoc = 0x01, |
| 333 | kEplMsgTypePreq = 0x03, |
| 334 | kEplMsgTypePres = 0x04, |
| 335 | kEplMsgTypeSoa = 0x05, |
| 336 | kEplMsgTypeAsnd = 0x06, |
Daniel Krueger | 9d7164c | 2008-12-19 11:41:57 -0800 | [diff] [blame] | 337 | |
| 338 | } tEplMsgType; |
| 339 | |
Daniel Krueger | 9d7164c | 2008-12-19 11:41:57 -0800 | [diff] [blame] | 340 | //--------------------------------------------------------------------------- |
| 341 | // function prototypes |
| 342 | //--------------------------------------------------------------------------- |
| 343 | |
Greg Kroah-Hartman | e0ca059 | 2008-12-19 17:09:38 -0800 | [diff] [blame] | 344 | #endif // #ifndef _EPL_FRAME_H_ |