aboutsummaryrefslogtreecommitdiff
path: root/libraries/WiFi/utility/server_drv.h
diff options
context:
space:
mode:
authorCristian Maglie <c.maglie@bug.st>2012-10-22 09:17:24 +0200
committerCristian Maglie <c.maglie@bug.st>2012-10-22 09:17:24 +0200
commite03133b1b43fd445d3ed79a83d12786ef351cd35 (patch)
treeb8c10307727d0cb1571b1eb139f2f98537e29995 /libraries/WiFi/utility/server_drv.h
parent46d658fac872f7aa8856c792b1744b74f2d9946d (diff)
Moved WiFi library in the proper place
Diffstat (limited to 'libraries/WiFi/utility/server_drv.h')
-rw-r--r--libraries/WiFi/utility/server_drv.h34
1 files changed, 34 insertions, 0 deletions
diff --git a/libraries/WiFi/utility/server_drv.h b/libraries/WiFi/utility/server_drv.h
new file mode 100644
index 0000000..69ba593
--- /dev/null
+++ b/libraries/WiFi/utility/server_drv.h
@@ -0,0 +1,34 @@
+#ifndef Server_Drv_h
+#define Server_Drv_h
+
+#include <inttypes.h>
+#include "wifi_spi.h"
+
+class ServerDrv
+{
+public:
+ // Start server TCP on port specified
+ static void startServer(uint16_t port, uint8_t sock);
+
+ static void startClient(uint32_t ipAddress, uint16_t port, uint8_t sock);
+
+ static void stopClient(uint8_t sock);
+
+ static uint8_t getServerState(uint8_t sock);
+
+ static uint8_t getClientState(uint8_t sock);
+
+ static bool getData(uint8_t sock, uint8_t *data, uint8_t peek = 0);
+
+ static bool getDataBuf(uint8_t sock, uint8_t *data, uint16_t *len);
+
+ static bool sendData(uint8_t sock, const uint8_t *data, uint16_t len);
+
+ static uint8_t availData(uint8_t sock);
+
+ static uint8_t checkDataSent(uint8_t sock);
+};
+
+extern ServerDrv serverDrv;
+
+#endif