|
- using HBLConsole.Communication;
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
-
- namespace BPASmartClient.Business
- {
- /// <summary>
- /// 主控入口
- /// </summary>
- public class MainConsole
- {
- /// <summary>
- /// 主业务线开始
- /// </summary>
- public void Start()
- {
- //网络相关
- InternetInfo.InitConfig();
- //业务插件初始化
- Plugin.GetInstance().Init();
- //主题初始化
- TopicDefine.GetInstance().Initialize(Plugin.GetInstance().GetPlugin<DeviceMgr>().GetDevices());
- //MQTT 重连成功
- MqttHelper.GetInstance().Reconnection = new Action(() =>
- {
- MqttHelper.GetInstance().MqttSubscriptionAsync(TopicDefine.GetInstance().SubscribTopics.ToArray());
- });
- //MQTT 连接
- MqttHelper.GetInstance().MqttInitAsync(InternetInfo.MqttUserName, InternetInfo.MqttPassword,
- InternetInfo.MqttAddress, InternetInfo.MqttPort, DateTime.Now.ToString("yyyy-MM-dd-HH-mm-ss"));
- }
-
- /// <summary>
- /// 主业务线停止
- /// </summary>
- public void Stop()
- {
- }
- }
- }
|