Browse Source

3434

master
fyf 2 years ago
parent
commit
546e8411d0
1 changed files with 5 additions and 1 deletions
  1. +5
    -1
      DataVAPI/UpAndDown/ProcessServer.cs

+ 5
- 1
DataVAPI/UpAndDown/ProcessServer.cs View File

@@ -46,6 +46,7 @@ namespace DataVAPI.UpAndDown
orderProvider = new OrderProvider();
}
#endregion
bool FistBOOL = false;
/// <summary>
/// 初始化
/// </summary>
@@ -61,10 +62,12 @@ namespace DataVAPI.UpAndDown
ConsoleHelper.WriteInfoLine("尝试连接阿里云.");
if (IOTDevServer.GetInstance().CreateLinks(DataBus.ProductKey, DataBus.DeviceName, DataBus.DeviceSecret))
{
FistBOOL = true;
ConsoleHelper.WriteSuccessLine($"阿里云【Transit】连接成功");
}
else
{
FistBOOL = false;
ConsoleHelper.WriteSuccessLine($"阿里云【Transit】连接失败");
}
//属性状态变xin
@@ -96,7 +99,7 @@ namespace DataVAPI.UpAndDown
{
try
{
if (!IOTDevServer.GetInstance().GetIsConnected())
if (!FistBOOL)
{

if (IOTDevServer.GetInstance().CreateLinks(DataBus.ProductKey, DataBus.DeviceName, DataBus.DeviceSecret))
@@ -107,6 +110,7 @@ namespace DataVAPI.UpAndDown

//订阅主播消息
Subscribe(IOTDevServer.BroadcastTopic);
FistBOOL=true;
}
else
{


Loading…
Cancel
Save