return;
}
- printf("DEBUG response: \n%s\n", resp->data);
+
json_object* value_object = NULL;
int value_length = 0;
const char* string_value = NULL;
int_value_ptr = (int*) value;
int_value = json_object_object_length(config);
printf("option number count: %i\n", int_value);
- *int_value_ptr = 9;
+ *int_value_ptr = 10;
break;
case 1:
value_object = json_object_object_get(config, "DPI");
value_object = json_object_object_get(config, "ScanSide");
string_value = json_object_get_string(value_object);
char_value = (char*) value;
- value_length = strlen(char_value);
+ value_length = strlen(string_value) + 1;
memcpy(char_value, string_value, sizeof(char) * value_length);
break;
case 3:
value_object = json_object_object_get(config, "ColorMode");
string_value = json_object_get_string(value_object);
char_value = (char*) value;
- value_length = strlen(char_value);
+ value_length = strlen(string_value) + 1;
memcpy(char_value, string_value, sizeof(char) * value_length);
break;
case 4:
value_object = json_object_object_get(config, "ColorDropOut");
string_value = json_object_get_string(value_object);
char_value = (char*) value;
- value_length = strlen(char_value);
+ value_length = strlen(string_value) + 1;
memcpy(char_value, string_value, sizeof(char) * value_length);
break;
case 7:
value_object = json_object_object_get(config, "OutputType");
string_value = json_object_get_string(value_object);
char_value = (char*) value;
- value_length = strlen(char_value);
+ value_length = strlen(string_value) + 1;
+ memcpy(char_value, string_value, sizeof(char) * value_length);
+ break;
+ case 9:
+ printf("DEBUG response: \n%s\n", resp->data);
+ value_object = json_object_object_get(config, "ColorAutoBrightnessMode");
+ string_value = json_object_get_string(value_object);
+ printf("DEBUG value: %s\n", string_value);
+ char_value = (char*) value;
+ value_length = strlen(string_value) + 1;
memcpy(char_value, string_value, sizeof(char) * value_length);
break;
default:
option_descriptor_array.option_descriptors[option]->constraint_type = SANE_CONSTRAINT_NONE;
option_descriptor_array.option_descriptors[option]->constraint.string_list = NULL;
break;
+ case 9:
+ free(option_descriptor_array.option_descriptors[option]);
+ option_descriptor_array.option_descriptors[option] = NULL;
+ option_descriptor_array.option_descriptors[option] = malloc(sizeof(SANE_Option_Descriptor));
+ option_descriptor_array.option_descriptors[option]->name = "colorautobrightnessmode";
+ option_descriptor_array.option_descriptors[option]->title = "colorautobrightnessmode";
+ option_descriptor_array.option_descriptors[option]->desc = "colorautobrightnessmode";
+ option_descriptor_array.option_descriptors[option]->cap = SANE_CAP_SOFT_DETECT;
+ option_descriptor_array.option_descriptors[option]->constraint_type = SANE_CONSTRAINT_NONE;
+ option_descriptor_array.option_descriptors[option]->constraint.string_list = NULL;
+ break;
default:
return NULL;
break;
case 3:
case 6:
case 8:
+ case 9:
option_descriptor_array.option_descriptors[option]->type = SANE_TYPE_STRING;
option_descriptor_array.option_descriptors[option]->unit = SANE_UNIT_NONE;
option_descriptor_array.option_descriptors[option]->size = sizeof(SANE_String) * 50;