36 lines
918 B
C
36 lines
918 B
C
#include <unistd.h>
|
|
#include <stdio.h>
|
|
#include <stdlib.h>
|
|
#include <stdbool.h>
|
|
#include <sane/sane.h>
|
|
|
|
//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);
|
|
}
|