| | |
| | | } catch (Exception ex) { |
| | | Console.WriteLine (ex.Message); |
| | | Application.RunOnMainThread (() => { |
| | | new Alert ("", Language.StringByID (R.MyInternationalizationString.OperationFailed), Language.StringByID (R.MyInternationalizationString.Close)).Show (); |
| | | //修改网关连接模式失败 |
| | | new Alert ("", "Failed to modify gateway connection mode!", Language.StringByID (R.MyInternationalizationString.Close)).Show (); |
| | | }); |
| | | bool canRemove = false; |
| | | } finally { |
| | |
| | | |
| | | byte [] backBytes = Control.ControlBytesSendHasReturn (Command.SetGateWayAdminInfo, gatewayDeicve.SubnetID, gatewayDeicve.DeviceID, adminBytes); |
| | | |
| | | return CheckIsSuccessfulWithBytes (backBytes); |
| | | return CheckIsSuccessfulWithBytes (backBytes, "Failed to modify gateway administrator information!"); |
| | | } |
| | | |
| | | /// <summary> |
| | |
| | | /// </summary> |
| | | /// <param name="backBytes"></param> |
| | | /// <returns></returns> |
| | | private bool CheckIsSuccessfulWithBytes (byte [] backBytes) |
| | | private bool CheckIsSuccessfulWithBytes (byte [] backBytes, string errorStr = "Modify gateway configuration failed!") |
| | | { |
| | | if (backBytes == null) { |
| | | Application.RunOnMainThread (() => { |
| | |
| | | return true; |
| | | } else { |
| | | Application.RunOnMainThread (() => { |
| | | new Alert ("", Language.StringByID (R.MyInternationalizationString.OperationFailed), |
| | | new Alert ("", errorStr, |
| | | Language.StringByID (R.MyInternationalizationString.Close)).Show (); |
| | | }); |
| | | return false; |
| | |
| | | void BindGatewaysNew () |
| | | { |
| | | Application.RunOnMainThread (() => { |
| | | MainPage.Loading.Start ("Gateway setting succeeded,data up.Please wait..."); |
| | | MainPage.Loading.Start ("Gateway setting succeeded,data up. Please wait..."); |
| | | }); |
| | | IO.FileUtils.SaveEquipmentMessage (gatewayDeicve); |
| | | var gatewayMAC = gatewayDeicve.MAC.Replace (".", ""); |