public void ReadAGPSStatus(ref SkyTraqConfig config)
        {
            config.agps_hours_left = 0;
            config.agps_enabled    = 0;

            var now = DateTime.UtcNow;

            var request = new SkyTraqPackage(
                SkyTraqCommand.SKYTRAQ_COMMAND_READ_AGPS_STATUS,
                (byte)(now.Year >> 8),
                (byte)now.Year,
                (byte)now.Month,
                (byte)now.Day,
                (byte)now.Hour,
                (byte)now.Minute,
                (byte)now.Second
                );

            if (ACK == WritePackageWithResponse(request))
            {
                var response = ReadNextPackage();
                if (response != null)
                {
                    config.agps_hours_left = BitConverter.ToUInt16(response.data, 1);
                    config.agps_enabled    = response.data[3];
                }
            }
        }
示例#2
0
        public void ReadAGPSStatus(ref SkyTraqConfig config)
        {
            config.agps_hours_left = 0;
            config.agps_enabled = 0;

            var now = DateTime.UtcNow;

            var request = new SkyTraqPackage(
                SkyTraqCommand.SKYTRAQ_COMMAND_READ_AGPS_STATUS,
                (byte)(now.Year >> 8),
                (byte)now.Year,
                (byte)now.Month,
                (byte)now.Day,
                (byte)now.Hour,
                (byte)now.Minute,
                (byte)now.Second
            );

            if (ACK == WritePackageWithResponse(request))
            {
                var response = ReadNextPackage();
                if (response != null)
                {
                    config.agps_hours_left = BitConverter.ToUInt16(response.data, 1);
                    config.agps_enabled = response.data[3];
                }
            }
        }
        public int ReadDataloggerConfig(out SkyTraqConfig config)
        {
            int result = ERROR;

            config = null;

            var request = new SkyTraqPackage(SkyTraqCommand.SKYTRAQ_COMMAND_GET_CONFIG);

            if (ACK == WritePackageWithResponse(request))
            {
                var response = ReadNextPackage();
                if (response != null)
                {
                    config = new SkyTraqConfig(response.data);
                    result = SUCCESS;
                }
            }

            return(result);
        }
 public void WriteDataloggerConfig(SkyTraqConfig config)
 {
     WritePackageWithResponse(config.GetWritePackage());
 }
 public void WriteDataloggerConfig(SkyTraqConfig config)
 {
     WritePackageWithResponse(config.GetWritePackage());
 }
        public int ReadDataloggerConfig(out SkyTraqConfig config)
        {
            int result = ERROR;
            config = null;

            var request = new SkyTraqPackage(SkyTraqCommand.SKYTRAQ_COMMAND_GET_CONFIG);
            if (ACK == WritePackageWithResponse(request))
            {
                var response = ReadNextPackage();
                if (response != null)
                {
                    config = new SkyTraqConfig(response.data);
                    result = SUCCESS;
                }
            }

            return result;
        }