MiLightRemoteConfig.h 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  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. const size_t numGroups
  19. ) : packetFormatter(packetFormatter),
  20. radioConfig(radioConfig),
  21. type(type),
  22. name(name),
  23. numGroups(numGroups)
  24. { }
  25. PacketFormatter* const packetFormatter;
  26. const MiLightRadioConfig& radioConfig;
  27. const MiLightRemoteType type;
  28. const String name;
  29. const size_t numGroups;
  30. static const MiLightRemoteConfig* fromType(MiLightRemoteType type);
  31. static const MiLightRemoteConfig* fromType(const String& type);
  32. static const MiLightRemoteConfig* fromReceivedPacket(const MiLightRadioConfig& radioConfig, const uint8_t* packet, const size_t len);
  33. static const size_t NUM_REMOTES = 5;
  34. static const MiLightRemoteConfig* ALL_REMOTES[NUM_REMOTES];
  35. };
  36. extern const MiLightRemoteConfig FUT096Config; //rgbw
  37. extern const MiLightRemoteConfig FUT091Config; //cct
  38. extern const MiLightRemoteConfig FUT092Config; //rgb+cct
  39. extern const MiLightRemoteConfig FUT089Config; //rgb+cct B8 / FUT089
  40. extern const MiLightRemoteConfig FUT098Config; //rgb
  41. #endif