示例#1
0
        public void RpmE(uint instanceId, List <BacNetObject> objectList, RpmEDelegate callBack)
        {
            BacNetRemoteDevice remote = BacNetDevice.Instance.SearchRemote(BacNetRemoteDevice.Get(instanceId.ToString()));

            if (remote == null)
            {
                return;
            }

            var apdu = new ReadPropertyMultiple(objectList);

            apdu.CallBack   = callBack;
            apdu.InstanceId = instanceId;
            var npdu = new BacNetIpNpdu {
                ExpectingReply = true, Destination = remote.BacAddress
            };

            lock (_rpmPool)
            {
                if (_rpmPool.ContainsKey(apdu.InvokeId))
                {
                    _rpmPool[apdu.InvokeId].CallBack(_rpmPool[apdu.InvokeId].InstanceId, null);
                    _rpmPool.Remove(apdu.InvokeId);
                }
                _rpmPool.Add(apdu.InvokeId, apdu);
            }

            BacNetDevice.Instance.Services.Execute(npdu, apdu, remote.EndPoint);
        }
示例#2
0
        public List <BacNetObject> Rpm(uint instanceId, List <BacNetObject> objectList)
        {
            BacNetRemoteDevice remote = BacNetDevice.Instance.SearchRemote(BacNetRemoteDevice.Get(instanceId.ToString()));

            if (remote == null)
            {
                return(new List <BacNetObject>());
            }

            var apdu = new ReadPropertyMultiple(objectList);
            var npdu = new BacNetIpNpdu {
                ExpectingReply = true, Destination = remote.BacAddress
            };

            BacNetDevice.Instance.Waiter = apdu.InvokeId;
            BacNetDevice.Instance.Services.Execute(npdu, apdu, remote.EndPoint);
            objectList = WaitForResponce(apdu.InvokeId) as List <BacNetObject>;
            return(objectList ?? new List <BacNetObject>());
        }
示例#3
0
        public void RpmE(uint instanceId, List<BacNetObject> objectList, RpmEDelegate callBack)
        {
            BacNetRemoteDevice remote = BacNetDevice.Instance.SearchRemote(BacNetRemoteDevice.Get(instanceId.ToString()));
            if (remote == null)
            {
                return;
            }

            var apdu = new ReadPropertyMultiple(objectList);
            apdu.CallBack = callBack;
            apdu.InstanceId = instanceId;
            var npdu = new BacNetIpNpdu { ExpectingReply = true, Destination = remote.BacAddress };

            lock (_rpmPool)
            {
                if (_rpmPool.ContainsKey(apdu.InvokeId))
                {
                    _rpmPool[apdu.InvokeId].CallBack(_rpmPool[apdu.InvokeId].InstanceId, null);
                    _rpmPool.Remove(apdu.InvokeId);
                }
                _rpmPool.Add(apdu.InvokeId, apdu);
            }

            BacNetDevice.Instance.Services.Execute(npdu, apdu, remote.EndPoint);
        }
示例#4
0
        public List<BacNetObject> Rpm(uint instanceId, List<BacNetObject> objectList)
        {
            BacNetRemoteDevice remote = BacNetDevice.Instance.SearchRemote(BacNetRemoteDevice.Get(instanceId.ToString()));
            if (remote == null)
            {
                return new List<BacNetObject>();
            }

            var apdu = new ReadPropertyMultiple(objectList);
            var npdu = new BacNetIpNpdu { ExpectingReply = true, Destination = remote.BacAddress };

            BacNetDevice.Instance.Waiter = apdu.InvokeId;
            BacNetDevice.Instance.Services.Execute(npdu, apdu, remote.EndPoint);
            objectList = WaitForResponce(apdu.InvokeId) as List<BacNetObject>;
            return objectList ?? new List<BacNetObject>();
        }