|
|
@@ -28,6 +28,10 @@ namespace BPASmartClient.Business |
|
|
|
{ |
|
|
|
deviceMgr = Plugin.GetInstance().GetPlugin<DeviceMgr>(); |
|
|
|
mqttMgr = Plugin.GetInstance().GetPlugin<MQTTMgr>(); |
|
|
|
} |
|
|
|
|
|
|
|
public void Start() |
|
|
|
{ |
|
|
|
running = true; |
|
|
|
ThreadManage.GetInstance().Start(() => |
|
|
|
{ |
|
|
@@ -53,7 +57,7 @@ namespace BPASmartClient.Business |
|
|
|
{ |
|
|
|
wholeDeviceStatus[device.DeviceId] = device.Status.GetStatus(); |
|
|
|
deviceStatus.Healthy = device.IsHealth ? BPA.Message.Enum.DeviceHealthy.Health : BPA.Message.Enum.DeviceHealthy.UnHealth; |
|
|
|
var msg=BPAPackage.Make(deviceStatus, device.DeviceId, device.DeviceType); |
|
|
|
var msg = BPAPackage.Make(deviceStatus, device.DeviceId, device.DeviceType); |
|
|
|
mqttMgr.Publish(TopicDefine.GetInstance().PushHeartbeatTopics[device.DeviceType], msg.Serialize()); |
|
|
|
} |
|
|
|
Thread.Sleep(1000); |
|
|
@@ -65,5 +69,7 @@ namespace BPASmartClient.Business |
|
|
|
{ |
|
|
|
running = false; |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
} |