diff --git a/apps/aqhome-cgi/modules/0BUILD b/apps/aqhome-cgi/modules/0BUILD
index 79acadb..2cd35ae 100644
--- a/apps/aqhome-cgi/modules/0BUILD
+++ b/apps/aqhome-cgi/modules/0BUILD
@@ -49,17 +49,13 @@
- mservice.h
- mroot.h
mdataclient.h
mdevices.h
- madmin.h
- mmodules.h
+ mroot.h
- mservice_p.h
mroot_p.h
@@ -67,12 +63,9 @@
$(local/typefiles)
- mservice.c
- mroot.c
mdataclient.c
mdevices.c
- madmin.c
- mmodules.c
+ mroot.c
@@ -81,9 +74,11 @@
+ aqhcgi_modcom
+ common
static
diff --git a/apps/aqhome-cgi/modules/common/0BUILD b/apps/aqhome-cgi/modules/common/0BUILD
new file mode 100644
index 0000000..ff270a4
--- /dev/null
+++ b/apps/aqhome-cgi/modules/common/0BUILD
@@ -0,0 +1,84 @@
+
+
+
+
+
+
+
+ $(gwenhywfar_cflags)
+ -I$(topsrcdir)
+ -I$(topbuilddir)
+ -I$(topsrcdir)/apps
+ -I$(topbuilddir)/apps
+ -I$(builddir)
+ -I$(srcdir)
+
+
+
+ --include=$(builddir)
+ --include=$(srcdir)
+
+
+
+
+
+ $(visibility_cflags)
+
+
+
+ --api=AQHOME_API
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ $(local/built_headers_pub)
+
+
+
+
+ mservice.h
+ madmin.h
+ mmodules.h
+
+
+
+
+ mservice_p.h
+
+
+
+
+ $(local/typefiles)
+
+ mservice.c
+ madmin.c
+ mmodules.c
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/apps/aqhome-cgi/modules/madmin.c b/apps/aqhome-cgi/modules/common/madmin.c
similarity index 99%
rename from apps/aqhome-cgi/modules/madmin.c
rename to apps/aqhome-cgi/modules/common/madmin.c
index 0d123e4..e5d7d50 100644
--- a/apps/aqhome-cgi/modules/madmin.c
+++ b/apps/aqhome-cgi/modules/common/madmin.c
@@ -14,7 +14,7 @@
#include "./madmin.h"
#include "aqhome-cgi/service/module.h"
-#include "aqhome-cgi/modules/mmodules.h"
+#include "aqhome-cgi/modules/common/mmodules.h"
#include
#include
diff --git a/apps/aqhome-cgi/modules/madmin.h b/apps/aqhome-cgi/modules/common/madmin.h
similarity index 93%
rename from apps/aqhome-cgi/modules/madmin.h
rename to apps/aqhome-cgi/modules/common/madmin.h
index 1227936..64ed707 100644
--- a/apps/aqhome-cgi/modules/madmin.h
+++ b/apps/aqhome-cgi/modules/common/madmin.h
@@ -9,7 +9,7 @@
#ifndef AQHOME_CGI_MADMIN_H
#define AQHOME_CGI_MADMIN_H
-#include
+#include
#include
diff --git a/apps/aqhome-cgi/modules/mmodules.c b/apps/aqhome-cgi/modules/common/mmodules.c
similarity index 100%
rename from apps/aqhome-cgi/modules/mmodules.c
rename to apps/aqhome-cgi/modules/common/mmodules.c
diff --git a/apps/aqhome-cgi/modules/mmodules.h b/apps/aqhome-cgi/modules/common/mmodules.h
similarity index 94%
rename from apps/aqhome-cgi/modules/mmodules.h
rename to apps/aqhome-cgi/modules/common/mmodules.h
index fca173b..4933968 100644
--- a/apps/aqhome-cgi/modules/mmodules.h
+++ b/apps/aqhome-cgi/modules/common/mmodules.h
@@ -9,7 +9,7 @@
#ifndef AQHOME_CGI_MMODULES_H
#define AQHOME_CGI_MMODULES_H
-#include
+#include
#include
diff --git a/apps/aqhome-cgi/modules/mservice.c b/apps/aqhome-cgi/modules/common/mservice.c
similarity index 100%
rename from apps/aqhome-cgi/modules/mservice.c
rename to apps/aqhome-cgi/modules/common/mservice.c
diff --git a/apps/aqhome-cgi/modules/mservice.h b/apps/aqhome-cgi/modules/common/mservice.h
similarity index 100%
rename from apps/aqhome-cgi/modules/mservice.h
rename to apps/aqhome-cgi/modules/common/mservice.h
diff --git a/apps/aqhome-cgi/modules/mservice_p.h b/apps/aqhome-cgi/modules/common/mservice_p.h
similarity index 94%
rename from apps/aqhome-cgi/modules/mservice_p.h
rename to apps/aqhome-cgi/modules/common/mservice_p.h
index 14faba5..a794da2 100644
--- a/apps/aqhome-cgi/modules/mservice_p.h
+++ b/apps/aqhome-cgi/modules/common/mservice_p.h
@@ -9,7 +9,7 @@
#ifndef AQHOME_CGI_MSERVICE_P_H
#define AQHOME_CGI_MSERVICE_P_H
-#include "aqhome-cgi/modules/mservice.h"
+#include "aqhome-cgi/modules/common/mservice.h"
typedef struct AQH_MOD_SERVICE AQH_MOD_SERVICE;
diff --git a/apps/aqhome-cgi/modules/mdataclient.c b/apps/aqhome-cgi/modules/mdataclient.c
index 2a1408f..bd7457e 100644
--- a/apps/aqhome-cgi/modules/mdataclient.c
+++ b/apps/aqhome-cgi/modules/mdataclient.c
@@ -98,7 +98,7 @@ int AQH_ModDataClient_HandleRequest(AQH_MODULE *m, AQCGI_REQUEST *rq, AQH_SESSIO
AQH_Session_free(session);
AQH_Fini();
- return 0;
+ return AQCGI_SendResponse(rq);
}
diff --git a/apps/aqhome-cgi/modules/mdataclient.h b/apps/aqhome-cgi/modules/mdataclient.h
index 7ac5d82..f84322f 100644
--- a/apps/aqhome-cgi/modules/mdataclient.h
+++ b/apps/aqhome-cgi/modules/mdataclient.h
@@ -9,7 +9,7 @@
#ifndef AQHOME_CGI_MDATACLIENT_H
#define AQHOME_CGI_MDATACLIENT_H
-#include
+#include
#include
diff --git a/apps/aqhome-cgi/modules/mdevices.c b/apps/aqhome-cgi/modules/mdevices.c
index 3d70da1..3fbe51f 100644
--- a/apps/aqhome-cgi/modules/mdevices.c
+++ b/apps/aqhome-cgi/modules/mdevices.c
@@ -11,7 +11,6 @@
#endif
-#include "./mroot_p.h"
#include "./mdevices.h"
#include "aqhome-cgi/service/module.h"
@@ -172,6 +171,9 @@ void _runIndex(AQH_MODULE *m, AQCGI_REQUEST *rq, AQH_SESSION *session, AQH_DATAC
if (deviceList==NULL) {
DBG_ERROR(NULL, "No device received");
GWEN_Buffer_AppendString(dbuf, "Empty device list.");
+ GWEN_Buffer_AppendString(dbuf, "No devices.
");
+ AQCGI_Request_SetResponseCode(rq, 200);
+ AQCGI_Request_SetResponseText(rq, "Ok");
return;
}
diff --git a/apps/aqhome-cgi/modules/mdevices.h b/apps/aqhome-cgi/modules/mdevices.h
index acb819c..0c1205f 100644
--- a/apps/aqhome-cgi/modules/mdevices.h
+++ b/apps/aqhome-cgi/modules/mdevices.h
@@ -10,6 +10,8 @@
#define AQHOME_CGI_MODULES_DEVICES_H
+#include "aqhome-cgi/modules/mdataclient.h"
+
#include "aqhome/aqhome.h"
#include "aqhome/dataclient/client.h"
diff --git a/apps/aqhome-cgi/modules/mroot.c b/apps/aqhome-cgi/modules/mroot.c
index 57268fa..358aae5 100644
--- a/apps/aqhome-cgi/modules/mroot.c
+++ b/apps/aqhome-cgi/modules/mroot.c
@@ -15,7 +15,7 @@
#include "aqhome-cgi/service/module.h"
#include "aqhome-cgi/modules/mdevices.h"
-#include "aqhome-cgi/modules/madmin.h"
+#include "aqhome-cgi/modules/common/madmin.h"
#include
#include
diff --git a/apps/aqhome-cgi/modules/mroot.h b/apps/aqhome-cgi/modules/mroot.h
index 377a6fb..21a3551 100644
--- a/apps/aqhome-cgi/modules/mroot.h
+++ b/apps/aqhome-cgi/modules/mroot.h
@@ -9,7 +9,7 @@
#ifndef AQHOME_CGI_MROOT_H
#define AQHOME_CGI_MROOT_H
-#include
+#include
#include