예제 #1
0
        public void ObserveObjects(Guid clientID, Guid objectDefinitionID)
        {
            IPCRequest request = new IPCRequest();

            request.Method = "ObserveObjects";
            request.AddToPayload(clientID);
            request.AddToPayload(objectDefinitionID);
            SendRequest(request);
        }
예제 #2
0
        public void CancelObserveObjects(Guid clientID, Guid objectDefinitionID, bool useReset)
        {
            IPCRequest request = new IPCRequest();

            request.Method = "CancelObserveObjects";
            request.AddToPayload(clientID);
            request.AddToPayload(objectDefinitionID);
            request.AddToPayload(useReset);
            SendRequest(request);
        }
예제 #3
0
        public void ObserveObjectProperty(Guid clientID, Guid objectDefinitionID, string instanceID, Guid propertyMetadataID)
        {
            IPCRequest request = new IPCRequest();

            request.Method = "ObserveObjectProperty";
            request.AddToPayload(clientID);
            request.AddToPayload(objectDefinitionID);
            request.AddToPayload(instanceID);
            request.AddToPayload(propertyMetadataID);
            SendRequest(request);
        }
예제 #4
0
        public void SaveObjectProperty(Guid clientID, Guid objectDefinitionID, string instanceID, Property property, Model.TObjectState state)
        {
            IPCRequest request = new IPCRequest();

            request.Method = "SaveObjectProperty";
            request.AddToPayload(clientID);
            request.AddToPayload(objectDefinitionID);
            request.AddToPayload(instanceID);
            property.Serialise(request.Payload);
            request.AddToPayload((int)state);
            SendRequest(request);
        }
예제 #5
0
        public Imagination.Model.Object GetObject(Guid clientID, Guid objectDefinitionID, string instanceID)
        {
            Imagination.Model.Object result = null;
            IPCRequest request = new IPCRequest();

            request.Method = "GetObject";
            request.AddToPayload(clientID);
            request.AddToPayload(objectDefinitionID);
            request.AddToPayload(instanceID);
            SendRequest(request);
            if (_ResponseBytes.Length > 0)
            {
                result = Imagination.Model.Object.Deserialise(new MemoryStream(_ResponseBytes));
            }
            return(result);
        }
예제 #6
0
        public void SetDataFormat(TDataFormat dataFormat)
        {
            IPCRequest request = new IPCRequest();

            request.Method = "SetDataFormat";
            request.AddToPayload((int)dataFormat);
            SendRequest(request);
        }
예제 #7
0
        public string SaveObject(Guid clientID, Imagination.Model.Object item, Model.TObjectState state)
        {
            string     result  = null;
            IPCRequest request = new IPCRequest();

            request.Method = "SaveObject";
            request.AddToPayload(clientID);
            item.Serialise(request.Payload);
            request.AddToPayload((int)state);
            SendRequest(request);
            if (_ResponseBytes.Length > 0)
            {
                CheckError();
                result = Encoding.UTF8.GetString(_ResponseBytes, 4, _ResponseBytes.Length - 4);
            }
            return(result);
        }
예제 #8
0
        public Property GetObjectProperty(Guid clientID, Guid objectDefinitionID, string instanceID, Guid propertyMetadataID)
        {
            Property   result  = null;
            IPCRequest request = new IPCRequest();

            request.Method = "GetObjectProperty";
            request.AddToPayload(clientID);
            request.AddToPayload(objectDefinitionID);
            request.AddToPayload(instanceID);
            request.AddToPayload(propertyMetadataID);
            SendRequest(request);
            if (_ResponseBytes.Length > 0)
            {
                result = Property.Deserialise(new MemoryStream(_ResponseBytes));
            }
            return(result);
        }
예제 #9
0
        public bool ExecuteResource(Guid clientID, Guid objectDefinitionID, string instanceID, Guid propertyMetadataID)
        {
            bool       result  = false;
            IPCRequest request = new IPCRequest();

            request.Method = "ExecuteResource";
            request.AddToPayload(clientID);
            request.AddToPayload(objectDefinitionID);
            request.AddToPayload(instanceID);
            request.AddToPayload(propertyMetadataID);
            SendRequest(request);
            if (_ResponseBytes.Length > 0)
            {
                result = _ResponseBytes[0] != 0x00;
            }
            return(result);
        }
예제 #10
0
        public void DeleteClient(Guid clientID)
        {
            IPCRequest request = new IPCRequest();

            request.Method = "DeleteClient";
            request.AddToPayload(clientID);
            SendRequest(request);
        }
예제 #11
0
        public bool SetNotificationParameters(Guid clientID, Guid objectDefinitionID, string instanceID, Guid propertyMetadataID, NotificationParameters notificationParameters)
        {
            bool       result  = false;
            IPCRequest request = new IPCRequest();

            request.Method = "SetNotificationParameters";
            request.AddToPayload(clientID);
            request.AddToPayload(objectDefinitionID);
            request.AddToPayload(instanceID);
            request.AddToPayload(propertyMetadataID);
            notificationParameters.Serialise(request.Payload);
            SendRequest(request);
            if (_ResponseBytes.Length > 0)
            {
                result = _ResponseBytes[0] != 0x00;
            }
            return(result);
        }
예제 #12
0
        public List <Imagination.Model.Object> GetObjects(Guid clientID, Guid objectDefinitionID)
        {
            List <Imagination.Model.Object> result = new List <Imagination.Model.Object>();
            IPCRequest request = new IPCRequest();

            request.Method = "GetObjects";
            request.AddToPayload(clientID);
            request.AddToPayload(objectDefinitionID);
            SendRequest(request);
            if (_ResponseBytes.Length > 0)
            {
                MemoryStream stream = new MemoryStream(_ResponseBytes);
                while (stream.Position < stream.Length)
                {
                    result.Add(Imagination.Model.Object.Deserialise(stream));
                }
            }
            return(result);
        }
예제 #13
0
        public DeviceConnectedStatus GetDeviceConnectedStatus(Guid clientID)
        {
            DeviceConnectedStatus result  = null;
            IPCRequest            request = new IPCRequest();

            request.Method = "GetDeviceConnectedStatus";
            request.AddToPayload(clientID);
            SendRequest(request);
            if (_ResponseBytes.Length > 0)
            {
                result = DeviceConnectedStatus.Deserialise(new MemoryStream(_ResponseBytes));
            }
            return(result);
        }