refactoring (in progress, tbf)
[src/app-framework-binder.git] / plugins / samples / HelloWorld.c
index 5638b42..6c2d0cf 100644 (file)
@@ -20,7 +20,7 @@
 #include "local-def.h"
 
 STATIC json_object* pingSample (AFB_request *request) {
-    static pingcount = 0;
+    static int pingcount = 0;
     json_object *response;
     char query [512];
     int len;
@@ -29,11 +29,8 @@ STATIC json_object* pingSample (AFB_request *request) {
     len = getQueryAll (request, query, sizeof(query));
     if (len == 0) strcpy (query,"NoSearchQueryList");
     
-    // check if we have some post data
-    if (request->post == NULL)  request->post->data="NoData";  
-        
     // return response to caller
-    response = jsonNewMessage(AFB_SUCCESS, "Ping Binder Daemon %d query={%s} PostData: \'%s\' ", pingcount++, query, request->post);
+    response = jsonNewMessage(AFB_SUCCESS, "Ping Binder Daemon %d query={%s}", pingcount++, query);
     
     if (verbose) fprintf(stderr, "%d: \n", pingcount);
     return (response);
@@ -57,7 +54,7 @@ STATIC json_object* pingBug (AFB_request *request) {
 
 
 // For samples https://linuxprograms.wordpress.com/2010/05/20/json-c-libjson-tutorial/
-STATIC json_object* pingJson (AFB_session *session, AFB_request *request) {
+STATIC json_object* pingJson (AFB_request *request) {
     json_object *jresp, *embed;    
     
     jresp = json_object_new_object();
@@ -87,8 +84,8 @@ STATIC  AFB_restapi pluginApis[]= {
 PUBLIC AFB_plugin *pluginRegister () {
     AFB_plugin *plugin = malloc (sizeof (AFB_plugin));
     plugin->type  = AFB_PLUGIN_JSON;
-    plugin->info  = "Application Framework Binder Service";
-    plugin->prefix= "dbus";        
+    plugin->info  = "Minimal Hello World Sample";
+    plugin->prefix= "hello";
     plugin->apis  = pluginApis;
     return (plugin);
 };