From f712275beebaaafda19d7f5f4bed2de43cf61ce2 Mon Sep 17 00:00:00 2001 From: fyf Date: Fri, 18 Mar 2022 18:12:43 +0800 Subject: [PATCH 1/2] 22 --- HBLConsole.Business/IotReport.cs | 8 ++++++++ HBLConsole.MainConsole/Main.cs | 2 +- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/HBLConsole.Business/IotReport.cs b/HBLConsole.Business/IotReport.cs index d4f21c2..d7e69fe 100644 --- a/HBLConsole.Business/IotReport.cs +++ b/HBLConsole.Business/IotReport.cs @@ -22,6 +22,9 @@ namespace HBLConsole.Business { IOTDev.GetInstance().Set(InternetInfo.ProductKey, InternetInfo.DeviceName, InternetInfo.DeviceSecret); iSLinks = IOTDev.GetInstance().CreateLinks(); + //订阅设备控制主题 + IOTDev.GetInstance().IOT_Subscribe("/" + InternetInfo.ProductKey + "/" + InternetInfo.DeviceName + "/user/SetDevice"); + IOTDev.actionIOT += actionIOTHandler;//消息数据回调 if (iSLinks) MessageLog.GetInstance.Show($"设备{InternetInfo.DeviceName}阿里云连接成功."); else MessageLog.GetInstance.Show($"设备{InternetInfo.DeviceName}阿里云连接失败.不能上报业务信息"); @@ -155,5 +158,10 @@ namespace HBLConsole.Business Thread.Sleep(5000); }), "设备IOT上报云端"); } + + private void actionIOTHandler(string topic, string message) + { + + } } } diff --git a/HBLConsole.MainConsole/Main.cs b/HBLConsole.MainConsole/Main.cs index 93be957..7beb370 100644 --- a/HBLConsole.MainConsole/Main.cs +++ b/HBLConsole.MainConsole/Main.cs @@ -64,7 +64,7 @@ namespace HBLConsole.MainConsole MqttHelper.GetInstance.MqttSubscriptionAsync(Topics.ToArray());//主题订阅 - //IotReport.GetInstance.Init();//IOT 上报 + //w IotReport.GetInstance.Init();//IOT 上报 HeartbeatReport.GetInstance.Init();//心跳上报 From 52a5d14c1a9bc641af37bc1bdb53522c7cfc95dd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=A6=82=E6=84=8F=20=E5=BD=AD?= <2417589739@qq.com> Date: Fri, 18 Mar 2022 22:15:38 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E9=85=8D=E7=BD=AE=E6=A8=A1=E6=8B=9F?= =?UTF-8?q?=E6=95=B0=E6=8D=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- HBLConsole.Debug/Debug_MORKIC.xaml | 8 +- HBLConsole.Debug/HBLConsole.Debug.csproj | 2 +- HBLConsole.MORKD/HBLConsole.MORKD.csproj | 4 +- HBLConsole.MORKIC/HBLConsole.MORKIC.csproj | 6 +- HBLConsole.MainConsole/Main.cs | 4 +- .../KeepParameter/KeepDataBase.cs | 22 ++ .../View/DeviceManagermentSetView.xaml | 4 +- .../DialogWindow/View/SimOrderConfitView.xaml | 55 ++-- .../View/SimOrderConfitView.xaml.cs | 17 +- .../ViewModel/SimOrderConfitViewModel.cs | 41 ++- HBLConsole/View/DebugContainer.xaml | 26 +- HBLConsole/View/DebugView.xaml | 236 ++++++++++-------- HBLConsole/View/MainView.xaml | 2 +- HBLConsole/ViewModel/DebugViewModel.cs | 69 +++-- HBLDevice.Coffee/HBLDevice.Coffee.csproj | 2 +- HBLDevice.IceCream/HBLDevice.IceCream.csproj | 2 +- 16 files changed, 320 insertions(+), 180 deletions(-) create mode 100644 HBLConsole.Model/KeepParameter/KeepDataBase.cs diff --git a/HBLConsole.Debug/Debug_MORKIC.xaml b/HBLConsole.Debug/Debug_MORKIC.xaml index 85a5b56..556dcdd 100644 --- a/HBLConsole.Debug/Debug_MORKIC.xaml +++ b/HBLConsole.Debug/Debug_MORKIC.xaml @@ -176,16 +176,16 @@ Style="{StaticResource ButtonStyle}" /> - +