MiLightRemoteConfig.h 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  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 <FUT091PacketFormatter.h>
  9. #include <PacketFormatter.h>
  10. #ifndef _MILIGHT_REMOTE_CONFIG_H
  11. #define _MILIGHT_REMOTE_CONFIG_H
  12. class MiLightRemoteConfig {
  13. public:
  14. MiLightRemoteConfig(
  15. PacketFormatter* packetFormatter,
  16. MiLightRadioConfig& radioConfig,
  17. const MiLightRemoteType type,
  18. const String name,
  19. const size_t numGroups
  20. ) : packetFormatter(packetFormatter),
  21. radioConfig(radioConfig),
  22. type(type),
  23. name(name),
  24. numGroups(numGroups)
  25. { }
  26. PacketFormatter* const packetFormatter;
  27. const MiLightRadioConfig& radioConfig;
  28. const MiLightRemoteType type;
  29. const String name;
  30. const size_t numGroups;
  31. static const MiLightRemoteConfig* fromType(MiLightRemoteType type);
  32. static const MiLightRemoteConfig* fromType(const String& type);
  33. static const MiLightRemoteConfig* fromReceivedPacket(const MiLightRadioConfig& radioConfig, const uint8_t* packet, const size_t len);
  34. static const size_t NUM_REMOTES = 6;
  35. static const MiLightRemoteConfig* ALL_REMOTES[NUM_REMOTES];
  36. };
  37. extern const MiLightRemoteConfig FUT096Config; //rgbw
  38. extern const MiLightRemoteConfig FUT007Config; //cct
  39. extern const MiLightRemoteConfig FUT092Config; //rgb+cct
  40. extern const MiLightRemoteConfig FUT089Config; //rgb+cct B8 / FUT089
  41. extern const MiLightRemoteConfig FUT098Config; //rgb
  42. extern const MiLightRemoteConfig FUT091Config; //v2 cct
  43. #endif