Kaynağa Gözat

hardcode packet length in the formatter

Chris Mullins 8 yıl önce
ebeveyn
işleme
4e6c062286

+ 2 - 2
lib/MiLight/CctPacketFormatter.h

@@ -7,8 +7,8 @@
 
 class CctPacketFormatter : public PacketFormatter {
 public:
-  CctPacketFormatter(size_t packetLength)
-    : PacketFormatter(packetLength)
+  CctPacketFormatter()
+    : PacketFormatter(7)
   { }
   
   virtual void updateStatus(MiLightStatus status, uint8_t groupId);

+ 3 - 3
lib/MiLight/MiLightRadioConfig.h

@@ -46,15 +46,15 @@ public:
 };
 
 static MiLightRadioConfig MilightRgbwConfig(
-  0x147A, 0x258B, new RgbwPacketFormatter(8), RGBW, "rgbw", 9, 40, 71
+  0x147A, 0x258B, new RgbwPacketFormatter(), RGBW, "rgbw", 9, 40, 71
 );
 
 static MiLightRadioConfig MilightCctConfig(
-  0x050A, 0x55AA, new CctPacketFormatter(8), CCT, "cct", 4, 39, 74
+  0x050A, 0x55AA, new CctPacketFormatter(), CCT, "cct", 4, 39, 74
 );
 
 static MiLightRadioConfig MilightRgbCctConfig(
-  0x7236, 0x1809, new RgbCctPacketFormatter(9), RGB_CCT, "rgb_cct", 8, 39, 70
+  0x7236, 0x1809, new RgbCctPacketFormatter(), RGB_CCT, "rgb_cct", 8, 39, 70
 );
 
 #endif

+ 2 - 2
lib/MiLight/RgbCctPacketFormatter.h

@@ -11,8 +11,8 @@ class RgbCctPacketFormatter : public PacketFormatter {
 public:
   static uint8_t const V2_OFFSETS[][4];
     
-  RgbCctPacketFormatter(size_t packetLength)
-    : PacketFormatter(packetLength)
+  RgbCctPacketFormatter()
+    : PacketFormatter(9)
   { }
   
   virtual void reset();

+ 2 - 2
lib/MiLight/RgbwPacketFormatter.h

@@ -9,8 +9,8 @@
 
 class RgbwPacketFormatter : public PacketFormatter {
 public:
-  RgbwPacketFormatter(size_t packetLength)
-    : PacketFormatter(packetLength)
+  RgbwPacketFormatter()
+    : PacketFormatter(7)
   { }
   
   virtual void updateStatus(MiLightStatus status, uint8_t groupId);