Beispiel #1
0
        /// <summary>
        /// Service start
        /// </summary>
        protected override void Start()
        {
            if (this.state == null)
            {
                this.state = new SerialCOMServiceState();
                this.SaveState(this.state);
            }

            if (this.state.AutoConnect == true)
            {
                this.CreateAndOpenSerialPort();
            }

            base.Start();
        }
Beispiel #2
0
        public void SetConfigurationHandler(SetConfiguration setConfiguration)
        {
            this.CloseSerialPort();

            this.state             = (SerialCOMServiceState)setConfiguration.Body;
            this.state.IsConnected = false;

            if (this.state.AutoConnect)
            {
                this.CreateAndOpenSerialPort();
            }

            this.SaveState(this.state);
            this.SendNotification(this.submgrPort, setConfiguration);
            setConfiguration.ResponsePort.Post(DefaultReplaceResponseType.Instance);
        }
 /// <summary>
 /// State and Port ctor
 /// </summary>
 /// <param name="state">Service State</param>
 /// <param name="responsePort">Response Port</param>
 public Replace(SerialCOMServiceState state, PortSet <DefaultReplaceResponseType, Fault> responsePort)
     : base(state, responsePort)
 {
 }
 /// <summary>
 /// Service State-based ctor
 /// </summary>
 /// <param name="state">Service State</param>
 public Replace(SerialCOMServiceState state)
     : base(state)
 {
 }