| | |
| | | var gatewayBytes = control.UsefulBytes; |
| | | #endregion |
| | | if (gatewayBytes != null) { |
| | | common.Remote_GroupName = CommonPage.MyEncodingGB2312.GetString (gatewayBytes, 1, 20).Trim ('\0'); |
| | | common.Remote_ProjectName = CommonPage.MyEncodingGB2312.GetString (gatewayBytes, 21, 20).Trim ('\0'); |
| | | common.Remote_UserName = CommonPage.MyEncodingGB2312.GetString (gatewayBytes, 41, 8).Trim ('\0'); |
| | | common.Remote_Password = CommonPage.MyEncodingGB2312.GetString (gatewayBytes, 49, 8).Trim ('\0'); |
| | | var requestJson2 = @"{'Token':'" + MainPage.LoginUser.LoginTokenString + "','MAC':'" + common.MAC + "','Password':'" + common.Remote_Password + "'}"; |
| | | var revertObj2 = MainPage.RequestHttps ("UpdateRemoteSwitchPassword", requestJson2, true, false); |
| | | //common.Remote_GroupName = CommonPage.MyEncodingGB2312.GetString (gatewayBytes, 1, 20).Trim ('\0'); |
| | | //common.Remote_ProjectName = CommonPage.MyEncodingGB2312.GetString (gatewayBytes, 21, 20).Trim ('\0'); |
| | | //common.Remote_UserName = CommonPage.MyEncodingGB2312.GetString (gatewayBytes, 41, 8).Trim ('\0'); |
| | | //common.Remote_Password = CommonPage.MyEncodingGB2312.GetString (gatewayBytes, 49, 8).Trim ('\0'); |
| | | //var requestJson2 = @"{'Token':'" + MainPage.LoginUser.LoginTokenString + "','MAC':'" + common.MAC + "','Password':'" + common.Remote_Password + "'}"; |
| | | //var revertObj2 = MainPage.RequestHttps ("UpdateRemoteSwitchPassword", requestJson2, true, false); |
| | | return; |
| | | } |
| | | Application.RunOnMainThread (() => { |
| | |
| | | } |
| | | } |
| | | if (canRemote && !CommonPage.IsRemote) { |
| | | if (!string.IsNullOrEmpty (UserConfig.Instance.CurrentRegion.MAC)) { |
| | | Shared.SimpleControl.CommonPage.IsRemote = true; |
| | | await SmartHome.MqttCommon.StartCloudMqtt (); |
| | | if (UserConfig.Instance.CheckHomeGateways ()) { |
| | | if (!string.IsNullOrEmpty (UserConfig.Instance.CurrentRegion.HomeGateways[0].GatewayUniqueId)) { |
| | | Shared.SimpleControl.CommonPage.IsRemote = true; |
| | | await SmartHome.MqttCommon.StartCloudMqtt (); |
| | | } |
| | | } |
| | | } |
| | | } |