Beispiel #1
0
        /// <summary>
        /// Get the device time
        /// </summary>
        /// <returns>Return the device time</returns>
        public DeviceTime GetDeviceTime()
        {
            DeviceTime dev_time = new DeviceTime();

            //Prepare the command
            string comando = "{\"time\":{\"get_time\":null}}";

            //Send the command to the device and get the Json string result
            string sJsonResult = this.ExecuteAndRead(comando);

            try
            {
                JObject json_object = JObject.Parse(sJsonResult);
                dev_time.LoadFromJson(json_object["time"]["get_time"]);
            }
            catch (Exception ex)
            {
                throw new NonCompatibleDeviceException(ex.Message, ex);
            }

            return(dev_time);
        }