using CFX;
using Sln.Iot.Serilog;

namespace Sln.Iot.CFX.Event
{
    /// <summary>
    /// 终端节点连接事件
    /// </summary>
    public class EndpointConnectedEvent
    {
        /// <summary>
        /// 数据封装处理
        /// </summary>
        /// <returns></returns>
        public CFXMessage Handle(string cfxHandle, string loaclURI, string targetURI)
        {
            CFXMessage eve = null;
            try
            {
                eve = new EndpointConnected()
                {
                    CFXHandle = cfxHandle,
                    RequestNetworkUri = loaclURI,
                    RequestTargetAddress = targetURI
                };
            }
            catch (Exception e)
            {
                SerilogHelper.Instance.Error("终端节点连接事件数据封装异常", e);
            }
            return eve;
        }
    }
}
