diff --git a/rpc/main.c b/rpc/main.c new file mode 100644 index 0000000..9d2dfbc --- /dev/null +++ b/rpc/main.c @@ -0,0 +1,35 @@ +#include +#include +#include +#include +#include + +//gcc -lsane -L/usr/lib/arm-linux-gnueabihf/ -I/usr/include main.c + +int main (int argc, char **argv) { + SANE_Status status; + SANE_Int version_code; + SANE_Auth_Callback authorize; + SANE_Handle h; + const SANE_Device **device_list; + + status = sane_init(NULL, NULL); + if(status != SANE_STATUS_GOOD) { + perror("sane did not start"); + exit(EXIT_FAILURE); + } + + status = sane_get_devices(&device_list, SANE_TRUE); + if(status != SANE_STATUS_GOOD) { + perror("sane_get_devices, was apparently GOOD"); + } + printf("%s, %s, %s, %s\n", + device_list[0]->name, + device_list[0]->vendor, + device_list[0]->model, + device_list[0]->type); + + printf("exiting sane... \n"); + sane_exit(); + exit(EXIT_SUCCESS); +}