//------------------------------------------------------------------------------ static tOplkError processErrorWarningEvent(tOplkApiEventType EventType_p, tOplkApiEventArg* pEventArg_p, void* pUserArg_p) { // error or warning occurred within the stack or the application // on error the API layer stops the NMT state machine tEventError* pInternalError = &pEventArg_p->internalError; UNUSED_PARAMETER(EventType_p); UNUSED_PARAMETER(pUserArg_p); PRINTF("Err/Warn: Source = %s (%02X) OplkError = %s (0x%03X)\n", debugstr_getEventSourceStr(pInternalError->eventSource), pInternalError->eventSource, debugstr_getRetValStr(pInternalError->oplkError), pInternalError->oplkError); PRINTF("Err/Warn: Source = %s (%02X) OplkError = %s (0x%03X)\n", debugstr_getEventSourceStr(pInternalError->eventSource), pInternalError->eventSource, debugstr_getRetValStr(pInternalError->oplkError), pInternalError->oplkError); // check additional argument switch (pInternalError->eventSource) { case kEventSourceEventk: case kEventSourceEventu: // error occurred within event processing // either in kernel or in user part PRINTF(" OrgSource = %s %02X\n", debugstr_getEventSourceStr(pInternalError->errorArg.eventSource), pInternalError->errorArg.eventSource); PRINTF(" OrgSource = %s %02X\n", debugstr_getEventSourceStr(pInternalError->errorArg.eventSource), pInternalError->errorArg.eventSource); break; case kEventSourceDllk: // error occurred within the data link layer (e.g. interrupt processing) // the DWORD argument contains the DLL state and the NMT event PRINTF(" val = %X\n", pInternalError->errorArg.uintArg); PRINTF(" val = %X\n", pInternalError->errorArg.uintArg); break; default: PRINTF("\n"); break; } return kErrorOk; }
//------------------------------------------------------------------------------ tOplkError ProcessThread::processErrorWarningEvent(tOplkApiEventType eventType_p, tOplkApiEventArg* pEventArg_p, void* pUserArg_p) { tEventError* pInternalError = &pEventArg_p->internalError; UNUSED_PARAMETER(eventType_p); UNUSED_PARAMETER(pUserArg_p); sigPrintLog(QString("Err/Warn: Source = %1 (0x%2) OplkError = %3 (0x%4)") .arg(debugstr_getEventSourceStr(pInternalError->eventSource)) .arg(pInternalError->eventSource, 2, 16, QLatin1Char('0')) .arg(debugstr_getRetValStr(pInternalError->oplkError)) .arg(pInternalError->oplkError, 3, 16, QLatin1Char('0'))); switch (pInternalError->eventSource) { case kEventSourceEventk: case kEventSourceEventu: // error occurred within event processing // either in kernel or in user part sigPrintLog(QString(" OrgSource = %1 %2") .arg(debugstr_getEventSourceStr(pInternalError->errorArg.eventSource)) .arg(pInternalError->errorArg.eventSource, 2, 16, QLatin1Char('0'))); break; case kEventSourceObdu: case kEventSourceDllk: // error occurred within the data link layer (e.g. interrupt processing) // the DWORD argument contains the DLL state and the NMT event sigPrintLog(QString(" val = %1").arg(pInternalError->errorArg.uintArg, 0, 16)); break; default: //sigPrintLog(QString("\n")); break; } return kErrorOk; }