| | |
| | | |
| | | namespace HDL_ON.DAL.Mqtt |
| | | { |
| | | public static class MqttCommon |
| | | public static class MqttClient |
| | | { |
| | | /// <summary> |
| | | /// 加密通讯KEY |
| | |
| | | { |
| | | if (reset) |
| | | { |
| | | bNeedStartTip = true; |
| | | bNeedConnectTip = true; |
| | | MqttInfoConfig.Current.IfGetMqttInfoSuccess = false; |
| | | } |
| | | await DisConnectRemoteMqttClient(s); |
| | |
| | | public static bool remoteMqttIsConnecting; |
| | | static bool remoteIsConnected; |
| | | |
| | | static MqttCommon() |
| | | static MqttClient() |
| | | { |
| | | InitMqtt(); |
| | | } |
| | |
| | | { |
| | | packet.Bytes = e.ApplicationMessage.Payload; |
| | | } |
| | | packet.IsLocal = false; |
| | | packet.Manager(); |
| | | } |
| | | } |
| | |
| | | |
| | | if (MqttInfoConfig.Current.HomeGatewayInfo != null && MqttInfoConfig.Current.mMqttInfo != null) |
| | | { |
| | | if (bNeedConnectTip) |
| | | { |
| | | bNeedConnectTip = false; |
| | | MainPage.LoadingTipShow(Language.StringByID(SimpleControl.R.MyInternationalizationString.GetSuccessfullyStartConnecting)); |
| | | } |
| | | |
| | | try |
| | | { |
| | | |
| | |
| | | var mqttInfoRequestResult_Obj =new Server.HttpServerRequest().GetMqttRemoteInfo(GetRandomKey()); |
| | | if (mqttInfoRequestResult_Obj != null) |
| | | { |
| | | MqttInfoConfig.Current.mMqttInfo = mqttInfoRequestResult_Obj; |
| | | if (UserConfig.Instance.GatewayList != null && UserConfig.Instance.GatewayList.Count > 0) |
| | | MqttInfoConfig.Cur.mMqttInfo = mqttInfoRequestResult_Obj; |
| | | if (UserConfig.Instance.GatewayList != null && UserConfig.Instance.GatewayList.Count > 0) |
| | | { |
| | | //----第二步找出是否存在匹配当前住宅的mac,存在再进行远程。 |
| | | MqttInfoConfig.Current.HomeGatewayInfo = UserConfig.Instance.GatewayList[0]; |
| | |
| | | { |
| | | Utlis.WriteLine("============>还没绑定网关"); |
| | | } |
| | | |
| | | } |
| | | else |
| | | { |
| | | Utlis.WriteLine("============>MqttInfo null"); |
| | | } |
| | | |
| | | |
| | | |
| | | } |
| | | |
| | | |
| | | } |
| | | } |
| | | |