[fprint] Adding new driver

Patrick Marlier patrick.marlier at gmail.com
Wed Jan 25 10:31:37 PST 2012


On 01/24/2012 01:31 PM, MOGANESHWARAN RAJASEGARAN wrote:
> Thank you for the guide in creating the unified diff. I hope this is
> correct.

The diff seems ok (weird http://?) and thanks for sharing your work and 
contributing.

Main general concerns from my point of view (even if I am not either the 
owner of such device and either a libfprint developer): our driver is 
based on upektc which is obsolete AFAIU and make your driver obsolete 
too... Did you manage to get it work with the current libfprint (0.4)?

libfprint maintainers/developers, do not hesitate to correct me if I am 
wrong.

I don't know a lot of libfprint/libusb but some comments are inlined 
(mainly related to obsolete functions):

> @@ -102,6 +108,7 @@ done
>   AM_CONDITIONAL([ENABLE_UPEKTS], [test "$enable_upekts" = "yes"])
>   AM_CONDITIONAL([ENABLE_UPEKE2], [test "$enable_upeke2" = "yes"])
>   #AM_CONDITIONAL([ENABLE_UPEKTC], [test "$enable_upektc" = "yes"])
> +#AM_CONDITIONAL([ENABLE_UPEKET], [test "$enable_upeket" = "yes"])

Why there is a # here? you don't want your driver to be enabled?

>   AM_CONDITIONAL([ENABLE_UPEKSONLY], [test "$enable_upeksonly" = "yes"])
>   AM_CONDITIONAL([ENABLE_VCOM5S], [test "$enable_vcom5s" = "yes"])
>   AM_CONDITIONAL([ENABLE_URU4000], [test "$enable_uru4000" = "yes"])

> @@ -100,6 +102,10 @@ endif
>   #DRIVER_SRC += $(UPEKTC_SRC)
>   #endif
> +#if ENABLE_UPEKET
> +#DRIVER_SRC += $(UPEKET_SRC)

Again here?

> +#endif
> +
>   if ENABLE_URU4000
>   DRIVER_SRC += $(URU4000_SRC)
>   endif
> diff --git a/libfprint/drivers/upeket.c b/libfprint/drivers/upeket.c
> new file mode 100644
> index 0000000..e5c12d2
> --- /dev/null
> +++ b/libfprint/drivers/upeket.c
> @@ -0,0 +1,720 @@
> +/*
> + * Copyright (C) 2012 Moganeshwaran Rajasegaran
> <moganeshwaran at gmail.com <mailto:moganeshwaran at gmail.com>>
> + * UPEK EikonTouch300 driver for libfprint
> +
> + * Heavily based on UPEK TouchChip driver for libfprint
> + * Copyright (C) 2007 Jan-Michael Brummer <buzz2 at gmx.de
> <mailto:buzz2 at gmx.de>>
> + *
> + * This library is free software; you can redistribute it and/or
> + * modify it under the terms of the GNU Lesser General Public
> + * License as published by the Free Software Foundation; either
> + * version 2.1 of the License, or (at your option) any later version.
> + *
> + * This library is distributed in the hope that it will be useful,
> + * but WITHOUT ANY WARRANTY; without even the implied warranty of
> + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
> + * Lesser General Public License for more details.
> + *
> + * You should have received a copy of the GNU Lesser General Public
> + * License along with this library; if not, write to the Free Software
> + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
> 02110-1301 USA
> + */
> +
> +#define FP_COMPONENT "upeket"
> +
> +#include <errno.h>
> +#include <string.h>
> +
> +#include <glib.h>
> +#include <usb.h>

usb.h ? which version of libusb do you use? I pretty sure it should be 
libusb.h

> +
> +#include <fp_internal.h>
> +
> +#define SENSOR_FULL_IMAGE59904
> +#define WAIT_COUNT5
> +
> +typedef char sint8;
> +typedef unsigned char uint8;
> +typedef int sint32;
> +typedef unsigned int uint32;
> +
> +/** scan command */
> +static const unsigned char anScanCommand[ 0x40 ] = {
> +0x0e, 0x00, 0x03, 0xa8, 0x00, 0xb6, 0xbb, 0xbb,
> +0xb8, 0xb7, 0xb8, 0xb5, 0xb8, 0xb9, 0xb8, 0xb9,
> +0xbb, 0xbb, 0xbe, 0xbb, 0x4e, 0x16, 0xf4, 0x77,
> +0xa8, 0x07, 0x32, 0x00, 0x6a, 0x16, 0xf4, 0x77,
> +0x78, 0x24, 0x61, 0x00, 0xc8, 0x00, 0xec, 0x00,
> +0x01, 0x00, 0x00, 0x00, 0x3c, 0xf3, 0x2f, 0x01,
> +0x05, 0x90, 0xf6, 0x77, 0x84, 0xf5, 0x2f, 0x01,
> +0x05, 0x90, 0xf6, 0x00, 0xc8, 0x00, 0xec, 0x00
> +};
> +
> +
> +/**
> + * \brief Common interaktion routine for the sensor device
> + * \param dev fingerprint image device pointer
> + * \param pnRawString raw data string
> + * \param nLen length we want to read, if 0 do not read at all
> + * \param pnBuffer buffer pointer we want to store the read buffer
> + * \return error code
> + */
> +static sint32 askScanner( struct fp_img_dev *dev, const unsigned char
> *pnRawString, sint32 nLen, sint8 *pnBuffer ) {
> +    sint8 anBuf[ 65535 ];
> +sint32 nRet;
> +int transferred;
> +struct libusb_bulk_transfer msg1 = {
> +.endpoint = 2,
> +.data = pnRawString,
> +.length = 0x40,
> +};
> +struct libusb_bulk_transfer msg2 = {
> +.endpoint = 0x81,
> +.data = anBuf,
> +.length = nLen,
> +};
> +
> +nRet = libusb_bulk_transfer(dev->udev, &msg1, &transferred, 1003);

Humm.. Seems a odd libusb version. The definition I have is this one for 
libusb 1.0 (AFAIK current version used in libfprint):

int libusb_bulk_transfer (struct libusb_device_handle *dev_handle, 
unsigned char endpoint, unsigned char *data, int length, int 
*transferred, unsigned int timeout)

--
Patrick Marlier.


More information about the fprint mailing list