コード例 #1
0
        /// <summary>
        /// Attempts to clear the Psu error status. This method
        /// calls down to the Chassis Manager with SendReceive
        /// </summary>
        private CompletionCode SetPsuClearFaults(byte psuId)
        {
            CompletionCode returnPacket = new CompletionCode();

            returnPacket = CompletionCode.UnspecifiedError;

            try
            {
                PsuClearfaultsResponse myResponse = new PsuClearfaultsResponse();
                myResponse = (PsuClearfaultsResponse)this.SendReceive(this.PsuDeviceType, this.PsuId, new PsuRequest((byte)PmBusCommand.CLEAR_FAULTS, (byte)PmBusResponseLength.CLEAR_FAULTS), typeof(PsuClearfaultsResponse));

                // check for completion code
                if (myResponse.CompletionCode != 0)
                {
                    returnPacket = (CompletionCode)myResponse.CompletionCode;
                }
                else
                {
                    returnPacket = CompletionCode.Success;
                }
            }
            catch (System.Exception ex)
            {
                returnPacket = CompletionCode.UnspecifiedError;
                Tracer.WriteError(ex);
            }

            return(returnPacket);
        }
コード例 #2
0
ファイル: PsuBase.cs プロジェクト: kewencai/ChassisManager
        /// <summary>
        /// Attempts to clear the Psu error status. This method
        /// calls down to the Chassis Manager with SendReceive
        /// </summary>
        private CompletionCode SetPsuClearFaults(byte psuId)
        {
            CompletionCode returnPacket = new CompletionCode();
            returnPacket = CompletionCode.UnspecifiedError;

            try
            {
                PsuClearfaultsResponse myResponse = new PsuClearfaultsResponse();
                myResponse = (PsuClearfaultsResponse)this.SendReceive(this.PsuDeviceType, this.PsuId, new PsuRequest((byte)PmBusCommand.CLEAR_FAULTS,(byte)PmBusResponseLength.CLEAR_FAULTS), typeof(PsuClearfaultsResponse));

                // check for completion code 
                if (myResponse.CompletionCode != 0)
                {
                    returnPacket = (CompletionCode)myResponse.CompletionCode;
                }
                else
                {
                    returnPacket = CompletionCode.Success;
                }
            }
            catch (System.Exception ex)
            {
                returnPacket = CompletionCode.UnspecifiedError;
                Tracer.WriteError(ex);
            }

            return returnPacket;
        }