CrabtreeOn,印度客户定制APP,迁移2.0平台版本
JLChen
2022-01-12 407fae6f07a2a982a2a814c2f145c40733c966cb
Crabtree/SmartHome/UI/SimpleControl/MqttCommon.cs
@@ -766,6 +766,10 @@
        /// </summary>
        static void SendPushSignOut ()
        {
#if DEBUG
            return;
#endif
            byte [] message = CommonPage.MyEncodingUTF8.GetBytes (PushSignStr);
            MqttRemoteSend (message, 4);
        }
@@ -786,6 +790,7 @@
                case 0:
                    topicName = $"/ClientToBusGateWay/{CommonConfig.Current.HomeGatewayInfo.gatewayId}/Common/ON";
                    if (!string.IsNullOrEmpty (mqttEncryptKey)) {
                        //Utlis.WriteLine ("mqttEncryptKey:" + mqttEncryptKey);
                        message = Shared.Securitys.EncryptionService.AesEncryptPayload (message, mqttEncryptKey);
                    }
                    await RemoteMqttClient.PublishAsync (new MqttApplicationMessage { Topic = topicName, Payload = message, Retain = false, QualityOfServiceLevel = MQTTnet.Protocol.MqttQualityOfServiceLevel.AtMostOnce });
@@ -944,7 +949,7 @@
    public partial class EncryptionService
    {
        #region 加密
#region 加密
        /// <summary>
        /// 加密主题为Base64
        /// </summary>
@@ -999,10 +1004,10 @@
            //使用AES将明文流转成密文字节数组
            return cTransform.TransformFinalBlock (toEncryptArray, 0, toEncryptArray.Length);
        }
        #endregion
#endregion
        #region 解密
#region 解密
        /// <summary>
        /// 解密主题数据
        /// </summary>
@@ -1054,7 +1059,7 @@
            //使用AES将密文流转成明文的字节数组
            return cTransform.TransformFinalBlock (toEncryptArray, 0, toEncryptArray.Length);
        }
        #endregion
#endregion