#### CArclib::ArcGetReqEventPage

The ArcGetReqEventPage method returns number of event objects.

virtual ARC_STATUS ArcGetReqEventPage ( char bFlag, int *nCount );

#### Parameters:

[IN]

bFlag: Specifies how to retrieve the event object.

Value | Meaning
FLAG_ALL | Retrieve all of the event objects inside the RAID subsystem, and the nCount will be set to maximum count ( sSYSTEM_INFO.gsiEvents )
FLAG_NEW | Retrieve the newest event objects occurred between the last call and this call, and the nCount will be set to newest event object count, or set to 0 if no new event occurred.

[OUT]

nCount: Indicates how many event objects received.

#### Return Values

This method returns the ARC_STATUS.

#### Note:

#### Example:

ARC_STATUS Exe_Event_Info( CArclib &ctrl ) { ARC_STATUS stat = ARC_SUCCESS; char ptr1[64]; char tmpStr[64]; int nCount = 0; // total number of event objects we got int index; char timeBuf[64]; int nEventFlag = FLAG_ALL; sSYSTEM_INFO sysInfo; //the time event occurred, defined in arclib.h pSYS_TIME evtTime = (pSYS_TIME)new sSYS_TIME; // event object defined in arclib.h pEVENT_DATA pEventObject = (pEVENT_DATA)new sEVENT_DATA; *((LONG *)evtTime) = 0L; memset(pEventObject, 0, sizeof(sEVENT_DATA)); stat = ctrl.ArcGetSysInfo(&sysInfo); if (stat != ARC_SUCCESS) { goto quit; } /* Call ArcSetTime() to correct the raid-subsystem time */ stat = ctrl.ArcSetTime(); if (stat != ARC_SUCCESS) { goto quit; } /* Call ArcGetReqEventPage() to get the required event objects from raid subsystem. */ stat = ctrl.ArcGetReqEventPage(nEventFlag, &nCount); if (stat == ARC_SUCCESS) { if (nCount != 0) { printf("Date-Time Device Event Type \n"); printf("==========================================================="); for ( index = 0; index <= nCount-1; index++) { /* Call ArcGetEventObject function to get the individual event object */ if (ctrl.ArcGetEventObject( index, pEventObject )) { memset(timeBuf, 0, sizeof(timeBuf)); // If tmFlag == 1 ==> use YY/MM/DD/HH/MM/SS else use time tick *((LONG *)evtTime) = pEventObject->evtTime; if (*((LONG *)evtTime) & 0x80000000) { sprintf(timeBuf, "%d-%d-%d %d:%d:%d", evtTime->u.tmYear + 2000, evtTime->u.tmMonth, evtTime->u.tmDate, evtTime->u.tmHour, evtTime->u.tmMinute, evtTime->u.tmSecond); } else { sprintf(timeBuf, "%d", evtTime->x.tmTick ); } memset( ptr1, 0, sizeof(ptr1)); memset( tmpStr, 0, sizeof(tmpStr)); /* Parse the event object we got */ switch ((int)pEventObject->evtCategory) { /* The member "evtStr" of event object structure contains the string to indicate which raidset owns this event object */ case EVENT_RAIDSET: // raidset event strcpy( ptr1, htmRaidEvent[pEventObject->evtType]); memcpy(tmpStr, pEventObject->evtStr, 16); printf("%-24s", timeBuf); printf("%-20s%s\n", tmpStr, ptr1); break; /* The member "evtStr" of event object structure contains the string to indicate which volumeset owns this event object */ case EVENT_VOLUMESET: // volumeset event strcpy( ptr1, htmVolEvent[pEventObject->evtType]); memcpy(tmpStr, pEventObject->evtStr, 16); printf("%-24s", timeBuf); printf("%-20s%s\n", tmpStr, ptr1); break; case EVENT_DEVICE: // device event if(sysInfo.gsiTargetType == TARGET_SAS) { memcpy(tmpStr, pEventObject->evtStr, 16); } else { sprintf(tmpStr, "IDE Channel #%2d", pEventObject->evtChannel + 1); } printf("%-24s", timeBuf); printf("%-20s%s\n", tmpStr, htmDevEvent[pEventObject->evtType]); break; case EVENT_HOST: // host event /* this is Host SCSI events */ printf("%-24s", timeBuf); if ( sysInfo.gsiScsiHostChannels) { printf("%-20s%s\n", eventCat[pEventObject->evtCategory], htmScsiHostEvent[pEventObject->evtType]); } else { printf("%-20s%s\n", eventCat[pEventObject->evtCategory], htmIdeHostEvent[pEventObject->evtType]); } break; case EVENT_HW_MONITOR: // hardware monitor event printf("%-24s", timeBuf); printf("%-20s%s\n", eventCat[pEventObject->evtCategory], htmHwMonEvent[pEventObject->evtType]); break; case EVENT_NEW_83782D: memcpy(tmpStr, pEventObject->evtStr, 16); printf("%-24s", timeBuf); printf("%-20s%s\n", tmpStr, htmNewEventStr[pEventObject->evtType]); break; case EVENT_NO_EVENT: // printf(" No Event\n"); default: break; }// end switch }// end if }// end for printf("==========================================================="); }//end if }// end if quit: if (pEventObject) delete pEventObject; if (evtTime) delete evtTime; return stat; }