Example #1
0
        /// <summary>
        /// Switches Serial control from System serial port to Bmc to close console redirection
        /// </summary>
        public virtual SerialMuxSwitch ResetSerialMux()
        {
            //Sent an Ipmi Command
            ChannelAuthenticationCapabilities auth = GetAuthenticationCapabilities(PrivilegeLevel.Administrator, false);

            // try 1 more time, as serial console snooping my not have detected the 1st request
            if (auth.CompletionCode != 0)
            {
                auth = GetAuthenticationCapabilities(PrivilegeLevel.Administrator, false);
            }

            // create response package
            SerialMuxSwitch response = new SerialMuxSwitch(auth.CompletionCode);

            if (auth.CompletionCode == 0)
            {
                response.SetParamaters(true, true, true,
                                       true, true, true);
            }
            else
            {
                response.SetParamaters(true, false, true,
                                       true, false, true);
            }

            return(response);
        }
Example #2
0
        /// <summary>
        /// Sends the IPMI command to BMC for SetSerialMux
        /// </summary>
        public virtual SerialMuxSwitch SetSerialMux(byte channel, MuxSwtich mux, bool retry)
        {
            SetSerialMuxResponse setMux = (SetSerialMuxResponse)this.IpmiSendReceive(
                new SetSerialMuxRequest(channel, mux), typeof(SetSerialMuxResponse), retry);

            SerialMuxSwitch response = new SerialMuxSwitch(setMux.CompletionCode);

            if (setMux.CompletionCode == 0)
            {
                setMux.GetMux();

                response.SetParamaters(
                    setMux.AlertInProgress,
                    setMux.MessagingActive,
                    setMux.MuxSetToSystem,
                    setMux.MuxSwitchAllowed,
                    setMux.RequestAccepted,
                    setMux.RequestToBmcAllowed
                    );
            }
            else if (mux == MuxSwtich.ForceSystem && setMux.CompletionCode == 0xD5)
            {
                setMux.GetMux();

                if (response.MuxSetToSystem)
                {
                    response.CompletionCode = 0x00;
                    response.SetParamaters(
                        setMux.AlertInProgress,
                        setMux.MessagingActive,
                        setMux.MuxSetToSystem,
                        setMux.MuxSwitchAllowed,
                        setMux.RequestAccepted,
                        setMux.RequestToBmcAllowed
                        );
                }
            }

            return(response);
        }