| | |
| | | else |
| | | { |
| | | SetGatewayOnlineResetCheck(); |
| | | var bytes = Securitys.EncryptionService.AesDecryptPayload(e.ApplicationMessage.Payload, DB_ResidenceData.residenceData.HomeGateway.aesKey); |
| | | var bytes = Securitys.EncryptionService.AesDecryptPayload(e.ApplicationMessage.Payload, DB_ResidenceData.Instance.HomeGateway.aesKey); |
| | | |
| | | //bus数据解析 |
| | | if (DB_ResidenceData.residenceData.GatewayType == 0) |
| | | if (DB_ResidenceData.Instance.GatewayType == 0) |
| | | { |
| | | var packet = new Packet(); |
| | | |
| | |
| | | IfNeedReadAllDeviceStatus = true; |
| | | Utlis.WriteLine($"============>Mqtt远程连接成功"); |
| | | SendPushSignOut(); |
| | | FunctionList.List.ReadAllFunctionStatus(); |
| | | //FunctionList.List.ReadAllFunctionStatus(); |
| | | }); |
| | | } |
| | | #endregion |
| | |
| | | { |
| | | try |
| | | { |
| | | if (MqttInfoConfig.Current.HomeGatewayInfo != null && MqttInfoConfig.Current.HomeGatewayInfo.mac == Entity.DB_ResidenceData.residenceData.residenceGatewayMAC) |
| | | if (MqttInfoConfig.Current.HomeGatewayInfo != null && MqttInfoConfig.Current.HomeGatewayInfo.mac == Entity.DB_ResidenceData.Instance.residenceGatewayMAC) |
| | | { |
| | | await MQTTConnectAsync(); |
| | | } |
| | |
| | | MqttInfoConfig.Current.mMqttInfo = mqttInfoRequestResult_Obj; |
| | | await MQTTConnectAsync(); |
| | | //1.判断是否绑定了网关,获取网关远程连接的加密KEY |
| | | if (DB_ResidenceData.residenceData.CheckWhetherGatewayIsBound()) |
| | | if (DB_ResidenceData.Instance.CheckWhetherGatewayIsBound()) |
| | | { |
| | | //2.找出是否存在匹配当前住宅的mac,存在再进行远程。 |
| | | MqttInfoConfig.Current.HomeGatewayInfo = DB_ResidenceData.residenceData.HomeGateway; |
| | | MqttInfoConfig.Current.HomeGatewayInfo = DB_ResidenceData.Instance.HomeGateway; |
| | | //3.开始连接 |
| | | await MQTTConnectAsync(); |
| | | } |