/// <summary> /// Formats Time Stamped OEM SEL Records /// </summary> /// <param name="EventMessageData">Event Message Data</param> /// <param name="RecordCount">SEL Record Type</param> internal static void TimeStampedOEMSelFormat(ref SystemEventLogMessage message, byte[] messageData) { // convert byte[] to int using Shift operation int TotalSeconds = messageData[0] + (messageData[1] << 8) + (messageData[2] << 16) + (messageData[3] << 24); // calculate Recorded date message.EventDate = IpmiSharedFunc.SecondsOffSet(TotalSeconds); message.EventVersion = MsgVersion.OEM; // SensorType, RawSensorType and EventTypeCode are not used for OEM SEL entries message.SensorType = SensorType.Reserved; message.RawSensorType = (byte)SensorType.Reserved; message.EventTypeCode = 0xFF; message.SensorNumber = 0; message.EventDir = EventDir.Assertion; if (messageData.Length >= 13) { // Allocate larger array to store OEM Timestamped payload message.RawPayload = new byte[9]; // Copy Manufacturer ID and OEM Defined payload to the response raw payload array. Format shown in IPMI 2.0 Spec Table 32-2. Buffer.BlockCopy(messageData, 4, message.RawPayload, 0, 9); // Add the raw payload as hex string to the user return class. message.EventPayload = IpmiSharedFunc.ByteArrayToHexString(message.RawPayload); } }
/// <summary> /// Formats System Event (Standard Range) SEL Records /// </summary> /// <param name="EventMessageData">Event Message Data</param> /// <param name="RecordCount">SEL Record Type</param> internal static void StandardSelFormat(ref SystemEventLogMessage message, byte[] messageData) { // convert data bytes from messageData byte[] to int using Shift operation int totalSeconds = TimeStampFromBytes(messageData); // calculate Recorded date message.EventDate = IpmiSharedFunc.SecondsOffSet(totalSeconds); // SEL Event Message if (Enum.IsDefined(typeof(MsgVersion), messageData[6])) { message.EventVersion = (MsgVersion)messageData[6]; } else { message.EventVersion = MsgVersion.Unknown; } // Sensor Type byte sensorType = messageData[7]; // add sensor type to attribute class if (Enum.IsDefined(typeof(SensorType), sensorType)) { message.SensorType = (SensorType)sensorType; } else { message.SensorType = SensorType.Unknown; } // add sensor type to message message.RawSensorType = messageData[7]; // add sensor number to the message class message.SensorNumber = messageData[8]; // Event Data Byte byte[] eventDataByte = IpmiSharedFunc.ByteSplit(messageData[9], new int[2] { 7, 0 }); // Event Dir. Asersion/Deserstion Bit 7 byte eventDir = eventDataByte[0]; // EventType [6:0] byte eventTypeCode = eventDataByte[1]; message.EventTypeCode = eventTypeCode; // Event Dir if (Enum.IsDefined(typeof(EventDir), eventDir)) { message.EventDir = (EventDir)eventDir; } else { message.EventDir = EventDir.Unknown; } // copy event message payload to the response raw payload array Buffer.BlockCopy(messageData, 10, message.RawPayload, 0, 3); // Add the raw payload as hex string to the user return class. message.EventPayload = IpmiSharedFunc.ByteArrayToHexString(message.RawPayload); }