1 /****************************************************************************
3 (c) SYSTEC electronic GmbH, D-07973 Greiz, August-Bebel-Str. 29
4 www.systec-electronic.com
8 Description: source file for error handler module
12 Redistribution and use in source and binary forms, with or without
13 modification, are permitted provided that the following conditions
16 1. Redistributions of source code must retain the above copyright
17 notice, this list of conditions and the following disclaimer.
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.
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.
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.
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.
50 -------------------------------------------------------------------------
52 $RCSfile: EplErrorHandlerk.c,v $
56 $Revision: 1.9 $ $Date: 2008/10/17 15:32:32 $
63 -------------------------------------------------------------------------
67 2006/10/02 d.k.: start of the implementation
69 ****************************************************************************/
71 #include "kernel/EplErrorHandlerk.h"
73 #include "kernel/EplEventk.h"
74 #include "kernel/EplObdk.h" // function prototyps of the EplOBD-Modul
75 #include "kernel/EplDllk.h"
77 #if(((EPL_MODULE_INTEGRATION) & (EPL_MODULE_DLLK)) != 0)
79 #if(((EPL_MODULE_INTEGRATION) & (EPL_MODULE_OBDK)) == 0)
80 #error "EPL ErrorHandler module needs EPL module OBDK!"
83 /***************************************************************************/
86 /* G L O B A L D E F I N I T I O N S */
89 /***************************************************************************/
91 //---------------------------------------------------------------------------
93 //---------------------------------------------------------------------------
95 //---------------------------------------------------------------------------
97 //---------------------------------------------------------------------------
100 u32 m_dwCumulativeCnt; // subindex 1
101 u32 m_dwThresholdCnt; // subindex 2
102 u32 m_dwThreshold; // subindex 3
104 } tEplErrorHandlerkErrorCounter;
107 tEplErrorHandlerkErrorCounter m_CnLossSoc; // object 0x1C0B
108 tEplErrorHandlerkErrorCounter m_CnLossPreq; // object 0x1C0D
109 tEplErrorHandlerkErrorCounter m_CnCrcErr; // object 0x1C0F
110 unsigned long m_ulDllErrorEvents;
112 #if (((EPL_MODULE_INTEGRATION) & (EPL_MODULE_NMT_MN)) != 0)
113 tEplErrorHandlerkErrorCounter m_MnCrcErr; // object 0x1C00
114 tEplErrorHandlerkErrorCounter m_MnCycTimeExceed; // object 0x1C02
115 u32 m_adwMnCnLossPresCumCnt[254]; // object 0x1C07
116 u32 m_adwMnCnLossPresThrCnt[254]; // object 0x1C08
117 u32 m_adwMnCnLossPresThreshold[254]; // object 0x1C09
118 BOOL m_afMnCnLossPresEvent[254];
121 } tEplErrorHandlerkInstance;
123 //---------------------------------------------------------------------------
124 // modul globale vars
125 //---------------------------------------------------------------------------
127 static tEplErrorHandlerkInstance EplErrorHandlerkInstance_g;
129 //---------------------------------------------------------------------------
130 // local function prototypes
131 //---------------------------------------------------------------------------
133 static tEplKernel EplErrorHandlerkLinkErrorCounter(tEplErrorHandlerkErrorCounter
135 unsigned int uiIndex_p);
137 #if (((EPL_MODULE_INTEGRATION) & (EPL_MODULE_NMT_MN)) != 0)
138 static tEplKernel EplErrorHandlerkLinkArray(u32 * pdwValue_p,
139 unsigned int uiValueCount_p,
140 unsigned int uiIndex_p);
143 /***************************************************************************/
146 /* C L A S S <Epl-Kernelspace-Error-Handler> */
149 /***************************************************************************/
154 /***************************************************************************/
156 //=========================================================================//
158 // P U B L I C F U N C T I O N S //
160 //=========================================================================//
162 //---------------------------------------------------------------------------
164 // Function: EplErrorHandlerkInit
166 // Description: function initialize the first instance
173 // Returns: tEpKernel = errorcode
178 //---------------------------------------------------------------------------
179 tEplKernel EplErrorHandlerkInit(void)
183 Ret = EplErrorHandlerkAddInstance();
189 //---------------------------------------------------------------------------
191 // Function: EplErrorHandlerkAddInstance
193 // Description: function add one more instance
200 // Returns: tEpKernel = errorcode
205 //---------------------------------------------------------------------------
206 tEplKernel EplErrorHandlerkAddInstance(void)
210 Ret = kEplSuccessful;
212 // reset only event variable,
213 // all other instance members are reset by OD or may keep their current value
214 // d.k.: this is necessary for the cumulative counters, which shall not be reset
215 EplErrorHandlerkInstance_g.m_ulDllErrorEvents = 0;
217 // link counters to OD
218 // $$$ d.k. if OD resides in userspace, fetch pointer to shared memory,
219 // which shall have the same structure as the instance (needs to be declared globally).
220 // Other idea: error counter shall belong to the process image
221 // (reset of counters by SDO write are a little bit tricky).
224 EplErrorHandlerkLinkErrorCounter(&EplErrorHandlerkInstance_g.
225 m_CnLossSoc, 0x1C0B);
226 if (Ret != kEplSuccessful) {
231 EplErrorHandlerkLinkErrorCounter(&EplErrorHandlerkInstance_g.
232 m_CnLossPreq, 0x1C0D);
233 // ignore return code, because object 0x1C0D is conditional
236 EplErrorHandlerkLinkErrorCounter(&EplErrorHandlerkInstance_g.
238 if (Ret != kEplSuccessful) {
241 #if (((EPL_MODULE_INTEGRATION) & (EPL_MODULE_NMT_MN)) != 0)
243 EplErrorHandlerkLinkErrorCounter(&EplErrorHandlerkInstance_g.
245 if (Ret != kEplSuccessful) {
250 EplErrorHandlerkLinkErrorCounter(&EplErrorHandlerkInstance_g.
251 m_MnCycTimeExceed, 0x1C02);
252 if (Ret != kEplSuccessful) {
257 EplErrorHandlerkLinkArray(EplErrorHandlerkInstance_g.
258 m_adwMnCnLossPresCumCnt,
259 tabentries(EplErrorHandlerkInstance_g.
260 m_adwMnCnLossPresCumCnt),
262 if (Ret != kEplSuccessful) {
267 EplErrorHandlerkLinkArray(EplErrorHandlerkInstance_g.
268 m_adwMnCnLossPresThrCnt,
269 tabentries(EplErrorHandlerkInstance_g.
270 m_adwMnCnLossPresThrCnt),
272 if (Ret != kEplSuccessful) {
277 EplErrorHandlerkLinkArray(EplErrorHandlerkInstance_g.
278 m_adwMnCnLossPresThreshold,
279 tabentries(EplErrorHandlerkInstance_g.
280 m_adwMnCnLossPresThreshold),
282 if (Ret != kEplSuccessful) {
292 //---------------------------------------------------------------------------
294 // Function: EplErrorHandlerkDelInstance
296 // Description: function delete instance an free the bufferstructure
303 // Returns: tEpKernel = errorcode
308 //---------------------------------------------------------------------------
309 tEplKernel EplErrorHandlerkDelInstance(void)
313 Ret = kEplSuccessful;
319 //---------------------------------------------------------------------------
321 // Function: EplErrorHandlerkProcess
323 // Description: processes error events from DLL
327 // Parameters: pEvent_p = pointer to event-structur from buffer
330 // Returns: tEpKernel = errorcode
335 //---------------------------------------------------------------------------
336 tEplKernel EplErrorHandlerkProcess(tEplEvent *pEvent_p)
339 unsigned long ulDllErrorEvents;
341 tEplNmtEvent NmtEvent;
343 Ret = kEplSuccessful;
346 switch (pEvent_p->m_EventType) {
347 case kEplEventTypeDllError:
349 tEplErrorHandlerkEvent *pErrHandlerEvent =
350 (tEplErrorHandlerkEvent *) pEvent_p->m_pArg;
352 ulDllErrorEvents = pErrHandlerEvent->m_ulDllErrorEvents;
354 // check the several error events
355 if ((EplErrorHandlerkInstance_g.m_CnLossSoc.
357 && ((ulDllErrorEvents & EPL_DLL_ERR_CN_LOSS_SOC) != 0)) { // loss of SoC event occured
358 // increment cumulative counter by 1
359 EplErrorHandlerkInstance_g.m_CnLossSoc.
361 // increment threshold counter by 8
362 EplErrorHandlerkInstance_g.m_CnLossSoc.
363 m_dwThresholdCnt += 8;
364 if (EplErrorHandlerkInstance_g.m_CnLossSoc.m_dwThresholdCnt >= EplErrorHandlerkInstance_g.m_CnLossSoc.m_dwThreshold) { // threshold is reached
365 // $$$ d.k.: generate error history entry E_DLL_LOSS_SOC_TH
367 // post event to NMT state machine
368 NmtEvent = kEplNmtEventNmtCycleError;
369 Event.m_EventSink = kEplEventSinkNmtk;
371 kEplEventTypeNmtEvent;
372 Event.m_pArg = &NmtEvent;
373 Event.m_uiSize = sizeof(NmtEvent);
374 Ret = EplEventkPost(&Event);
376 EplErrorHandlerkInstance_g.m_ulDllErrorEvents |=
377 EPL_DLL_ERR_CN_LOSS_SOC;
380 if ((EplErrorHandlerkInstance_g.m_CnLossPreq.
382 && ((ulDllErrorEvents & EPL_DLL_ERR_CN_LOSS_PREQ) != 0)) { // loss of PReq event occured
383 // increment cumulative counter by 1
384 EplErrorHandlerkInstance_g.m_CnLossPreq.
386 // increment threshold counter by 8
387 EplErrorHandlerkInstance_g.m_CnLossPreq.
388 m_dwThresholdCnt += 8;
389 if (EplErrorHandlerkInstance_g.m_CnLossPreq.m_dwThresholdCnt >= EplErrorHandlerkInstance_g.m_CnLossPreq.m_dwThreshold) { // threshold is reached
390 // $$$ d.k.: generate error history entry E_DLL_LOSS_PREQ_TH
392 // post event to NMT state machine
393 NmtEvent = kEplNmtEventNmtCycleError;
394 Event.m_EventSink = kEplEventSinkNmtk;
396 kEplEventTypeNmtEvent;
397 Event.m_pArg = &NmtEvent;
398 Event.m_uiSize = sizeof(NmtEvent);
399 Ret = EplEventkPost(&Event);
403 if ((EplErrorHandlerkInstance_g.m_CnLossPreq.
404 m_dwThresholdCnt > 0)
405 && ((ulDllErrorEvents & EPL_DLL_ERR_CN_RECVD_PREQ) != 0)) { // PReq correctly received
406 // decrement threshold counter by 1
407 EplErrorHandlerkInstance_g.m_CnLossPreq.
411 if ((EplErrorHandlerkInstance_g.m_CnCrcErr.
413 && ((ulDllErrorEvents & EPL_DLL_ERR_CN_CRC) != 0)) { // CRC error event occured
414 // increment cumulative counter by 1
415 EplErrorHandlerkInstance_g.m_CnCrcErr.
417 // increment threshold counter by 8
418 EplErrorHandlerkInstance_g.m_CnCrcErr.
419 m_dwThresholdCnt += 8;
420 if (EplErrorHandlerkInstance_g.m_CnCrcErr.m_dwThresholdCnt >= EplErrorHandlerkInstance_g.m_CnCrcErr.m_dwThreshold) { // threshold is reached
421 // $$$ d.k.: generate error history entry E_DLL_CRC_TH
423 // post event to NMT state machine
424 NmtEvent = kEplNmtEventNmtCycleError;
425 Event.m_EventSink = kEplEventSinkNmtk;
427 kEplEventTypeNmtEvent;
428 Event.m_pArg = &NmtEvent;
429 Event.m_uiSize = sizeof(NmtEvent);
430 Ret = EplEventkPost(&Event);
432 EplErrorHandlerkInstance_g.m_ulDllErrorEvents |=
436 if ((ulDllErrorEvents & EPL_DLL_ERR_INVALID_FORMAT) != 0) { // invalid format error occured (only direct reaction)
437 // $$$ d.k.: generate error history entry E_DLL_INVALID_FORMAT
438 #if (((EPL_MODULE_INTEGRATION) & (EPL_MODULE_NMT_MN)) != 0)
439 if (pErrHandlerEvent->m_NmtState >= kEplNmtMsNotActive) { // MN is active
440 if (pErrHandlerEvent->m_uiNodeId != 0) {
444 // remove node from isochronous phase
450 // inform NmtMnu module about state change, which shall send NMT command ResetNode to this CN
451 HeartbeatEvent.m_uiNodeId =
454 HeartbeatEvent.m_NmtState =
456 HeartbeatEvent.m_wErrorCode =
457 EPL_E_DLL_INVALID_FORMAT;
461 kEplEventTypeHeartbeat;
463 sizeof(HeartbeatEvent);
464 Event.m_pArg = &HeartbeatEvent;
465 Ret = EplEventkPost(&Event);
467 // $$$ and else should lead to InternComError
471 // post event to NMT state machine
472 NmtEvent = kEplNmtEventInternComError;
473 Event.m_EventSink = kEplEventSinkNmtk;
475 kEplEventTypeNmtEvent;
476 Event.m_pArg = &NmtEvent;
477 Event.m_uiSize = sizeof(NmtEvent);
478 Ret = EplEventkPost(&Event);
481 #if (((EPL_MODULE_INTEGRATION) & (EPL_MODULE_NMT_MN)) != 0)
482 if ((EplErrorHandlerkInstance_g.m_MnCrcErr.
484 && ((ulDllErrorEvents & EPL_DLL_ERR_MN_CRC) != 0)) { // CRC error event occured
485 // increment cumulative counter by 1
486 EplErrorHandlerkInstance_g.m_MnCrcErr.
488 // increment threshold counter by 8
489 EplErrorHandlerkInstance_g.m_MnCrcErr.
490 m_dwThresholdCnt += 8;
491 if (EplErrorHandlerkInstance_g.m_MnCrcErr.m_dwThresholdCnt >= EplErrorHandlerkInstance_g.m_MnCrcErr.m_dwThreshold) { // threshold is reached
492 // $$$ d.k.: generate error history entry E_DLL_CRC_TH
494 // post event to NMT state machine
495 NmtEvent = kEplNmtEventNmtCycleError;
496 Event.m_EventSink = kEplEventSinkNmtk;
498 kEplEventTypeNmtEvent;
499 Event.m_pArg = &NmtEvent;
500 Event.m_uiSize = sizeof(NmtEvent);
501 Ret = EplEventkPost(&Event);
503 EplErrorHandlerkInstance_g.m_ulDllErrorEvents |=
507 if ((EplErrorHandlerkInstance_g.m_MnCycTimeExceed.
509 && ((ulDllErrorEvents & EPL_DLL_ERR_MN_CYCTIMEEXCEED) != 0)) { // cycle time exceeded event occured
510 // increment cumulative counter by 1
511 EplErrorHandlerkInstance_g.m_MnCycTimeExceed.
513 // increment threshold counter by 8
514 EplErrorHandlerkInstance_g.m_MnCycTimeExceed.
515 m_dwThresholdCnt += 8;
516 if (EplErrorHandlerkInstance_g.m_MnCycTimeExceed.m_dwThresholdCnt >= EplErrorHandlerkInstance_g.m_MnCycTimeExceed.m_dwThreshold) { // threshold is reached
517 // $$$ d.k.: generate error history entry E_DLL_CYCLE_EXCEED_TH
519 // post event to NMT state machine
520 NmtEvent = kEplNmtEventNmtCycleError;
521 Event.m_EventSink = kEplEventSinkNmtk;
523 kEplEventTypeNmtEvent;
524 Event.m_pArg = &NmtEvent;
525 Event.m_uiSize = sizeof(NmtEvent);
526 Ret = EplEventkPost(&Event);
528 // $$$ d.k.: else generate error history entry E_DLL_CYCLE_EXCEED
529 EplErrorHandlerkInstance_g.m_ulDllErrorEvents |=
530 EPL_DLL_ERR_MN_CYCTIMEEXCEED;
533 if ((ulDllErrorEvents & EPL_DLL_ERR_MN_CN_LOSS_PRES) != 0) { // CN loss PRes event occured
534 unsigned int uiNodeId;
536 uiNodeId = pErrHandlerEvent->m_uiNodeId - 1;
538 tabentries(EplErrorHandlerkInstance_g.
539 m_adwMnCnLossPresCumCnt))
540 && (EplErrorHandlerkInstance_g.
541 m_adwMnCnLossPresThreshold[uiNodeId] >
543 // increment cumulative counter by 1
544 EplErrorHandlerkInstance_g.
545 m_adwMnCnLossPresCumCnt[uiNodeId]++;
546 // increment threshold counter by 8
547 EplErrorHandlerkInstance_g.
548 m_adwMnCnLossPresThrCnt[uiNodeId] +=
550 if (EplErrorHandlerkInstance_g.
551 m_adwMnCnLossPresThrCnt[uiNodeId]
552 >= EplErrorHandlerkInstance_g.m_adwMnCnLossPresThreshold[uiNodeId]) { // threshold is reached
556 // $$$ d.k.: generate error history entry E_DLL_LOSS_PRES_TH
558 // remove node from isochronous phase
564 // inform NmtMnu module about state change, which shall send NMT command ResetNode to this CN
565 HeartbeatEvent.m_uiNodeId =
568 HeartbeatEvent.m_NmtState =
570 HeartbeatEvent.m_wErrorCode =
571 EPL_E_DLL_LOSS_PRES_TH;
575 kEplEventTypeHeartbeat;
577 sizeof(HeartbeatEvent);
578 Event.m_pArg = &HeartbeatEvent;
579 Ret = EplEventkPost(&Event);
581 EplErrorHandlerkInstance_g.
582 m_afMnCnLossPresEvent[uiNodeId] =
592 case kEplEventTypeNmtEvent:
594 if ((*(tEplNmtEvent *) pEvent_p->m_pArg) == kEplNmtEventDllCeSoa) { // SoA event of CN -> decrement threshold counters
596 if ((EplErrorHandlerkInstance_g.m_ulDllErrorEvents & EPL_DLL_ERR_CN_LOSS_SOC) == 0) { // decrement loss of SoC threshold counter, because it didn't occur last cycle
597 if (EplErrorHandlerkInstance_g.
598 m_CnLossSoc.m_dwThresholdCnt > 0) {
599 EplErrorHandlerkInstance_g.
605 if ((EplErrorHandlerkInstance_g.m_ulDllErrorEvents & EPL_DLL_ERR_CN_CRC) == 0) { // decrement CRC threshold counter, because it didn't occur last cycle
606 if (EplErrorHandlerkInstance_g.
607 m_CnCrcErr.m_dwThresholdCnt > 0) {
608 EplErrorHandlerkInstance_g.
614 #if (((EPL_MODULE_INTEGRATION) & (EPL_MODULE_NMT_MN)) != 0)
615 else if ((*(tEplNmtEvent *) pEvent_p->m_pArg) == kEplNmtEventDllMeSoaSent) { // SoA event of MN -> decrement threshold counters
616 tEplDllkNodeInfo *pIntNodeInfo;
617 unsigned int uiNodeId;
619 Ret = EplDllkGetFirstNodeInfo(&pIntNodeInfo);
620 if (Ret != kEplSuccessful) {
623 // iterate through node info structure list
624 while (pIntNodeInfo != NULL) {
625 uiNodeId = pIntNodeInfo->m_uiNodeId - 1;
628 (EplErrorHandlerkInstance_g.
629 m_adwMnCnLossPresCumCnt)) {
630 if (EplErrorHandlerkInstance_g.
631 m_afMnCnLossPresEvent
632 [uiNodeId] == FALSE) {
633 if (EplErrorHandlerkInstance_g.m_adwMnCnLossPresThrCnt[uiNodeId] > 0) {
634 EplErrorHandlerkInstance_g.
635 m_adwMnCnLossPresThrCnt
639 EplErrorHandlerkInstance_g.
640 m_afMnCnLossPresEvent
645 pIntNodeInfo->m_pNextNodeInfo;
648 if ((EplErrorHandlerkInstance_g.m_ulDllErrorEvents & EPL_DLL_ERR_MN_CRC) == 0) { // decrement CRC threshold counter, because it didn't occur last cycle
649 if (EplErrorHandlerkInstance_g.
650 m_MnCrcErr.m_dwThresholdCnt > 0) {
651 EplErrorHandlerkInstance_g.
657 if ((EplErrorHandlerkInstance_g.m_ulDllErrorEvents & EPL_DLL_ERR_MN_CYCTIMEEXCEED) == 0) { // decrement cycle exceed threshold counter, because it didn't occur last cycle
658 if (EplErrorHandlerkInstance_g.
659 m_MnCycTimeExceed.m_dwThresholdCnt >
661 EplErrorHandlerkInstance_g.
669 // reset error events
670 EplErrorHandlerkInstance_g.m_ulDllErrorEvents = 0L;
680 } // end of switch(pEvent_p->m_EventType)
686 //=========================================================================//
688 // P R I V A T E F U N C T I O N S //
690 //=========================================================================//
692 //---------------------------------------------------------------------------
694 // Function: EplErrorHandlerkLinkErrorCounter
696 // Description: link specified error counter structure to OD entry
698 // Parameters: pErrorCounter_p = pointer to error counter structure
699 // uiIndex_p = OD index
701 // Returns: tEplKernel = error code
706 //---------------------------------------------------------------------------
708 static tEplKernel EplErrorHandlerkLinkErrorCounter(tEplErrorHandlerkErrorCounter
710 unsigned int uiIndex_p)
712 tEplKernel Ret = kEplSuccessful;
713 tEplVarParam VarParam;
715 VarParam.m_pData = &pErrorCounter_p->m_dwCumulativeCnt;
716 VarParam.m_Size = sizeof(u32);
717 VarParam.m_uiIndex = uiIndex_p;
718 VarParam.m_uiSubindex = 0x01;
719 VarParam.m_ValidFlag = kVarValidAll;
720 Ret = EplObdDefineVar(&VarParam);
721 if (Ret != kEplSuccessful) {
725 VarParam.m_pData = &pErrorCounter_p->m_dwThresholdCnt;
726 VarParam.m_Size = sizeof(u32);
727 VarParam.m_uiIndex = uiIndex_p;
728 VarParam.m_uiSubindex = 0x02;
729 VarParam.m_ValidFlag = kVarValidAll;
730 Ret = EplObdDefineVar(&VarParam);
731 if (Ret != kEplSuccessful) {
735 VarParam.m_pData = &pErrorCounter_p->m_dwThreshold;
736 VarParam.m_Size = sizeof(u32);
737 VarParam.m_uiIndex = uiIndex_p;
738 VarParam.m_uiSubindex = 0x03;
739 VarParam.m_ValidFlag = kVarValidAll;
740 Ret = EplObdDefineVar(&VarParam);
741 if (Ret != kEplSuccessful) {
749 //---------------------------------------------------------------------------
751 // Function: EplErrorHandlerkLinkErrorCounter
753 // Description: link specified error counter structure to OD entry
755 // Parameters: pErrorCounter_p = pointer to error counter structure
756 // uiIndex_p = OD index
758 // Returns: tEplKernel = error code
763 //---------------------------------------------------------------------------
765 #if (((EPL_MODULE_INTEGRATION) & (EPL_MODULE_NMT_MN)) != 0)
766 static tEplKernel EplErrorHandlerkLinkArray(u32 * pdwValue_p,
767 unsigned int uiValueCount_p,
768 unsigned int uiIndex_p)
770 tEplKernel Ret = kEplSuccessful;
771 tEplVarParam VarParam;
772 tEplObdSize EntrySize;
775 EntrySize = (tEplObdSize) sizeof(bIndexEntries);
776 Ret = EplObdReadEntry(uiIndex_p,
777 0x00, (void *)&bIndexEntries, &EntrySize);
779 if ((Ret != kEplSuccessful) || (bIndexEntries == 0x00)) {
780 // Object doesn't exist or invalid entry number
781 Ret = kEplObdIndexNotExist;
785 if (bIndexEntries < uiValueCount_p) {
786 uiValueCount_p = bIndexEntries;
789 VarParam.m_Size = sizeof(u32);
790 VarParam.m_uiIndex = uiIndex_p;
791 VarParam.m_ValidFlag = kVarValidAll;
793 for (VarParam.m_uiSubindex = 0x01;
794 VarParam.m_uiSubindex <= uiValueCount_p; VarParam.m_uiSubindex++) {
795 VarParam.m_pData = pdwValue_p;
796 Ret = EplObdDefineVar(&VarParam);
797 if (Ret != kEplSuccessful) {
806 #endif //(((EPL_MODULE_INTEGRATION) & (EPL_MODULE_NMT_MN)) != 0)
808 #endif //(((EPL_MODULE_INTEGRATION) & (EPL_MODULE_DLLK)) != 0)