Home  Contents

spfinger.new

Finger Core4 Lua Event System

SYNOPSIS

  1. fgrhandle = spfinger.new(app, device [, speed])
  2. fgrhandle:close()

DESCRIPTION

Create a new fingerprint scanner handler. The handler is attached to the event processor passed in app. The scanner is connected to the serial port device. If the optional speed argument is missing, it defaults to 115200bps.

The spfinger:close() will close the serial device when no longer needed. The handle becomes invalid. This automatically happens during garbage collection, but that takes an unknown amount of time.

RETURN VALUE

On success, a handler instance. If opening the serial device fails, three values are returned: nil, a string describing the error (The result of the C library call strerror() on the errno code) and the errno number from the standard C library.

EXAMPLE

>  > 
app = event.new() rdr = spfinger.new(app, "/dev/ttyS4")