//---------------------------------------------------------------------------- // // Copyright (C) 2008 Intel Corporation // // File: EventLogReaderFlow.cpp // // Contents: Api code for Intel(R) Active Management Technology // (Intel� AMT) EventLogReader Sample. // // Notes: This file contains the EventLogReaderFlow class implementation. // //---------------------------------------------------------------------------- #include "EventLogReaderFlow.h" #include "CimClass.h" #include "AMT_MessageLog.h" #include "CommonDefinitions.h" #include "CmdLineArguments.h" #include #include using namespace Intel::Manageability::Cim::Typed; #pragma region STRUCTS typedef struct _EventLogRecord { unsigned int TimeStamp; unsigned char DeviceAddress; unsigned char EventSensorType; unsigned char EventType; unsigned char EventOffset; unsigned char EventSourceType; unsigned char EventSeverity; unsigned char SensorNumber; unsigned char Entity; unsigned char EntityInstance; unsigned char EventData[8]; }EventLogRecord; #pragma endregion #pragma region MEMBERS CmdLineArguments::Format format; #pragma endregion #pragma region METHODS /* * Description: Print a Log Record in the required format * Arguments: * b64Record - A base64 format of the record * record_index - The record index */ void PrintRecord(string b64Record, int record_index) { format.SetConsoleTextColor(HCYAN); cout << "\tRecord Number: " <DeviceAddress<Entity<EventSensorType<EventSourceType<EventSeverity<SensorNumber<EventType<EventData[j]; } cout<= 1400)) /*Starting with Visual C++ compiler version 14 (which is VS2005), the default for gmtime is the 64-bit version, which we don't want.*/ #pragma warning(disable:4996) struct tm *time = _gmtime32((__time32_t*)(&((e)->TimeStamp))); #pragma warning(default:4996) #else struct tm *time = gmtime((time_t*)(&((e)->TimeStamp))); #endif #pragma warning(disable:4996) cout<<"TimeStamp (UTC) "<<(time ? asctime(time) : "Unknown")<