////using BPA.Message;
////using BPA.Utility;
//using System;
//using System.Collections.Generic;
//using System.Linq;
//using System.Text;
//using System.Threading.Tasks;
////using GVL;
////using BPA.Message.Enum;
////using BPA.Communication;
//using System.Threading;
//using HBLConsole.Service;
//using HBLConsole.GVL;
//using BPA.Message;
//using HBLConsole.Communication;
//using BPA.Message.Enum;

//namespace HBLConsole.MainConsole
//{
//    public class HeartbeatReport
//    {

//        private volatile static HeartbeatReport _Instance;
//        public static HeartbeatReport GetInstance => _Instance ?? (_Instance = new HeartbeatReport());
//        private HeartbeatReport() { }

//        /// <summary>
//        /// 消息包
//        /// </summary>
//        public BPAPackage MessagePackage { get; set; } = new BPAPackage();

//        public Func<IMessage> GetMessage { get; set; }

//        DeviceStatus deviceStatus = new DeviceStatus();
//        string Topic = string.Empty;

//        public void Init()
//        {
//            deviceStatus.DeviceType = GeneralConfig.GetInstance.DeviceType;
//            deviceStatus.BatchingInfo = new List<BatchingInfo>();
//            deviceStatus.Healthy = DeviceHealthy.UnHealth;
//            Topic = TOPIC.GetInstance.GetHeatbeatTopic(GeneralConfig.GetInstance.DeviceType);

//            ThreadManagerment.GetInstance.StartLong(new Action(() =>
//            {
//                MessagePackage.ClientId = InternetInfo.GetInstance.ClientId;
//                MessagePackage.ClientType = GeneralConfig.GetInstance.DeviceType;
//                MessagePackage.MessageId = MessageID.MORK_HEART_BEAT;
//                MessagePackage.MessageVersion = 0x01;
//                MessagePackage.Timestamp = DateTime.Now;
//                MessagePackage.Message = GetMessage == null ? deviceStatus : GetMessage();
//                MqttHelper.GetInstance.MqttPublishAsync(Topic, MessagePackage.Serialize());
//                Thread.Sleep(1000);
//            }), "设备心跳上报");

//        }
//    }
//}
