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: source file for communication abstraction layer |
| 9 | for the Epl-Obd-Userspace-Modul |
| 10 | |
| 11 | License: |
| 12 | |
| 13 | Redistribution and use in source and binary forms, with or without |
| 14 | modification, are permitted provided that the following conditions |
| 15 | are met: |
| 16 | |
| 17 | 1. Redistributions of source code must retain the above copyright |
| 18 | notice, this list of conditions and the following disclaimer. |
| 19 | |
| 20 | 2. Redistributions in binary form must reproduce the above copyright |
| 21 | notice, this list of conditions and the following disclaimer in the |
| 22 | documentation and/or other materials provided with the distribution. |
| 23 | |
| 24 | 3. Neither the name of SYSTEC electronic GmbH nor the names of its |
| 25 | contributors may be used to endorse or promote products derived |
| 26 | from this software without prior written permission. For written |
| 27 | permission, please contact info@systec-electronic.com. |
| 28 | |
| 29 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS |
| 30 | "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT |
| 31 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS |
| 32 | FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE |
| 33 | COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, |
| 34 | INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, |
| 35 | BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; |
| 36 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER |
| 37 | CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT |
| 38 | LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN |
| 39 | ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE |
| 40 | POSSIBILITY OF SUCH DAMAGE. |
| 41 | |
| 42 | Severability Clause: |
| 43 | |
| 44 | If a provision of this License is or becomes illegal, invalid or |
| 45 | unenforceable in any jurisdiction, that shall not affect: |
| 46 | 1. the validity or enforceability in that jurisdiction of any other |
| 47 | provision of this License; or |
| 48 | 2. the validity or enforceability in other jurisdictions of that or |
| 49 | any other provision of this License. |
| 50 | |
| 51 | ------------------------------------------------------------------------- |
| 52 | |
| 53 | $RCSfile: EplObduCal.c,v $ |
| 54 | |
| 55 | $Author: D.Krueger $ |
| 56 | |
| 57 | $Revision: 1.6 $ $Date: 2008/10/17 15:32:32 $ |
| 58 | |
| 59 | $State: Exp $ |
| 60 | |
| 61 | Build Environment: |
| 62 | GCC V3.4 |
| 63 | |
| 64 | ------------------------------------------------------------------------- |
| 65 | |
| 66 | Revision History: |
| 67 | |
| 68 | 2006/06/19 k.t.: start of the implementation |
| 69 | |
| 70 | ****************************************************************************/ |
| 71 | #include "EplInc.h" |
| 72 | #include "user/EplObduCal.h" |
| 73 | #include "kernel/EplObdk.h" |
| 74 | |
| 75 | #if (((EPL_MODULE_INTEGRATION) & (EPL_MODULE_OBDU)) != 0) && (EPL_OBD_USE_KERNEL != FALSE) |
| 76 | |
Daniel Krueger | 9d7164c | 2008-12-19 11:41:57 -0800 | [diff] [blame] | 77 | /***************************************************************************/ |
| 78 | /* */ |
| 79 | /* */ |
| 80 | /* G L O B A L D E F I N I T I O N S */ |
| 81 | /* */ |
| 82 | /* */ |
| 83 | /***************************************************************************/ |
| 84 | |
| 85 | //--------------------------------------------------------------------------- |
| 86 | // const defines |
| 87 | //--------------------------------------------------------------------------- |
| 88 | |
| 89 | //--------------------------------------------------------------------------- |
| 90 | // local types |
| 91 | //--------------------------------------------------------------------------- |
| 92 | |
| 93 | //--------------------------------------------------------------------------- |
| 94 | // modul globale vars |
| 95 | //--------------------------------------------------------------------------- |
| 96 | |
| 97 | //--------------------------------------------------------------------------- |
| 98 | // local function prototypes |
| 99 | //--------------------------------------------------------------------------- |
| 100 | |
Daniel Krueger | 9d7164c | 2008-12-19 11:41:57 -0800 | [diff] [blame] | 101 | //=========================================================================// |
| 102 | // // |
| 103 | // P U B L I C F U N C T I O N S // |
| 104 | // // |
| 105 | //=========================================================================// |
| 106 | |
| 107 | //--------------------------------------------------------------------------- |
| 108 | // |
| 109 | // Function: EplObduCalWriteEntry() |
| 110 | // |
| 111 | // Description: Function encapsulate access of function EplObdWriteEntry |
| 112 | // |
| 113 | // Parameters: uiIndex_p = Index of the OD entry |
| 114 | // uiSubIndex_p = Subindex of the OD Entry |
| 115 | // pSrcData_p = Pointer to the data to write |
| 116 | // Size_p = Size of the data in Byte |
| 117 | // |
| 118 | // Return: tEplKernel = Errorcode |
| 119 | // |
| 120 | // |
| 121 | // State: |
| 122 | // |
| 123 | //--------------------------------------------------------------------------- |
Greg Kroah-Hartman | 833dfbe | 2008-12-19 17:11:52 -0800 | [diff] [blame] | 124 | EPLDLLEXPORT tEplKernel PUBLIC EplObduCalWriteEntry(unsigned int uiIndex_p, |
| 125 | unsigned int uiSubIndex_p, |
| 126 | void *pSrcData_p, |
| 127 | tEplObdSize Size_p) |
Daniel Krueger | 9d7164c | 2008-12-19 11:41:57 -0800 | [diff] [blame] | 128 | { |
Greg Kroah-Hartman | 833dfbe | 2008-12-19 17:11:52 -0800 | [diff] [blame] | 129 | tEplKernel Ret; |
Daniel Krueger | 9d7164c | 2008-12-19 11:41:57 -0800 | [diff] [blame] | 130 | |
| 131 | #if(((EPL_MODULE_INTEGRATION) & (EPL_MODULE_OBDK)) != 0) |
Greg Kroah-Hartman | 833dfbe | 2008-12-19 17:11:52 -0800 | [diff] [blame] | 132 | Ret = EplObdWriteEntry(uiIndex_p, uiSubIndex_p, pSrcData_p, Size_p); |
Daniel Krueger | 9d7164c | 2008-12-19 11:41:57 -0800 | [diff] [blame] | 133 | #else |
Greg Kroah-Hartman | 833dfbe | 2008-12-19 17:11:52 -0800 | [diff] [blame] | 134 | Ret = kEplSuccessful; |
Daniel Krueger | 9d7164c | 2008-12-19 11:41:57 -0800 | [diff] [blame] | 135 | #endif |
| 136 | |
Greg Kroah-Hartman | 833dfbe | 2008-12-19 17:11:52 -0800 | [diff] [blame] | 137 | return Ret; |
Daniel Krueger | 9d7164c | 2008-12-19 11:41:57 -0800 | [diff] [blame] | 138 | } |
| 139 | |
Daniel Krueger | 9d7164c | 2008-12-19 11:41:57 -0800 | [diff] [blame] | 140 | //--------------------------------------------------------------------------- |
| 141 | // |
| 142 | // Function: EplObduCalReadEntry() |
| 143 | // |
| 144 | // Description: Function encapsulate access of function EplObdReadEntry |
| 145 | // |
| 146 | // Parameters: uiIndex_p = Index oof the OD entry to read |
| 147 | // uiSubIndex_p = Subindex to read |
| 148 | // pDstData_p = pointer to the buffer for data |
| 149 | // Offset_p = offset in data for read access |
| 150 | // pSize_p = IN: Size of the buffer |
| 151 | // OUT: number of readed Bytes |
| 152 | // |
| 153 | // Return: tEplKernel = errorcode |
| 154 | // |
| 155 | // State: |
| 156 | // |
| 157 | //--------------------------------------------------------------------------- |
Greg Kroah-Hartman | 833dfbe | 2008-12-19 17:11:52 -0800 | [diff] [blame] | 158 | EPLDLLEXPORT tEplKernel PUBLIC EplObduCalReadEntry(unsigned int uiIndex_p, |
| 159 | unsigned int uiSubIndex_p, |
| 160 | void *pDstData_p, |
| 161 | tEplObdSize * pSize_p) |
Daniel Krueger | 9d7164c | 2008-12-19 11:41:57 -0800 | [diff] [blame] | 162 | { |
Greg Kroah-Hartman | 833dfbe | 2008-12-19 17:11:52 -0800 | [diff] [blame] | 163 | tEplKernel Ret; |
Daniel Krueger | 9d7164c | 2008-12-19 11:41:57 -0800 | [diff] [blame] | 164 | |
| 165 | #if(((EPL_MODULE_INTEGRATION) & (EPL_MODULE_OBDK)) != 0) |
Greg Kroah-Hartman | 833dfbe | 2008-12-19 17:11:52 -0800 | [diff] [blame] | 166 | Ret = EplObdReadEntry(uiIndex_p, uiSubIndex_p, pDstData_p, pSize_p); |
Daniel Krueger | 9d7164c | 2008-12-19 11:41:57 -0800 | [diff] [blame] | 167 | #else |
Greg Kroah-Hartman | 833dfbe | 2008-12-19 17:11:52 -0800 | [diff] [blame] | 168 | Ret = kEplSuccessful; |
Daniel Krueger | 9d7164c | 2008-12-19 11:41:57 -0800 | [diff] [blame] | 169 | #endif |
| 170 | |
Greg Kroah-Hartman | 833dfbe | 2008-12-19 17:11:52 -0800 | [diff] [blame] | 171 | return Ret; |
Daniel Krueger | 9d7164c | 2008-12-19 11:41:57 -0800 | [diff] [blame] | 172 | } |
| 173 | |
Daniel Krueger | 9d7164c | 2008-12-19 11:41:57 -0800 | [diff] [blame] | 174 | //--------------------------------------------------------------------------- |
| 175 | // |
| 176 | // Function: EplObduCalAccessOdPart() |
| 177 | // |
| 178 | // Description: Function encapsulate access of function EplObdAccessOdPart |
| 179 | // |
| 180 | // Parameters: ObdPart_p = od-part to reset |
| 181 | // Direction_p = directory flag for |
| 182 | // |
| 183 | // Return: tEplKernel = errorcode |
| 184 | // |
| 185 | // State: |
| 186 | // |
| 187 | //--------------------------------------------------------------------------- |
Greg Kroah-Hartman | 833dfbe | 2008-12-19 17:11:52 -0800 | [diff] [blame] | 188 | EPLDLLEXPORT tEplKernel PUBLIC EplObduCalAccessOdPart(tEplObdPart ObdPart_p, |
| 189 | tEplObdDir Direction_p) |
Daniel Krueger | 9d7164c | 2008-12-19 11:41:57 -0800 | [diff] [blame] | 190 | { |
Greg Kroah-Hartman | 833dfbe | 2008-12-19 17:11:52 -0800 | [diff] [blame] | 191 | tEplKernel Ret; |
Daniel Krueger | 9d7164c | 2008-12-19 11:41:57 -0800 | [diff] [blame] | 192 | |
| 193 | #if(((EPL_MODULE_INTEGRATION) & (EPL_MODULE_OBDK)) != 0) |
Greg Kroah-Hartman | 833dfbe | 2008-12-19 17:11:52 -0800 | [diff] [blame] | 194 | Ret = EplObdAccessOdPart(ObdPart_p, Direction_p); |
Daniel Krueger | 9d7164c | 2008-12-19 11:41:57 -0800 | [diff] [blame] | 195 | #else |
Greg Kroah-Hartman | 833dfbe | 2008-12-19 17:11:52 -0800 | [diff] [blame] | 196 | Ret = kEplSuccessful; |
Daniel Krueger | 9d7164c | 2008-12-19 11:41:57 -0800 | [diff] [blame] | 197 | #endif |
| 198 | |
Greg Kroah-Hartman | 833dfbe | 2008-12-19 17:11:52 -0800 | [diff] [blame] | 199 | return Ret; |
Daniel Krueger | 9d7164c | 2008-12-19 11:41:57 -0800 | [diff] [blame] | 200 | } |
| 201 | |
| 202 | //--------------------------------------------------------------------------- |
| 203 | // |
| 204 | // Function: EplObduCalDefineVar() |
| 205 | // |
| 206 | // Description: Function encapsulate access of function EplObdDefineVar |
| 207 | // |
| 208 | // Parameters: pEplVarParam_p = varentry |
| 209 | // |
| 210 | // Return: tEplKernel = errorcode |
| 211 | // |
| 212 | // State: |
| 213 | // |
| 214 | //--------------------------------------------------------------------------- |
Greg Kroah-Hartman | 833dfbe | 2008-12-19 17:11:52 -0800 | [diff] [blame] | 215 | EPLDLLEXPORT tEplKernel PUBLIC EplObduCalDefineVar(tEplVarParam MEM * |
| 216 | pVarParam_p) |
Daniel Krueger | 9d7164c | 2008-12-19 11:41:57 -0800 | [diff] [blame] | 217 | { |
Greg Kroah-Hartman | 833dfbe | 2008-12-19 17:11:52 -0800 | [diff] [blame] | 218 | tEplKernel Ret; |
Daniel Krueger | 9d7164c | 2008-12-19 11:41:57 -0800 | [diff] [blame] | 219 | |
| 220 | #if(((EPL_MODULE_INTEGRATION) & (EPL_MODULE_OBDK)) != 0) |
Greg Kroah-Hartman | 833dfbe | 2008-12-19 17:11:52 -0800 | [diff] [blame] | 221 | Ret = EplObdDefineVar(pVarParam_p); |
Daniel Krueger | 9d7164c | 2008-12-19 11:41:57 -0800 | [diff] [blame] | 222 | #else |
Greg Kroah-Hartman | 833dfbe | 2008-12-19 17:11:52 -0800 | [diff] [blame] | 223 | Ret = kEplSuccessful; |
Daniel Krueger | 9d7164c | 2008-12-19 11:41:57 -0800 | [diff] [blame] | 224 | #endif |
| 225 | |
Greg Kroah-Hartman | 833dfbe | 2008-12-19 17:11:52 -0800 | [diff] [blame] | 226 | return Ret; |
Daniel Krueger | 9d7164c | 2008-12-19 11:41:57 -0800 | [diff] [blame] | 227 | } |
| 228 | |
| 229 | //--------------------------------------------------------------------------- |
| 230 | // |
| 231 | // Function: EplObduCalGetObjectDataPtr() |
| 232 | // |
| 233 | // Description: Function encapsulate access of function EplObdGetObjectDataPtr |
| 234 | // |
| 235 | // Parameters: uiIndex_p = Index of the entry |
| 236 | // uiSubindex_p = Subindex of the entry |
| 237 | // |
| 238 | // Return: void * = pointer to object data |
| 239 | // |
| 240 | // State: |
| 241 | // |
| 242 | //--------------------------------------------------------------------------- |
Greg Kroah-Hartman | 833dfbe | 2008-12-19 17:11:52 -0800 | [diff] [blame] | 243 | EPLDLLEXPORT void *PUBLIC EplObduCalGetObjectDataPtr(unsigned int uiIndex_p, |
| 244 | unsigned int uiSubIndex_p) |
Daniel Krueger | 9d7164c | 2008-12-19 11:41:57 -0800 | [diff] [blame] | 245 | { |
Greg Kroah-Hartman | 833dfbe | 2008-12-19 17:11:52 -0800 | [diff] [blame] | 246 | void *pData; |
Daniel Krueger | 9d7164c | 2008-12-19 11:41:57 -0800 | [diff] [blame] | 247 | |
| 248 | #if(((EPL_MODULE_INTEGRATION) & (EPL_MODULE_OBDK)) != 0) |
Greg Kroah-Hartman | 833dfbe | 2008-12-19 17:11:52 -0800 | [diff] [blame] | 249 | pData = EplObdGetObjectDataPtr(uiIndex_p, uiSubIndex_p); |
Daniel Krueger | 9d7164c | 2008-12-19 11:41:57 -0800 | [diff] [blame] | 250 | #else |
Greg Kroah-Hartman | 833dfbe | 2008-12-19 17:11:52 -0800 | [diff] [blame] | 251 | pData = NULL; |
Daniel Krueger | 9d7164c | 2008-12-19 11:41:57 -0800 | [diff] [blame] | 252 | #endif |
| 253 | |
Greg Kroah-Hartman | 833dfbe | 2008-12-19 17:11:52 -0800 | [diff] [blame] | 254 | return pData; |
Daniel Krueger | 9d7164c | 2008-12-19 11:41:57 -0800 | [diff] [blame] | 255 | } |
| 256 | |
| 257 | //--------------------------------------------------------------------------- |
| 258 | // |
| 259 | // Function: EplObduCalRegisterUserOd() |
| 260 | // |
| 261 | // Description: Function encapsulate access of function EplObdRegisterUserOd |
| 262 | // |
| 263 | // Parameters: pUserOd_p = pointer to user OD |
| 264 | // |
| 265 | // Return: tEplKernel = errorcode |
| 266 | // |
| 267 | // State: |
| 268 | // |
| 269 | //--------------------------------------------------------------------------- |
| 270 | #if (defined (EPL_OBD_USER_OD) && (EPL_OBD_USER_OD != FALSE)) |
Greg Kroah-Hartman | 833dfbe | 2008-12-19 17:11:52 -0800 | [diff] [blame] | 271 | EPLDLLEXPORT tEplKernel PUBLIC EplObduCalRegisterUserOd(tEplObdEntryPtr |
| 272 | pUserOd_p) |
Daniel Krueger | 9d7164c | 2008-12-19 11:41:57 -0800 | [diff] [blame] | 273 | { |
Greg Kroah-Hartman | 833dfbe | 2008-12-19 17:11:52 -0800 | [diff] [blame] | 274 | tEplKernel Ret; |
Daniel Krueger | 9d7164c | 2008-12-19 11:41:57 -0800 | [diff] [blame] | 275 | |
| 276 | #if(((EPL_MODULE_INTEGRATION) & (EPL_MODULE_OBDK)) != 0) |
Greg Kroah-Hartman | 833dfbe | 2008-12-19 17:11:52 -0800 | [diff] [blame] | 277 | Ret = EplObdRegisterUserOd(pUserOd_p); |
Daniel Krueger | 9d7164c | 2008-12-19 11:41:57 -0800 | [diff] [blame] | 278 | #else |
Greg Kroah-Hartman | 833dfbe | 2008-12-19 17:11:52 -0800 | [diff] [blame] | 279 | Ret = kEplSuccessful; |
Daniel Krueger | 9d7164c | 2008-12-19 11:41:57 -0800 | [diff] [blame] | 280 | #endif |
| 281 | |
Greg Kroah-Hartman | 833dfbe | 2008-12-19 17:11:52 -0800 | [diff] [blame] | 282 | return Ret; |
Daniel Krueger | 9d7164c | 2008-12-19 11:41:57 -0800 | [diff] [blame] | 283 | |
| 284 | } |
| 285 | #endif |
| 286 | //--------------------------------------------------------------------------- |
| 287 | // |
| 288 | // Function: EplObduCalInitVarEntry() |
| 289 | // |
| 290 | // Description: Function encapsulate access of function EplObdInitVarEntry |
| 291 | // |
| 292 | // Parameters: pVarEntry_p = pointer to var entry structure |
| 293 | // bType_p = object type |
| 294 | // ObdSize_p = size of object data |
| 295 | // |
| 296 | // Returns: none |
| 297 | // |
| 298 | // State: |
| 299 | // |
| 300 | //--------------------------------------------------------------------------- |
Greg Kroah-Hartman | 833dfbe | 2008-12-19 17:11:52 -0800 | [diff] [blame] | 301 | EPLDLLEXPORT void PUBLIC EplObduCalInitVarEntry(tEplObdVarEntry MEM * |
| 302 | pVarEntry_p, BYTE bType_p, |
| 303 | tEplObdSize ObdSize_p) |
Daniel Krueger | 9d7164c | 2008-12-19 11:41:57 -0800 | [diff] [blame] | 304 | { |
| 305 | #if(((EPL_MODULE_INTEGRATION) & (EPL_MODULE_OBDK)) != 0) |
Greg Kroah-Hartman | 833dfbe | 2008-12-19 17:11:52 -0800 | [diff] [blame] | 306 | EplObdInitVarEntry(pVarEntry_p, bType_p, ObdSize_p); |
Daniel Krueger | 9d7164c | 2008-12-19 11:41:57 -0800 | [diff] [blame] | 307 | #endif |
| 308 | } |
| 309 | |
Daniel Krueger | 9d7164c | 2008-12-19 11:41:57 -0800 | [diff] [blame] | 310 | //--------------------------------------------------------------------------- |
| 311 | // |
| 312 | // Function: EplObduCalGetDataSize() |
| 313 | // |
| 314 | // Description: Function encapsulate access of function EplObdGetDataSize |
| 315 | // |
| 316 | // gets the data size of an object |
| 317 | // for string objects it returnes the string length |
| 318 | // |
| 319 | // Parameters: uiIndex_p = Index |
| 320 | // uiSubIndex_p= Subindex |
| 321 | // |
| 322 | // Return: tEplObdSize |
| 323 | // |
| 324 | // State: |
| 325 | // |
| 326 | //--------------------------------------------------------------------------- |
| 327 | EPLDLLEXPORT tEplObdSize PUBLIC EplObduCalGetDataSize(unsigned int uiIndex_p, |
Greg Kroah-Hartman | 833dfbe | 2008-12-19 17:11:52 -0800 | [diff] [blame] | 328 | unsigned int uiSubIndex_p) |
Daniel Krueger | 9d7164c | 2008-12-19 11:41:57 -0800 | [diff] [blame] | 329 | { |
Greg Kroah-Hartman | 833dfbe | 2008-12-19 17:11:52 -0800 | [diff] [blame] | 330 | tEplObdSize Size; |
Daniel Krueger | 9d7164c | 2008-12-19 11:41:57 -0800 | [diff] [blame] | 331 | |
| 332 | #if(((EPL_MODULE_INTEGRATION) & (EPL_MODULE_OBDK)) != 0) |
Greg Kroah-Hartman | 833dfbe | 2008-12-19 17:11:52 -0800 | [diff] [blame] | 333 | Size = EplObdGetDataSize(uiIndex_p, uiSubIndex_p); |
Daniel Krueger | 9d7164c | 2008-12-19 11:41:57 -0800 | [diff] [blame] | 334 | #else |
Greg Kroah-Hartman | 833dfbe | 2008-12-19 17:11:52 -0800 | [diff] [blame] | 335 | Size = 0; |
Daniel Krueger | 9d7164c | 2008-12-19 11:41:57 -0800 | [diff] [blame] | 336 | #endif |
| 337 | |
Greg Kroah-Hartman | 833dfbe | 2008-12-19 17:11:52 -0800 | [diff] [blame] | 338 | return Size; |
Daniel Krueger | 9d7164c | 2008-12-19 11:41:57 -0800 | [diff] [blame] | 339 | } |
| 340 | |
| 341 | //--------------------------------------------------------------------------- |
| 342 | // |
| 343 | // Function: EplObduCalGetNodeId() |
| 344 | // |
| 345 | // Description: Function encapsulate access of function EplObdGetNodeId |
| 346 | // |
| 347 | // |
| 348 | // Parameters: |
| 349 | // |
| 350 | // Return: unsigned int = Node Id |
| 351 | // |
| 352 | // State: |
| 353 | // |
| 354 | //--------------------------------------------------------------------------- |
| 355 | EPLDLLEXPORT unsigned int PUBLIC EplObduCalGetNodeId() |
| 356 | { |
Greg Kroah-Hartman | 833dfbe | 2008-12-19 17:11:52 -0800 | [diff] [blame] | 357 | unsigned int uiNodeId; |
Daniel Krueger | 9d7164c | 2008-12-19 11:41:57 -0800 | [diff] [blame] | 358 | |
| 359 | #if(((EPL_MODULE_INTEGRATION) & (EPL_MODULE_OBDK)) != 0) |
Greg Kroah-Hartman | 833dfbe | 2008-12-19 17:11:52 -0800 | [diff] [blame] | 360 | uiNodeId = EplObdGetNodeId(); |
Daniel Krueger | 9d7164c | 2008-12-19 11:41:57 -0800 | [diff] [blame] | 361 | #else |
Greg Kroah-Hartman | 833dfbe | 2008-12-19 17:11:52 -0800 | [diff] [blame] | 362 | uiNodeId = 0; |
Daniel Krueger | 9d7164c | 2008-12-19 11:41:57 -0800 | [diff] [blame] | 363 | #endif |
| 364 | |
Greg Kroah-Hartman | 833dfbe | 2008-12-19 17:11:52 -0800 | [diff] [blame] | 365 | return uiNodeId; |
Daniel Krueger | 9d7164c | 2008-12-19 11:41:57 -0800 | [diff] [blame] | 366 | } |
| 367 | |
| 368 | //--------------------------------------------------------------------------- |
| 369 | // |
| 370 | // Function: EplObduCalSetNodeId() |
| 371 | // |
| 372 | // Description: Function encapsulate access of function EplObdSetNodeId |
| 373 | // |
| 374 | // |
| 375 | // Parameters: uiNodeId_p = Node Id to set |
| 376 | // NodeIdType_p= Type on which way the Node Id was set |
| 377 | // |
| 378 | // Return: tEplKernel = Errorcode |
| 379 | // |
| 380 | // State: |
| 381 | // |
| 382 | //--------------------------------------------------------------------------- |
| 383 | EPLDLLEXPORT tEplKernel PUBLIC EplObduCalSetNodeId(unsigned int uiNodeId_p, |
Greg Kroah-Hartman | 833dfbe | 2008-12-19 17:11:52 -0800 | [diff] [blame] | 384 | tEplObdNodeIdType |
| 385 | NodeIdType_p) |
Daniel Krueger | 9d7164c | 2008-12-19 11:41:57 -0800 | [diff] [blame] | 386 | { |
Greg Kroah-Hartman | 833dfbe | 2008-12-19 17:11:52 -0800 | [diff] [blame] | 387 | tEplKernel Ret; |
Daniel Krueger | 9d7164c | 2008-12-19 11:41:57 -0800 | [diff] [blame] | 388 | |
| 389 | #if(((EPL_MODULE_INTEGRATION) & (EPL_MODULE_OBDK)) != 0) |
Greg Kroah-Hartman | 833dfbe | 2008-12-19 17:11:52 -0800 | [diff] [blame] | 390 | Ret = EplObdSetNodeId(uiNodeId_p, NodeIdType_p); |
Daniel Krueger | 9d7164c | 2008-12-19 11:41:57 -0800 | [diff] [blame] | 391 | #else |
Greg Kroah-Hartman | 833dfbe | 2008-12-19 17:11:52 -0800 | [diff] [blame] | 392 | Ret = kEplSuccessful; |
Daniel Krueger | 9d7164c | 2008-12-19 11:41:57 -0800 | [diff] [blame] | 393 | #endif |
| 394 | |
Greg Kroah-Hartman | 833dfbe | 2008-12-19 17:11:52 -0800 | [diff] [blame] | 395 | return Ret; |
Daniel Krueger | 9d7164c | 2008-12-19 11:41:57 -0800 | [diff] [blame] | 396 | } |
| 397 | |
| 398 | //--------------------------------------------------------------------------- |
| 399 | // |
| 400 | // Function: EplObduCalGetAccessType() |
| 401 | // |
| 402 | // Description: Function encapsulate access of function EplObdGetAccessType |
| 403 | // |
| 404 | // Parameters: uiIndex_p = Index of the OD entry |
| 405 | // uiSubIndex_p = Subindex of the OD Entry |
| 406 | // pAccessTyp_p = pointer to buffer to store accesstype |
| 407 | // |
| 408 | // Return: tEplKernel = errorcode |
| 409 | // |
| 410 | // |
| 411 | // State: |
| 412 | // |
| 413 | //--------------------------------------------------------------------------- |
| 414 | EPLDLLEXPORT tEplKernel PUBLIC EplObduCalGetAccessType(unsigned int uiIndex_p, |
Greg Kroah-Hartman | 833dfbe | 2008-12-19 17:11:52 -0800 | [diff] [blame] | 415 | unsigned int |
| 416 | uiSubIndex_p, |
| 417 | tEplObdAccess * |
| 418 | pAccessTyp_p) |
Daniel Krueger | 9d7164c | 2008-12-19 11:41:57 -0800 | [diff] [blame] | 419 | { |
Greg Kroah-Hartman | 833dfbe | 2008-12-19 17:11:52 -0800 | [diff] [blame] | 420 | tEplObdAccess AccesType; |
Daniel Krueger | 9d7164c | 2008-12-19 11:41:57 -0800 | [diff] [blame] | 421 | |
| 422 | #if(((EPL_MODULE_INTEGRATION) & (EPL_MODULE_OBDK)) != 0) |
Greg Kroah-Hartman | 833dfbe | 2008-12-19 17:11:52 -0800 | [diff] [blame] | 423 | AccesType = EplObdGetAccessType(uiIndex_p, uiSubIndex_p, pAccessTyp_p); |
Daniel Krueger | 9d7164c | 2008-12-19 11:41:57 -0800 | [diff] [blame] | 424 | #else |
Greg Kroah-Hartman | 833dfbe | 2008-12-19 17:11:52 -0800 | [diff] [blame] | 425 | AccesType = 0; |
Daniel Krueger | 9d7164c | 2008-12-19 11:41:57 -0800 | [diff] [blame] | 426 | #endif |
| 427 | |
Greg Kroah-Hartman | 833dfbe | 2008-12-19 17:11:52 -0800 | [diff] [blame] | 428 | return AccesType; |
Daniel Krueger | 9d7164c | 2008-12-19 11:41:57 -0800 | [diff] [blame] | 429 | |
| 430 | } |
| 431 | |
| 432 | //--------------------------------------------------------------------------- |
| 433 | // |
| 434 | // Function: EplObduCalReadEntryToLe() |
| 435 | // |
| 436 | // Description: Function encapsulate access of function EplObdReadEntryToLe |
| 437 | // |
| 438 | // Parameters: uiIndex_p = Index of the OD entry to read |
| 439 | // uiSubIndex_p = Subindex to read |
| 440 | // pDstData_p = pointer to the buffer for data |
| 441 | // Offset_p = offset in data for read access |
| 442 | // pSize_p = IN: Size of the buffer |
| 443 | // OUT: number of readed Bytes |
| 444 | // |
| 445 | // Return: tEplKernel |
| 446 | // |
| 447 | // State: |
| 448 | // |
| 449 | //--------------------------------------------------------------------------- |
Greg Kroah-Hartman | 833dfbe | 2008-12-19 17:11:52 -0800 | [diff] [blame] | 450 | EPLDLLEXPORT tEplKernel PUBLIC EplObduCalReadEntryToLe(unsigned int uiIndex_p, |
| 451 | unsigned int |
| 452 | uiSubIndex_p, |
| 453 | void *pDstData_p, |
| 454 | tEplObdSize * pSize_p) |
Daniel Krueger | 9d7164c | 2008-12-19 11:41:57 -0800 | [diff] [blame] | 455 | { |
Greg Kroah-Hartman | 833dfbe | 2008-12-19 17:11:52 -0800 | [diff] [blame] | 456 | tEplKernel Ret; |
Daniel Krueger | 9d7164c | 2008-12-19 11:41:57 -0800 | [diff] [blame] | 457 | |
| 458 | #if(((EPL_MODULE_INTEGRATION) & (EPL_MODULE_OBDK)) != 0) |
Greg Kroah-Hartman | 833dfbe | 2008-12-19 17:11:52 -0800 | [diff] [blame] | 459 | Ret = EplObdReadEntryToLe(uiIndex_p, uiSubIndex_p, pDstData_p, pSize_p); |
Daniel Krueger | 9d7164c | 2008-12-19 11:41:57 -0800 | [diff] [blame] | 460 | #else |
Greg Kroah-Hartman | 833dfbe | 2008-12-19 17:11:52 -0800 | [diff] [blame] | 461 | Ret = kEplSuccessful; |
Daniel Krueger | 9d7164c | 2008-12-19 11:41:57 -0800 | [diff] [blame] | 462 | #endif |
| 463 | |
Greg Kroah-Hartman | 833dfbe | 2008-12-19 17:11:52 -0800 | [diff] [blame] | 464 | return Ret; |
Daniel Krueger | 9d7164c | 2008-12-19 11:41:57 -0800 | [diff] [blame] | 465 | } |
| 466 | |
| 467 | //--------------------------------------------------------------------------- |
| 468 | // |
| 469 | // Function: EplObduCalWriteEntryFromLe() |
| 470 | // |
| 471 | // Description: Function encapsulate access of function EplObdWriteEntryFromLe |
| 472 | // |
| 473 | // Parameters: uiIndex_p = Index of the OD entry |
| 474 | // uiSubIndex_p = Subindex of the OD Entry |
| 475 | // pSrcData_p = Pointer to the data to write |
| 476 | // Size_p = Size of the data in Byte |
| 477 | // |
| 478 | // Return: tEplKernel = Errorcode |
| 479 | // |
| 480 | // |
| 481 | // State: |
| 482 | // |
| 483 | //--------------------------------------------------------------------------- |
Greg Kroah-Hartman | 833dfbe | 2008-12-19 17:11:52 -0800 | [diff] [blame] | 484 | EPLDLLEXPORT tEplKernel PUBLIC EplObduCalWriteEntryFromLe(unsigned int |
| 485 | uiIndex_p, |
| 486 | unsigned int |
| 487 | uiSubIndex_p, |
| 488 | void *pSrcData_p, |
| 489 | tEplObdSize Size_p) |
Daniel Krueger | 9d7164c | 2008-12-19 11:41:57 -0800 | [diff] [blame] | 490 | { |
Greg Kroah-Hartman | 833dfbe | 2008-12-19 17:11:52 -0800 | [diff] [blame] | 491 | tEplKernel Ret; |
Daniel Krueger | 9d7164c | 2008-12-19 11:41:57 -0800 | [diff] [blame] | 492 | |
| 493 | #if(((EPL_MODULE_INTEGRATION) & (EPL_MODULE_OBDK)) != 0) |
Greg Kroah-Hartman | 833dfbe | 2008-12-19 17:11:52 -0800 | [diff] [blame] | 494 | Ret = |
| 495 | EplObdWriteEntryFromLe(uiIndex_p, uiSubIndex_p, pSrcData_p, Size_p); |
Daniel Krueger | 9d7164c | 2008-12-19 11:41:57 -0800 | [diff] [blame] | 496 | #else |
Greg Kroah-Hartman | 833dfbe | 2008-12-19 17:11:52 -0800 | [diff] [blame] | 497 | Ret = kEplSuccessful; |
Daniel Krueger | 9d7164c | 2008-12-19 11:41:57 -0800 | [diff] [blame] | 498 | #endif |
Greg Kroah-Hartman | 833dfbe | 2008-12-19 17:11:52 -0800 | [diff] [blame] | 499 | return Ret; |
Daniel Krueger | 9d7164c | 2008-12-19 11:41:57 -0800 | [diff] [blame] | 500 | } |
| 501 | |
| 502 | //--------------------------------------------------------------------------- |
| 503 | // |
| 504 | // Function: EplObduCalSearchVarEntry() |
| 505 | // |
| 506 | // Description: gets variable from OD |
| 507 | // |
| 508 | // Parameters: uiIndex_p = index of the var entry to search |
| 509 | // uiSubindex_p = subindex of var entry to search |
| 510 | // ppVarEntry_p = pointer to the pointer to the varentry |
| 511 | // |
| 512 | // Return: tEplKernel |
| 513 | // |
| 514 | // State: |
| 515 | // |
| 516 | //--------------------------------------------------------------------------- |
Greg Kroah-Hartman | 833dfbe | 2008-12-19 17:11:52 -0800 | [diff] [blame] | 517 | EPLDLLEXPORT tEplKernel PUBLIC |
| 518 | EplObduCalSearchVarEntry(EPL_MCO_DECL_INSTANCE_PTR_ unsigned int uiIndex_p, |
| 519 | unsigned int uiSubindex_p, |
| 520 | tEplObdVarEntry MEM ** ppVarEntry_p) |
Daniel Krueger | 9d7164c | 2008-12-19 11:41:57 -0800 | [diff] [blame] | 521 | { |
Greg Kroah-Hartman | 833dfbe | 2008-12-19 17:11:52 -0800 | [diff] [blame] | 522 | tEplKernel Ret; |
Daniel Krueger | 9d7164c | 2008-12-19 11:41:57 -0800 | [diff] [blame] | 523 | |
| 524 | #if(((EPL_MODULE_INTEGRATION) & (EPL_MODULE_OBDK)) != 0) |
Greg Kroah-Hartman | 833dfbe | 2008-12-19 17:11:52 -0800 | [diff] [blame] | 525 | Ret = EplObdSearchVarEntry(uiIndex_p, uiSubindex_p, ppVarEntry_p); |
Daniel Krueger | 9d7164c | 2008-12-19 11:41:57 -0800 | [diff] [blame] | 526 | #else |
Greg Kroah-Hartman | 833dfbe | 2008-12-19 17:11:52 -0800 | [diff] [blame] | 527 | Ret = kEplSuccessful; |
Daniel Krueger | 9d7164c | 2008-12-19 11:41:57 -0800 | [diff] [blame] | 528 | #endif |
Greg Kroah-Hartman | 833dfbe | 2008-12-19 17:11:52 -0800 | [diff] [blame] | 529 | return Ret; |
Daniel Krueger | 9d7164c | 2008-12-19 11:41:57 -0800 | [diff] [blame] | 530 | } |
| 531 | |
Daniel Krueger | 9d7164c | 2008-12-19 11:41:57 -0800 | [diff] [blame] | 532 | //=========================================================================// |
| 533 | // // |
| 534 | // P R I V A T E F U N C T I O N S // |
| 535 | // // |
| 536 | //=========================================================================// |
| 537 | |
| 538 | //--------------------------------------------------------------------------- |
| 539 | // |
| 540 | // Function: |
| 541 | // |
| 542 | // Description: |
| 543 | // |
| 544 | // |
| 545 | // |
| 546 | // Parameters: |
| 547 | // |
| 548 | // |
| 549 | // Returns: |
| 550 | // |
| 551 | // |
| 552 | // State: |
| 553 | // |
| 554 | //--------------------------------------------------------------------------- |
| 555 | |
| 556 | #endif //(((EPL_MODULE_INTEGRATION) & (EPL_MODULE_OBDU)) != 0) |
| 557 | |
Daniel Krueger | 9d7164c | 2008-12-19 11:41:57 -0800 | [diff] [blame] | 558 | // EOF |