IDataProcessor.cs 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  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.DataProcessor.Interface
  9. {
  10. /// <summary>
  11. /// 数据处理器接口
  12. /// </summary>
  13. public abstract class IDataProcessor : IDeviceComponent
  14. {
  15. /// <summary>
  16. /// 打开设备时
  17. /// </summary>
  18. public abstract void OnOpen(DeviceModel deviceModel);
  19. /// <summary>
  20. /// 关闭传感器时
  21. /// </summary>
  22. public abstract void OnClose();
  23. /// <summary>
  24. /// 设备实时数据更新时
  25. /// </summary>
  26. public abstract void OnUpdate(DeviceModel deviceModel);
  27. public void OnClose(DeviceModel deviceModel)
  28. {
  29. }
  30. public void OnRemove()
  31. {
  32. }
  33. public void OnReceiveData(DeviceModel deviceModel, byte[] data)
  34. {
  35. }
  36. public void OnKeyUpdate(DeviceModel deviceModel, string key, object value)
  37. {
  38. }
  39. public void OnReadData(DeviceModel deviceModel, byte[] sendData, int delay = -1)
  40. {
  41. }
  42. public void OnSend(DeviceModel deviceModel, byte[] data)
  43. {
  44. }
  45. }
  46. }