| | |
| | | try { |
| | | List<byte> ButtonBkeyModelList = new List<byte> (); |
| | | switch (command) { |
| | | case Command.readGatewayVision: |
| | | case Command.InitializationGatewayACK: |
| | | if (usefullBytes.Length == 4) { |
| | | if (usefullBytes [0] == 0xF8 && usefullBytes [3] == 0) { |
| | | MainPage.GatewayStatus = "Initialization_complete";//初始化完成 |
| | | } |
| | | } |
| | | break; |
| | | case Command.enjoyUpgrade2ACK: |
| | | if (usefullBytes.Length > 1) { |
| | | if(usefullBytes [0] == 0xF8 && usefullBytes [1] == 0xF8) { |
| | | MainPage.GatewayStatus = "upgrade_100_success";//升级成功 |
| | | } |
| | | else { |
| | | MainPage.GatewayStatus = "upgrading_" + (usefullBytes [0] * 256 + usefullBytes [1])+"_"+subnetID+"_"+deviceID;//升级中 |
| | | Console.WriteLine (MainPage.GatewayStatus); |
| | | } |
| | | } |
| | | break; |
| | | case Command.readGatewayVisionACK: |
| | | var visionString = MyEncodingGB2312.GetString (usefullBytes); |
| | | Console.WriteLine ($"当前网关版本信息:{visionString}"); |
| | | break; |
| | |
| | | superWireless.WirelessPassword = MyEncodingGB2312.GetString (usefullBytes, 64, 16).Trim ('\0'); |
| | | } |
| | | GateWayList.Add (superWireless); |
| | | Application.RunOnMainThread (() => { |
| | | GuideAddGateway.InitGatewayRowView (superWireless); |
| | | }); |
| | | //IO.FileUtils.SaveEquipmentMessage (superWireless); |
| | | //System.Threading.Tasks.Task.Run (() => { |
| | | // if (string.IsNullOrEmpty (UserConfig.Current.RemoteModeFile)) { |