Jun Furutani / libMiMic

Fork of libMiMic by Ryo Iizuka

Revision:
48:00d211aac2ec
Child:
50:35e765380772
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed/mod/ModUPnPDevice.cpp	Wed Aug 07 13:53:02 2013 +0000
@@ -0,0 +1,45 @@
+#include <ModUPnPDevice.h>
+#include <NyLPC_net.h>
+#include <stdio.h>
+#include "mbed.h"
+   
+   
+namespace MiMic
+{  
+    ModUPnPDevice::ModUPnPDevice(const Net& i_ref_net)
+    {
+        setParam(i_ref_net);
+    }
+    ModUPnPDevice::ModUPnPDevice()
+    {
+    }
+    ModUPnPDevice::~ModUPnPDevice()
+    {
+    }
+    void ModUPnPDevice::setParam(const Net& i_ref_net)
+    {
+        ModBaseClass::setParam(i_ref_net.refUPnPInstance()!=NULL?i_ref_net.refUPnPInstance()->_ref_root_path:NULL);
+        this->_ref_upnp_inst=i_ref_net.refUPnPInstance();
+    }
+    bool ModUPnPDevice::execute(HttpdConnection& i_connection)
+    {
+        NyLPC_TcModUPnPDevice_t mod;
+
+        //check parametor
+        if(this->_path==NULL){
+            return false;
+        }
+        NyLPC_cModUPnPDevice_initialize(&mod,this->_ref_upnp_inst);
+        if(NyLPC_cModUPnPDevice_canHandle(&mod,i_connection._ref_inst)){
+            NyLPC_cModUPnPDevice_execute(&mod,i_connection._ref_inst);
+            NyLPC_cModUPnPDevice_finalize(&mod);
+            return true;
+        }
+        NyLPC_cModUPnPDevice_finalize(&mod);
+        return false;
+    }   
+   
+   
+    
+
+}
\ No newline at end of file