ISerialPort.cs 597 B

1234567891011121314151617181920212223242526
  1. using System;
  2. using System.Collections.Generic;
  3. using System.ComponentModel;
  4. using System.Linq;
  5. using System.Text;
  6. using System.Threading.Tasks;
  7. namespace AwInitilizer.Interface
  8. {
  9. public enum ConnectStatus
  10. {
  11. Cleared, Connecting, Connected, DisConnected, ConnectionFail
  12. }
  13. public interface ISerialPort : INotifyPropertyChanged
  14. {
  15. ConnectStatus ConnectStatus { get; }
  16. void Open();
  17. Task OpenAsync();
  18. void Close();
  19. void WriteData(byte[] msg);
  20. event EventHandler<byte[]> OnDataReceived;
  21. }
  22. }