Exemple #1
0
        /// <summary>
        /// Unzips the specified input.
        /// </summary>
        /// <typeparam name="T"></typeparam>
        /// <param name="input">The input.</param>
        /// <returns>T.</returns>
        public static T Unzip <T>(this string input)
            where T : Result
        {
            var s = input.Decompress();

            return(DomainSerializer <T> .DeserializeJson(s));
        }
        /// <summary>
        ///     Gets the call sign information.
        /// </summary>
        /// <param name="callsingId">The callsing identifier.</param>
        /// <param name="clientLat">The Latitude coordinate of the client</param>
        /// <param name="clientLon">The Longitude coordinate of the client</param>
        /// <param name="unit"></param>
        /// <returns>StationItem.</returns>
        public CallSignInfo GetCallSignInfo(string callsingId, double clientLat, double clientLon, string unit)
        {
            WebRequest req =
                WebRequest.Create(String.Format(HamdroidSentryConst.GetCallSingInfoUrl, callsingId, clientLat, clientLon,
                                                unit));
            WebResponse resp = req.GetResponse();
            Stream      sIn  = resp.GetResponseStream();

            return(DomainSerializer <CallSignInfo> .DeserializeJson(sIn));
        }
        /// <summary>
        ///     Registers the device location.
        /// </summary>
        /// <param name="deviceId">The device identifier.</param>
        /// <param name="latitude">The latitude.</param>
        /// <param name="longitude">The longitude.</param>
        /// <param name="altitude">The altitude.</param>
        /// <param name="bearing">The bearing.</param>
        /// <param name="speed">The speed.</param>
        /// <returns>DeviceLocation.</returns>
        public DeviceLocation RegisterDeviceLocation(string deviceId, double latitude, double longitude, double altitude,
                                                     float bearing, float speed)
        {
            WebRequest req =
                WebRequest.Create(String.Format(HamdroidSentryConst.RegisterDeviceLocationUrl, deviceId, latitude,
                                                longitude, altitude, bearing, speed));
            WebResponse resp = req.GetResponse();
            Stream      sIn  = resp.GetResponseStream();

            return(DomainSerializer <DeviceLocation> .DeserializeJson(sIn));
        }