using System;
using System.ComponentModel;

namespace FlyADBase.Inc
{
    public interface IFlyAd2021Comm : INotifyPropertyChanged
    {
        /// <summary>
        /// IP 地址 and 端口号
        /// </summary>
        string Addr { get; set; }

        /// <summary>
        /// 是否异常
        /// </summary>
        bool IsError { get; }

        /// <summary>
        /// 异常信息
        /// </summary>
        string ErrMsg { get; }

        /// <summary>
        /// 连接成功
        /// </summary>
        bool IsConnected { get; }


        /// <summary>
        /// 运行中
        /// </summary>
        bool IsRunning { get; }

        /// <summary>
        /// 开始
        /// </summary>
        void Start();

        /// <summary>
        /// 接收
        /// </summary>
        void Stop();

        /// <summary>
        /// 发送数据
        /// </summary>
        /// <param name="msg"></param>
        void SendMsg(byte[] msg);


        /// <summary>
        /// 接收数据
        /// </summary>
        event Action<byte[]> RecMsg;


    }
}