MiLightRemoteConfig.h 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. #include <MiLightRadioConfig.h>
  2. #include <PacketFormatter.h>
  3. #include <RgbwPacketFormatter.h>
  4. #include <RgbPacketFormatter.h>
  5. #include <RgbCctPacketFormatter.h>
  6. #include <CctPacketFormatter.h>
  7. #include <FUT089PacketFormatter.h>
  8. #include <PacketFormatter.h>
  9. #ifndef _MILIGHT_REMOTE_CONFIG_H
  10. #define _MILIGHT_REMOTE_CONFIG_H
  11. class MiLightRemoteConfig {
  12. public:
  13. MiLightRemoteConfig(
  14. PacketFormatter* packetFormatter,
  15. MiLightRadioConfig& radioConfig,
  16. const MiLightRemoteType type,
  17. const String name
  18. ) : packetFormatter(packetFormatter),
  19. radioConfig(radioConfig),
  20. type(type),
  21. name(name)
  22. { }
  23. PacketFormatter* const packetFormatter;
  24. const MiLightRadioConfig& radioConfig;
  25. const MiLightRemoteType type;
  26. const String name;
  27. static const MiLightRemoteConfig* fromType(MiLightRemoteType type);
  28. static const MiLightRemoteConfig* fromType(const String& type);
  29. static const MiLightRemoteConfig* fromReceivedPacket(const MiLightRadioConfig& radioConfig, const uint8_t* packet, const size_t len);
  30. static const size_t NUM_REMOTES = 5;
  31. static const MiLightRemoteConfig* ALL_REMOTES[NUM_REMOTES];
  32. };
  33. extern const MiLightRemoteConfig FUT096Config; //rgbw
  34. extern const MiLightRemoteConfig FUT091Config; //cct
  35. extern const MiLightRemoteConfig FUT092Config; //rgb+cct
  36. extern const MiLightRemoteConfig FUT089Config; //rgb+cct B8 / FUT089
  37. extern const MiLightRemoteConfig FUT098Config; //rgb
  38. #endif