예제 #1
0
 public int SimCard_scanCom(ref string[] listComs)
 {
     DllClient.ServiceReference1.SimCard_scanComRequest inValue = new DllClient.ServiceReference1.SimCard_scanComRequest();
     inValue.listComs = listComs;
     DllClient.ServiceReference1.SimCard_scanComResponse retVal = ((DllClient.ServiceReference1.ISIMcoreAPIService)(this)).SimCard_scanCom(inValue);
     listComs = retVal.listComs;
     return(retVal.SimCard_scanComResult);
 }
예제 #2
0
        private void DoOneDeviceMonitor()
        {
            //1.获取当前连接列表
            var devices = new List <SIMCardDevice>();

            var result = new DllClient.ServiceReference1.SimCard_scanComRequest()
            {
                listComs = new string[] { }
            };
            var res = DllClient.X86DLLClientSingle.Instance.SIMcoreAPIServiceChannel.SimCard_scanCom(result);

            if (0 == res.SimCard_scanComResult && res.listComs.IsValid())
            {
                foreach (var com in res.listComs)
                {
                    devices.Add(new SIMCardDevice()
                    {
                        ComNumStr = com
                    });
                }
            }

            //2.获取新增设备和断开连接设备
            var newConnecnted = devices.Except(CurConnectDevs).ToList();
            var disConnecteds = CurConnectDevs.Except(devices).ToList();

            foreach (var add in newConnecnted)
            {
                OnConnected(add);
                CurConnectDevs.Add(add);
            }

            foreach (var dis in disConnecteds)
            {
                OnDisconnected(dis);
                CurConnectDevs.Remove(dis);
            }
        }
예제 #3
0
 public System.Threading.Tasks.Task <DllClient.ServiceReference1.SimCard_scanComResponse> SimCard_scanComAsync(DllClient.ServiceReference1.SimCard_scanComRequest request)
 {
     return(base.Channel.SimCard_scanComAsync(request));
 }
예제 #4
0
 DllClient.ServiceReference1.SimCard_scanComResponse DllClient.ServiceReference1.ISIMcoreAPIService.SimCard_scanCom(DllClient.ServiceReference1.SimCard_scanComRequest request)
 {
     return(base.Channel.SimCard_scanCom(request));
 }