Line | Branch | Exec | Source |
---|---|---|---|
1 | /* | ||
2 | * AuthenTec AES1660 driver for libfprint | ||
3 | * Copyright (C) 2012 Vasily Khoruzhick | ||
4 | * | ||
5 | * This library is free software; you can redistribute it and/or | ||
6 | * modify it under the terms of the GNU Lesser General Public | ||
7 | * License as published by the Free Software Foundation; either | ||
8 | * version 2.1 of the License, or (at your option) any later version. | ||
9 | * | ||
10 | * This library is distributed in the hope that it will be useful, | ||
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
13 | * Lesser General Public License for more details. | ||
14 | * | ||
15 | * You should have received a copy of the GNU Lesser General Public | ||
16 | * License along with this library; if not, write to the Free Software | ||
17 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA | ||
18 | */ | ||
19 | |||
20 | #define FP_COMPONENT "aes1660" | ||
21 | |||
22 | #include "drivers_api.h" | ||
23 | #include "aeslib.h" | ||
24 | #include "aesx660.h" | ||
25 | #include "aes1660.h" | ||
26 | |||
27 | #define FRAME_WIDTH 128 | ||
28 | #define IMAGE_WIDTH (FRAME_WIDTH + (FRAME_WIDTH / 2)) | ||
29 | |||
30 | struct _FpiDeviceAes1660 | ||
31 | { | ||
32 | FpiDeviceAesX660 parent; | ||
33 | }; | ||
34 | G_DECLARE_FINAL_TYPE (FpiDeviceAes1660, fpi_device_aes1660, FPI, | ||
35 | DEVICE_AES1660, FpiDeviceAesX660); | ||
36 |
4/5✓ Branch 0 taken 120 times.
✓ Branch 1 taken 24 times.
✓ Branch 2 taken 120 times.
✓ Branch 3 taken 120 times.
✗ Branch 4 not taken.
|
768 | G_DEFINE_TYPE (FpiDeviceAes1660, fpi_device_aes1660, FPI_TYPE_DEVICE_AES_X660); |
37 | |||
38 | static struct fpi_frame_asmbl_ctx assembling_ctx = { | ||
39 | .frame_width = FRAME_WIDTH, | ||
40 | .frame_height = AESX660_FRAME_HEIGHT, | ||
41 | .image_width = IMAGE_WIDTH, | ||
42 | .get_pixel = aes_get_pixel, | ||
43 | }; | ||
44 | |||
45 | static const FpIdEntry id_table[] = { | ||
46 | { .vid = 0x08ff, .pid = 0x1660, }, | ||
47 | { .vid = 0x08ff, .pid = 0x1680, }, | ||
48 | { .vid = 0x08ff, .pid = 0x1681, }, | ||
49 | { .vid = 0x08ff, .pid = 0x1682, }, | ||
50 | { .vid = 0x08ff, .pid = 0x1683, }, | ||
51 | { .vid = 0x08ff, .pid = 0x1684, }, | ||
52 | { .vid = 0x08ff, .pid = 0x1685, }, | ||
53 | { .vid = 0x08ff, .pid = 0x1686, }, | ||
54 | { .vid = 0x08ff, .pid = 0x1687, }, | ||
55 | { .vid = 0x08ff, .pid = 0x1688, }, | ||
56 | { .vid = 0x08ff, .pid = 0x1689, }, | ||
57 | { .vid = 0x08ff, .pid = 0x168a, }, | ||
58 | { .vid = 0x08ff, .pid = 0x168b, }, | ||
59 | { .vid = 0x08ff, .pid = 0x168c, }, | ||
60 | { .vid = 0x08ff, .pid = 0x168d, }, | ||
61 | { .vid = 0x08ff, .pid = 0x168e, }, | ||
62 | { .vid = 0x08ff, .pid = 0x168f, }, | ||
63 | { .vid = 0, .pid = 0, .driver_data = 0 }, | ||
64 | }; | ||
65 | |||
66 | static void | ||
67 | ✗ | fpi_device_aes1660_init (FpiDeviceAes1660 *self) | |
68 | { | ||
69 | ✗ | } | |
70 | static void | ||
71 | 120 | fpi_device_aes1660_class_init (FpiDeviceAes1660Class *klass) | |
72 | { | ||
73 | 120 | FpDeviceClass *dev_class = FP_DEVICE_CLASS (klass); | |
74 | 120 | FpImageDeviceClass *img_class = FP_IMAGE_DEVICE_CLASS (klass); | |
75 | 120 | FpiDeviceAesX660Class *aes_class = FPI_DEVICE_AES_X660_CLASS (klass); | |
76 | |||
77 | 120 | dev_class->id = "aes1660"; | |
78 | 120 | dev_class->full_name = "AuthenTec AES1660"; | |
79 | 120 | dev_class->type = FP_DEVICE_TYPE_USB; | |
80 | 120 | dev_class->id_table = id_table; | |
81 | 120 | dev_class->scan_type = FP_SCAN_TYPE_SWIPE; | |
82 | |||
83 | 120 | img_class->bz3_threshold = 20; | |
84 | |||
85 | 120 | img_class->img_width = FRAME_WIDTH + FRAME_WIDTH / 2; | |
86 | 120 | img_class->img_height = -1; | |
87 | |||
88 | 120 | aes_class->init_seqs[0] = aes1660_init_1; | |
89 | 120 | aes_class->init_seqs_len[0] = G_N_ELEMENTS (aes1660_init_1); | |
90 | 120 | aes_class->init_seqs[1] = aes1660_init_2; | |
91 | 120 | aes_class->init_seqs_len[1] = G_N_ELEMENTS (aes1660_init_2); | |
92 | 120 | aes_class->start_imaging_cmd = (unsigned char *) aes1660_start_imaging_cmd; | |
93 | 120 | aes_class->start_imaging_cmd_len = sizeof (aes1660_start_imaging_cmd); | |
94 | 120 | aes_class->assembling_ctx = &assembling_ctx; | |
95 | } | ||
96 |