#define SPACE 0x0a
-int _kds_s2000w_handler_find_first_data_byte(imagedata* image)
+uint32_t _kds_s2000w_handler_find_first_data_byte(imagedata* image)
{
kds_s2000w_debug_printf(ALL, "sane_kds_s2000w_net_find_first_data_byte");
char* data = image->data;
- int header_spaces = 3;
+ uint8_t header_spaces = 3;
if (strncmp(data, "P4", 2) == 0)
header_spaces = 2;
- int space_count = 0;
- int byte_count = 0;
+ uint32_t space_count = 0;
+ uint32_t byte_count = 0;
for (byte_count = 0; byte_count < image->size; byte_count++) {
if (data[byte_count] == SPACE)
space_count++;
// status code 408 waking up repeat open session
response* resp = NULL;
- int result = 0;
- for (int i = 0; i < 30; i++) {
+ uint8_t result = 0;
+ for (uint32_t i = 0; i < 30; i++) {
kds_s2000w_client_response_free(resp);
resp = NULL;
resp = kds_s2000w_client_response_init();
blobdata* image = (blobdata*) h->image;
blobdata* scanner_image = malloc(sizeof(blobdata));
- int channels = 1;
+ uint8_t channels = 1;
scanner_image->data = malloc(sizeof(char) * image->size);
scanner_image->size = image->size;
#ifndef KDS_S2000W_HANDLER_H
#define KDS_S2000W_HANDLER_H
+#include <stdint.h>
#include <json-c/json.h>
enum {
} imagedata;
typedef struct {
- int format;
- int last_frame;
- int bytes_per_line;
- int pixels_per_line;
- int lines;
- int depth;
+ uint32_t format;
+ uint32_t last_frame;
+ uint32_t bytes_per_line;
+ uint32_t pixels_per_line;
+ uint32_t lines;
+ uint32_t depth;
} metadata;
typedef struct {
- int current_image_number;
- int available_images;
- int downloaded_images;
- int complete_scanned;
- int feeder;
+ uint8_t current_image_number;
+ uint8_t available_images;
+ uint8_t downloaded_images;
+ uint8_t complete_scanned;
+ uint8_t feeder;
} scanstatus;
typedef struct {
- int scan_started;
- int cancel;
- int read_size;
+ uint8_t scan_started;
+ uint8_t cancel;
+ uint64_t read_size;
} readinfo;
typedef struct {
- long sessionid;
- int state;
+ uint64_t sessionid;
+ uint8_t state;
json_object* current_scanner_config;
scanstatus* current_scan_status;
readinfo* read_info;