/// <summary> /// Sets the NvDimm Trigger /// </summary> public static bool SetNvDimmTrigger(byte deviceId, NvDimmTriggerAction trigger, bool assertTrigger, byte adrCompleteDelay, byte nvdimmPresentPoweroffDelay) { if (clients.ContainsKey(deviceId)) { return(clients[deviceId].SetNvDimmTrigger(trigger, assertTrigger, adrCompleteDelay, nvdimmPresentPoweroffDelay)); } else { return(false); } }
/// <summary> /// Sets the NvDimm Trigger /// </summary> public virtual bool SetNvDimmTrigger(NvDimmTriggerAction trigger, bool assertTrigger, byte adrCompleteDelay, byte nvdimmPresentPoweroffDelay) { SetNvDimmTriggerResponse dpc = (SetNvDimmTriggerResponse)this.IpmiSendReceive( new SetNvDimmTriggerRequest(trigger, assertTrigger, adrCompleteDelay, nvdimmPresentPoweroffDelay), typeof(SetNvDimmTriggerResponse)); if (dpc.CompletionCode == 0x00) { return(true); } else { return(false); } }
/// <summary> /// Initialize instance of the class. /// </summary> internal SetNvDimmTriggerRequest(NvDimmTriggerAction triggerType, bool assertTrigger, byte adrDelay, byte nvdimmDelay) { // unknown is an enum response type only. if user // sets the trigger to unknown it will be disabled. if (triggerType == NvDimmTriggerAction.Unknown) triggerType = NvDimmTriggerAction.Disabled; this.adrTrigger = (byte)triggerType; if (assertTrigger) this.trigger = 0x01; this.adrCompleteDelay = adrDelay; this.nvdimmPresentPowerOffDelay = nvdimmDelay; }
/// <summary> /// Initialize instance of the class. /// </summary> internal SetNvDimmTriggerRequest(NvDimmTriggerAction triggerType, bool assertTrigger, byte adrDelay, byte nvdimmDelay) { // unknown is an enum response type only. if user // sets the trigger to unknown it will be disabled. if (triggerType == NvDimmTriggerAction.Unknown) { triggerType = NvDimmTriggerAction.Disabled; } this.adrTrigger = (byte)triggerType; if (assertTrigger) { this.trigger = 0x01; } this.adrCompleteDelay = adrDelay; this.nvdimmPresentPowerOffDelay = nvdimmDelay; }
/// <summary> /// Set response using formatted payload data /// </summary> internal void SetParamaters(bool manualTrigger, byte adrComplete, NvDimmTriggerAction action, byte adrCompleteDelay, byte nvdimmPresentPoweroffDelay, byte adrCompleteTimeRemaining, byte nvdimmPresentTimeRemaining) { this.manualTriggerAsserted = manualTrigger; this.adrComplete = adrComplete; this.adrTrigger = action; this.adrCompleteDelay = (int)adrCompleteDelay; this.adrCompleteTimeRemaining = (int)adrCompleteTimeRemaining; this.nvdimmPresentPowerOffDelay = nvdimmPresentPoweroffDelay; this.nvdimmPresentTimeRemaining = nvdimmPresentTimeRemaining; }
/// <summary> /// Verify Get NVDIMM Values /// </summary> private int VerifyGetNVDIMMM_Trigger(NvDimmTriggerAction nvDimmAction, byte adrCompleteDelay, byte nvdimmPresentPoweroffDelay) { try { NvDimmTrigger nvDimmTriggerResponse = ipmi.GetNvDimmTrigger(); if ((nvDimmTriggerResponse.CompletionCode == 0x00) && (nvDimmTriggerResponse.AdrTriggerType == nvDimmAction) && (nvDimmTriggerResponse.AdrCompleteDelay == adrCompleteDelay) && (nvDimmTriggerResponse.NvdimmPresentPowerOffDelay == nvdimmPresentPoweroffDelay)) { Console.WriteLine("Command Passed: {0} Completion Code: {1}. AdrTriggerType = {2}. AdrCompleteDelay = {3}. NvdimmPresentPowerOffDelay = {4}", "Get NVDIMM trigger.", nvDimmTriggerResponse.CompletionCode, nvDimmTriggerResponse.AdrTriggerType.ToString(), nvDimmTriggerResponse.AdrCompleteDelay, nvDimmTriggerResponse.NvdimmPresentPowerOffDelay); if (showDetail) EnumProp.EnumerableObject(nvDimmTriggerResponse); return 1; } else { Console.WriteLine("Command Failed: {0} Completion Code: {1}. AdrTriggerType = {2}. AdrCompleteDelay = {3}. NvdimmPresentPowerOffDelay = {4}", "Get NVDIMM trigger.", nvDimmTriggerResponse.CompletionCode, nvDimmTriggerResponse.AdrTriggerType.ToString(), nvDimmTriggerResponse.AdrCompleteDelay, nvDimmTriggerResponse.NvdimmPresentPowerOffDelay); return 0; } } catch (Exception ex) { return WriteException(ex); } }