]> gitweb.hhaalo.de Git - sane-kds-s2000w-net.git/commitdiff
linking curl
authorBastian Dehn <hhaalo@arcor.de>
Sat, 20 Jan 2024 19:39:33 +0000 (20:39 +0100)
committerBastian Dehn <hhaalo@arcor.de>
Sat, 20 Jan 2024 19:39:33 +0000 (20:39 +0100)
CMakeLists.txt
src/kds_s2000w_handler.c
src/kds_s2000w_net.c

index 04b2c39cb7908ef66635ff4a8876b5d4686fecff..0a2063f05ffe850b964b1d8c2770cf492908c5d9 100644 (file)
@@ -11,5 +11,7 @@ add_library("sane-kds_s2000w_net"
        "src/kds_s2000w_handler.c")
 set_target_properties("sane-kds_s2000w_net" PROPERTIES VERSION 1)
 
+target_link_libraries("sane-kds_s2000w_net" curl)
+
 install(TARGETS "sane-kds_s2000w_net"
        DESTINATION "/usr/lib/x86_64-linux-gnu/sane")
\ No newline at end of file
index b9d66ccda9d5f04be47835bd4088b12b29084cdb..b043fdf6a0ac99d9ab9d9689593a5e7d61f5933a 100644 (file)
@@ -1,7 +1,17 @@
+#include <stdio.h>
 #include <stddef.h>
+#include <curl/curl.h>
 #include "kds_s2000w_handler.h"
 
 void* kds_s2000w_handler_open()
 {
+       printf("open\n");
+       CURL *curl = curl_easy_init();
+       if(curl) {
+               CURLcode res;
+               curl_easy_setopt(curl, CURLOPT_URL, "https://scanner.lan.hhaalo.de");
+               res = curl_easy_perform(curl);
+               curl_easy_cleanup(curl);
+       }
        return NULL;
 }
\ No newline at end of file
index f7b21f583e2744612450a64914d7cde75b574888..224c07900ff799121c655a35c720ebc27412eebc 100644 (file)
@@ -39,6 +39,7 @@ SANE_Status _sane_kds_s2000w_net_open(SANE_String_Const devicename,
        if (strcmp(devicename, "kds_s2000w_net") != 0) {
                return SANE_STATUS_INVAL;
        }
+       kds_s2000w_handler_open();
 
        return SANE_STATUS_UNSUPPORTED;
 }