Jun Furutani / libMiMic

Fork of libMiMic by Ryo Iizuka

Revision:
17:f29e1ca90e3d
Parent:
3:0a94993be1f6
Child:
19:33b9ba0859ee
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed/Httpd.cpp	Fri Apr 26 05:26:34 2013 +0000
@@ -0,0 +1,24 @@
+#include "Httpd.h"
+#include "HttpdConnection.h"
+namespace MiMic
+{
+    void Httpd::onRequestHandler(NyLPC_TcHttpdConnection_t* i_connection)
+    {
+        HttpdConnection c(i_connection);
+        ((struct Httpd2*)(i_connection->_parent_httpd))->_parent->onRequest(c);
+    }
+    Httpd::Httpd(int i_port_number)
+    {
+        NyLPC_cHttpd_initialize((NyLPC_TcHttpd_t*)(&this->_inst),(NyLPC_TUInt16)i_port_number);
+        this->_inst._parent=this;
+        this->_inst.super.function.onRequest=onRequestHandler;
+    }
+    Httpd::~Httpd()
+    {
+        NyLPC_cHttpd_finalize((NyLPC_TcHttpd_t*)(&this->_inst));
+    }
+    void Httpd::loop()
+    {
+        NyLPC_cHttpd_loop((NyLPC_TcHttpd_t*)(&this->_inst));
+    }
+}
\ No newline at end of file