|
|
@@ -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 |
|
|
|
{ |
|
|
|