| | |
| | | if (mHomeGatewayRes.Count > 0) |
| | | { |
| | | DB_ResidenceData.Instance.HomeGateway = mHomeGatewayRes[0]; |
| | | //if (mHomeGatewayRes[0].gatewayStatus) |
| | | //{ |
| | | // DriverLayer.Control.Ins.GatewayOnline = true; |
| | | //} |
| | | //else |
| | | //{ |
| | | // DriverLayer.Control.Ins.GatewayOnline = false; |
| | | //} |
| | | DriverLayer.Control.Ins.GatewayOnline_Cloud = mHomeGatewayRes[0].gatewayStatus; |
| | | DB_ResidenceData.Instance.SaveResidenceData(); |
| | | return revertObj.Code; |
| | | } |
| | |
| | | /// </summary> |
| | | public string GetGatewayInfo() |
| | | { |
| | | if (DB_ResidenceData.Instance.HomeGateway == null) |
| | | return StateCode.NETWORK_ERROR; |
| | | Dictionary<string, object> d = new Dictionary<string, object>(); |
| | | d.Add("homeId", DB_ResidenceData.Instance.CurrentRegion.RegionID); |
| | | d.Add("gatewayId", DB_ResidenceData.Instance.HomeGateway.gatewayId); |
| | |
| | | var mHomeGatewayRes = Newtonsoft.Json.JsonConvert.DeserializeObject<HomeGatewayInfo>(revertObj.Data.ToString()); |
| | | if (mHomeGatewayRes != null) |
| | | { |
| | | if(mHomeGatewayRes.gatewayStatus) |
| | | { |
| | | DriverLayer.Control.Ins.GatewayOnline = true; |
| | | } |
| | | DriverLayer.Control.Ins.GatewayOnline_Cloud = mHomeGatewayRes.gatewayStatus; |
| | | } |
| | | } |
| | | return revertObj.Code; |