示例#1
0
        public async void Init()
        {
            ReadyContent = "初始化...";

            receiveSerial = new SerialDevice();
            outputSerial = new SerialDevice();
            var open = receiveSerial.Open(ConfigProfile.Current.ReceiveCom);
            if (open)
            {
                receiveSerial.OnReadCard += OnReadCard;
            }
            receiveSerial.Start();

            outputSerial.Open(ConfigProfile.Current.OutputCom);
            output = new OutputController(outputSerial);

            //将Nuc和摄像机Ip进行映射
            var url = "ws://" + ConfigProfile.Current.KoalaIp + ":8080/video" + "?name=" + ConfigProfile.Current.Name + "&url=" + ConfigProfile.Current.CameraRtsp.UrlEncode();
            var task = WebSocket(url);
            await task;

            RunServer();

            if (socket.IsConnected)
                ReadyContent = WaitCard;
            else
                ReadyContent = "设备连接失败";
        }
示例#2
0
 public OutputController(SerialDevice serial)
 {
     this.serial = serial;
 }