示例#1
0
        /// <summary>
        /// Parse the measurement values within the ping response packets received from the clients. The values are contained in a JSON formatted string.
        /// </summary>
        /// <param name="message"></param>
        /// <returns></returns>
        public Rtt processPacket(string message)
        {
            // Using a dummy Rtt. Type doesn't matter.
            Rtt tempRtt = new Rtt(0, -1);

            JObject o = JObject.Parse(message);
            tempRtt.appID = (int)o["appID"];

            tempRtt.deviceID = (string) o["deviceID"];
            tempRtt.sessionID = (long) o["sessionID"];
            tempRtt.signalStrength = (int) o["cellSignal"];

            tempRtt.wifiSignalStrength = (int) o["wifiRssi"];
            tempRtt.wifiSpeed = (int) o["wifiSpeed"];

            tempRtt.platform = (int)o["platform"];

            tempRtt.wifiAvailability = (int) o["wifiAvail"];
            tempRtt.isConnectedtoWifi = (int) o["wifiCon"];
            tempRtt.wifiIsFailover = (int)o["wifiFO"];
            tempRtt.wifiState = (int) o["wifiState"];
            tempRtt.wifiSubType = (int) o["wifiSubtype"];
            //temp.put("wifiInfo", wifiInformation);

            tempRtt.cellularAvailable = (int) o["cellAvail"];
            tempRtt.isConnectedToCellular = (int) o["cellConn"];
            tempRtt.cellularIsFailover = (int) o["cellFO"];
            tempRtt.cellularState = (int) o["cellState"];
            tempRtt.cellularSubtype = (int) o["cellSubtype"];
            //temp.put("cellInfo", cellInformation);

            tempRtt.activeNetwork = (int) o["activeType"];
            tempRtt.activeSubtype = (int)o["activeSub"];
            //temp.put("activeInfo", activeInformation);

            //log.Info("Received: " + tempRtt);
            return tempRtt;
        }
示例#2
0
 public DbEntry(Rtt rtt, string deviceID)
 {
     this.rtt = rtt;
     this.deviceID = deviceID;
 }