private void Interact(WorldEntity e) { if (e.type == WorldEntity.Type.Station) { WorldMapController.main.HideMap(); mode = Mode.Station; station = e; stationDevice = null; reachingStation = false; stationError = null; stationGetting = false; stationSending = false; try { stationDevice = UpDevice.FromJSON(MiniJSON.Json.Deserialize(e.deviceDesc)); reachingStation = true; (new System.Threading.Thread(StationReachThread)).Start(); } catch (System.Exception ex) { reachingStation = false; stationError = ex.ToString(); } } }
private void CheckIn() { if (webHost == null) { webHost = gateway.ListDevices().Find(d => d.name == "ubimon-server"); } if (webHost != null) { Call call = new Call(POSITION_REG_DRIVER, "checkIn"); call.AddParameter("clientName", clientName) .AddParameter("latitude", pos.latitude) .AddParameter("longitude", pos.longitude) .AddParameter("delta", pos.delta) .AddParameter("metadata", "ubimon"); Response r = gateway.CallService(webHost, call); if ((r != null) && string.IsNullOrEmpty(r.error)) { myPosRegId = int.Parse(r.GetResponseData("clientId").ToString()); } else { gateway.logger.LogError(r == null ? "No response for check-in." : "Error on check-in: " + r.error); } } }
public DriverData(UpDriver driver, UpDevice device, string instanceID) { this.driver = driver; this.device = device; this.instanceID = instanceID; }