]> gitweb.hhaalo.de Git - sane-kds-s2000w-net.git/commitdiff
add debug info for client
authorBastian Dehn <hhaalo@arcor.de>
Fri, 16 Feb 2024 16:59:44 +0000 (17:59 +0100)
committerBastian Dehn <hhaalo@arcor.de>
Fri, 16 Feb 2024 16:59:44 +0000 (17:59 +0100)
src/kds_s2000w_client.c

index 35c434d564295364d3f938e5709c309342c10207..3fb9de35b4a53c124a9f0b92331b7f93cfc9cb49 100644 (file)
@@ -2,9 +2,11 @@
 #include <stdlib.h>
 #include <curl/curl.h>
 #include "kds_s2000w_client.h"
+#include "kds_s2000w_debug.h"
 
 size_t _kds_s2000w_client_callback(char *ptr, size_t size, size_t nmemb, void *userdata)
 {
+       debug_printf(ALL, "kds_s2000w_client_callback");
        response* data = (response*) userdata;
 
        size_t fullsize = size * nmemb;
@@ -23,6 +25,7 @@ size_t _kds_s2000w_client_callback(char *ptr, size_t size, size_t nmemb, void *u
 
 response* kds_s2000w_client_response_init()
 {
+       debug_printf(ALL, "kds_s2000w_client_response_init");
        response* resp;
 
        resp = malloc(sizeof(response));
@@ -35,6 +38,7 @@ response* kds_s2000w_client_response_init()
 
 void kds_s2000w_client_response_free(response* response)
 {
+       debug_printf(ALL, "kds_s2000w_client_response_free");
        if (response == NULL)
                return;
 
@@ -46,6 +50,7 @@ void kds_s2000w_client_response_free(response* response)
 
 int kds_s2000w_client_open_session(const char* username, response* response)
 {
+       debug_printf(ALL, "kds_s2000w_client_open_session");
        CURL *curl = curl_easy_init();
        if(!curl)
                return CURLE_FAILED_INIT;
@@ -76,6 +81,7 @@ int kds_s2000w_client_open_session(const char* username, response* response)
 
 void kds_s2000w_client_close_session(int64_t sessionid)
 {
+       debug_printf(ALL, "kds_s2000w_client_close_session");
        CURL *curl = curl_easy_init();
        if(!curl)
                return;
@@ -97,6 +103,7 @@ void kds_s2000w_client_close_session(int64_t sessionid)
 
 int kds_s2000w_client_status_session(int64_t sessionid, response* response)
 {
+       debug_printf(ALL, "kds_s2000w_client_status_session");
        CURL *curl = curl_easy_init();
        if(!curl)
                return CURLE_FAILED_INIT;
@@ -128,6 +135,7 @@ int kds_s2000w_client_status_session(int64_t sessionid, response* response)
 
 int kds_s2000w_client_start_scan(int64_t sessionid, response* response)
 {
+       debug_printf(ALL, "kds_s2000w_client_start_scan");
        CURL *curl = curl_easy_init();
        if(!curl)
                return CURLE_FAILED_INIT;
@@ -160,6 +168,7 @@ int kds_s2000w_client_start_scan(int64_t sessionid, response* response)
 
 int kds_s2000w_client_stop_scan(int64_t sessionid, response* response)
 {
+       debug_printf(ALL, "kds_s2000w_client_stop_scan");
        CURL *curl = curl_easy_init();
        if(!curl)
                return CURLE_FAILED_INIT;
@@ -192,6 +201,7 @@ int kds_s2000w_client_stop_scan(int64_t sessionid, response* response)
 
 int kds_s2000w_client_get_metadata(int64_t sessionid, int img_number, response* response)
 {
+       debug_printf(ALL, "kds_s2000w_client_get_metadata");
        CURL *curl = curl_easy_init();
        if(!curl)
                return CURLE_FAILED_INIT;
@@ -226,6 +236,7 @@ int kds_s2000w_client_get_metadata(int64_t sessionid, int img_number, response*
 
 int kds_s2000w_client_get_image(int64_t sessionid, int img_number, response* response)
 {
+       debug_printf(ALL, "kds_s2000w_client_get_image");
        CURL *curl = curl_easy_init();
        if(!curl)
                return CURLE_FAILED_INIT;
@@ -260,6 +271,7 @@ int kds_s2000w_client_get_image(int64_t sessionid, int img_number, response* res
 
 int kds_s2000w_client_delete_image(int64_t sessionid, int img_number, response* response)
 {
+       debug_printf(ALL, "kds_s2000w_client_delete_image");
        CURL *curl = curl_easy_init();
        if(!curl)
                return CURLE_FAILED_INIT;
@@ -294,6 +306,7 @@ int kds_s2000w_client_delete_image(int64_t sessionid, int img_number, response*
 
 int kds_s2000w_client_get_capabilities(response* response)
 {
+       debug_printf(ALL, "kds_s2000w_client_get_capabilities");
        CURL *curl = curl_easy_init();
        if(!curl)
                return CURLE_FAILED_INIT;
@@ -320,6 +333,7 @@ int kds_s2000w_client_get_capabilities(response* response)
 
 int kds_s2000w_client_get_option(int64_t sessionid, response* response)
 {
+       debug_printf(ALL, "kds_s2000w_client_get_option");
        CURL *curl = curl_easy_init();
        if(!curl)
                return CURLE_FAILED_INIT;
@@ -351,6 +365,7 @@ int kds_s2000w_client_get_option(int64_t sessionid, response* response)
 
 int kds_s2000w_client_set_option(int64_t sessionid, response* response)
 {
+       debug_printf(ALL, "kds_s2000w_client_set_option");
        CURL *curl = curl_easy_init();
        if(!curl)
                return CURLE_FAILED_INIT;