Improve print_data structure and on-disk format

Drivers now have an ID number. These will be assigned by me and documented
on the wiki. 0 cannot be used.

Drivers now define a devtype for each device they initialise. This is to
cope with the situation where a driver can support varying devices where
their print data is incompatible (i.e. image scaling is totally changed).
This doesn't apply to any existing supported devices.

Print data no longer includes driver name, and includes driver ID instead.

Paths to saved print data now include driver ID and devtype, and no longer
include driver name.

APIs exposed for converting a print_data into a blob which can then
be loaded back again later. Useful for systems who don't want to use
my simple storage system (which is only aimed at a single user).

File format is now defined and will be documented on the wiki. The header
is larger as we can no longer rely on directory paths in all scenarios.

Print data compat check now checks devtype and driver ID.
This commit is contained in:
Daniel Drake
2007-10-28 22:02:04 +00:00
parent 4e5cfdf92a
commit 294f9ad447
10 changed files with 210 additions and 27 deletions

View File

@@ -210,6 +210,7 @@ static const struct usb_id id_table[] = {
struct fp_img_driver aes4000_driver = {
.driver = {
.id = 3,
.name = FP_COMPONENT,
.full_name = "AuthenTec AES4000",
.id_table = id_table,

View File

@@ -653,7 +653,7 @@ static int enroll(struct fp_dev *dev, gboolean initial,
}
fdata = fpi_print_data_new(dev, data_len - sizeof(scan_comp));
memcpy(fdata->buffer, data + sizeof(scan_comp), data_len - sizeof(scan_comp));
memcpy(fdata->data, data + sizeof(scan_comp), data_len - sizeof(scan_comp));
*_data = fdata;
comp_out:
g_free(data);
@@ -679,7 +679,7 @@ static int verify(struct fp_dev *dev, struct fp_print_data *print)
data = g_malloc(data_len);
memcpy(data, verify_hdr, sizeof(verify_hdr));
memcpy(data + sizeof(verify_hdr), print->buffer, print->length);
memcpy(data + sizeof(verify_hdr), print->data, print->length);
r = send_cmd28(dev, 0x03, data, data_len);
if (r < 0)
@@ -781,6 +781,7 @@ static const struct usb_id id_table[] = {
};
struct fp_driver upekts_driver = {
.id = 1,
.name = FP_COMPONENT,
.full_name = "UPEK TouchStrip",
.id_table = id_table,

View File

@@ -489,6 +489,7 @@ static const struct usb_id id_table[] = {
struct fp_img_driver uru4000_driver = {
.driver = {
.id = 2,
.name = FP_COMPONENT,
.full_name = "Digital Persona U.are.U 4000/4000B",
.id_table = id_table,