Przeglądaj źródła

add v6 server skeleton

Chris Mullins 8 lat temu
rodzic
commit
05c22fd88a

+ 1 - 1
lib/Udp/MiLightUdpServer.h

@@ -5,7 +5,7 @@
 // This protocol is documented here:
 // http://www.limitlessled.com/dev/
 
-#define MILIGHT_PACKET_BUFFER_SIZE 10
+#define MILIGHT_PACKET_BUFFER_SIZE 30 
 
 // Uncomment to enable Serial printing of packets
 //#define MILIGHT_UDP_DEBUG

+ 0 - 3
lib/Udp/V5MiLightUdpServer.h

@@ -9,9 +9,6 @@
 #ifndef _V5_MILIGHT_UDP_SERVER
 #define _V5_MILIGHT_UDP_SERVER 
 
-// Uncomment to enable Serial printing of packets
-//#define MILIGHT_UDP_DEBUG
-
 enum MiLightUdpCommands {
   UDP_CCT_GROUP_1_ON         = 0x38,
   UDP_CCT_GROUP_1_OFF        = 0x3B,

+ 5 - 0
lib/Udp/V6MiLightUdpServer.cpp

@@ -0,0 +1,5 @@
+#include <V6MiLightUdpServer.h>
+
+size_t V6MiLightUdpServer::handlePacket(uint8_t* packet, size_t packetSize, uint8_t* responseBuffer) {
+  
+}

+ 24 - 0
lib/Udp/V6MiLightUdpServer.h

@@ -0,0 +1,24 @@
+// This protocol is documented here:
+// http://www.limitlessled.com/dev/
+
+#include <Arduino.h>
+#include <MiLightClient.h>
+#include <WiFiUdp.h>
+#include <MiLightUdpServer.h>
+
+#ifndef _V6_MILIGHT_UDP_SERVER
+#define _V6_MILIGHT_UDP_SERVER 
+
+class V6MiLightUdpServer : public MiLightUdpServer {
+public:
+  V6MiLightUdpServer(MiLightClient*& client, uint16_t port, uint16_t deviceId)
+    : MiLightUdpServer(client, port, deviceId)
+  { }
+  
+  // Should return size of the response packet
+  virtual size_t handlePacket(uint8_t* packet, size_t packetSize, uint8_t* responseBuffer);
+    
+protected:
+};
+
+#endif