public bool CheckDeviceExist(string deviceAddress)
        {
            var client = new Way.Lib.NetStream(this.Address, this.Port);
            var json   = Newtonsoft.Json.JsonConvert.SerializeObject(new Command()
            {
                Type          = "CheckDeviceExist",
                DeviceAddress = deviceAddress
            });

            byte[] bs = System.Text.Encoding.UTF8.GetBytes(json);
            client.Write(bs.Length);
            client.Write(bs);

            bool result = client.ReadBoolean();

            client.Dispose();
            return(result);
        }
        public bool[] WriteValue(string deviceAddress, string[] points, object[] values)
        {
            var result = new bool[points.Length];

            var client = new Way.Lib.NetStream(this.Address, this.Port);
            var json   = Newtonsoft.Json.JsonConvert.SerializeObject(new Command()
            {
                Type          = "WriteValue",
                DeviceAddress = deviceAddress,
                Points        = points,
                Values        = values
            });

            byte[] bs = System.Text.Encoding.UTF8.GetBytes(json);
            client.Write(bs.Length);
            client.Write(bs);

            for (int i = 0; i < result.Length; i++)
            {
                result[i] = client.ReadBoolean();
            }
            client.Dispose();
            return(result);
        }