Beispiel #1
0
        public void SendCommand(ViscaCommand cmd)
        {
            if (CommandInProcess)
            {
                throw new InvalidOperationException();
            }

            CurrentCommand = cmd;

            var msgs = cmd.GetCommandMsgs();

            foreach (OutMessage msg in msgs)
            {
                _innerPort.Write(msg.Data, 0, msg.Data.Length);

                while (CurrentCommand != null)
                {
                    Thread.Sleep(10);
                }
            }
        }