/// <summary> /// Send Async Bridge Command /// </summary> /// <param name="channel">Channel to send command (Intel ME = 6)</param> /// <param name="messageData">Message payload</param> public virtual GetNodeMangerMessage GetNodeManagerMessage(byte rqSeq, byte channel, Type responseMessage) { GetMessageResponse getMsg = (GetMessageResponse)this.IpmiSendReceive( new GetMessageRequest(), typeof(GetMessageResponse)); GetNodeMangerMessage response = new GetNodeMangerMessage(getMsg.CompletionCode); // Create the response based on the provided type. ConstructorInfo constructorInfo = responseMessage.GetConstructor(Type.EmptyTypes); NodeManagerResponse nodeManagerResponse = (NodeManagerResponse)constructorInfo.Invoke(new Object[0]); if (getMsg.CompletionCode == 0x00) { // set the message data. response.MessageData = getMsg.MessageData; if (getMsg.MessageData != null) { if (getMsg.MessageData.Length > 6) { nodeManagerResponse.CompletionCode = getMsg.MessageData[6]; } else { nodeManagerResponse.CompletionCode = 0xC9; // IpmiParameterOutOfRange } } else { nodeManagerResponse.CompletionCode = 0xCE; // IpmiResponseNotProvided } } else { nodeManagerResponse.CompletionCode = getMsg.CompletionCode; } if (nodeManagerResponse.CompletionCode == 0x00) { try { nodeManagerResponse.InitializeNodeManager(getMsg.MessageData, getMsg.MessageData.Length, rqSeq); response.Response = nodeManagerResponse; } catch (Exception) { // set an exception code for invalid data in ipmi data field, as the packet could nodeManagerResponse.CompletionCode = 0xD6; // IpmiCmdFailedIllegalParameter } } return(response); }
/// <summary> /// Get Message Response /// </summary> public virtual BridgeMessage GetMessage() { GetMessageResponse getMsg = (GetMessageResponse)this.IpmiSendReceive( new GetMessageRequest(), typeof(GetMessageResponse)); BridgeMessage response = new BridgeMessage(getMsg.CompletionCode); if (getMsg.CompletionCode == 0x00) { response.SetParamaters(getMsg.MessageData); } return(response); }