IProtocolResolver.cs 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6. using Wit.SDK.Modular.Sensor.Device;
  7. using Wit.SDK.Sensor.Device.Interfaces;
  8. namespace Wit.SDK.Modular.Sensor.Modular.ProtocolResolver.Interface
  9. {
  10. /// <summary>
  11. /// 协议解析器接口
  12. /// </summary>
  13. public abstract class IProtocolResolver : IDeviceComponent
  14. {
  15. /// <summary>
  16. /// 读取数据时
  17. /// </summary>
  18. public abstract void OnReadData(DeviceModel deviceModel, byte[] sendData, int delay = -1);
  19. /// <summary>
  20. /// 收到数据时
  21. /// </summary>
  22. /// <param name="data"></param>
  23. public abstract void OnReceiveData(DeviceModel deviceModel, byte[] data);
  24. public void OnClose(DeviceModel deviceModel)
  25. {
  26. }
  27. public void OnKeyUpdate(DeviceModel deviceModel, string key, object value)
  28. {
  29. }
  30. public void OnOpen(DeviceModel deviceModel)
  31. {
  32. }
  33. public void OnRemove()
  34. {
  35. }
  36. public void OnSend(DeviceModel deviceModel, byte[] data)
  37. {
  38. }
  39. public void OnUpdate(DeviceModel deviceModel)
  40. {
  41. }
  42. }
  43. }