/// <summary>
        /// Post Configure Sensor Connection with body and return the response port.
        /// </summary>
        public virtual PortSet <DefaultUpdateResponseType, Fault> ConnectToBrick(MotorState state)
        {
            ConnectToBrick op = new ConnectToBrick();

            op.Body      = new MotorConfig(state.MotorPort);
            op.Body.Name = state.Name;
            op.Body.PollingFrequencyMs = state.PollingFrequencyMs;

            this.PostUnknownType(op);
            return(op.ResponsePort);
        }
        /// <summary>
        /// Clone the LEGO NXT Motor State
        /// </summary>
        /// <returns></returns>
        internal MotorState Clone()
        {
            MotorState clone = new MotorState();

            clone.Connected               = this.Connected;
            clone.CurrentEncoderDegrees   = this.CurrentEncoderDegrees;
            clone.CurrentEncoderTimeStamp = this.CurrentEncoderTimeStamp;
            clone.CurrentMotorRpm         = this.CurrentMotorRpm;
            clone.AvgEncoderPollingRateMs = this.AvgEncoderPollingRateMs;
            clone.CurrentPower            = this.CurrentPower;
            clone.PollingFrequencyMs      = this.PollingFrequencyMs;
            clone.MotorPort               = this.MotorPort;
            clone.Name = this.Name;
            clone.ResetableEncoderDegrees = this.ResetableEncoderDegrees;
            clone.ReversePolarity         = this.ReversePolarity;
            clone.TargetEncoderDegrees    = this.TargetEncoderDegrees;
            clone.TargetPower             = this.TargetPower;
            clone.TargetStopState         = this.TargetStopState;
            return(clone);
        }
 /// <summary>
 /// LEGO NXT Motor Configuration.
 /// </summary>
 /// <param name="state"></param>
 public MotorConfig(MotorState state)
 {
     this.MotorPort          = state.MotorPort;
     this.Name               = state.Name;
     this.PollingFrequencyMs = state.PollingFrequencyMs;
 }
 /// <summary>
 /// Configure Device Connection
 /// </summary>
 /// <param name="state"></param>
 public ConnectToBrick(MotorState state)
     : base(new MotorConfig(state))
 {
 }