Home Contents | # spfinger:send | Finger | Core4 Lua Event System

## SYNOPSIS

1. fgrhandle:send(cmd[, param[, size[, flag[, data]]]])
2. fgrhandle:sendTo(addr, cmd[, param[, size[, flag[, data]]]])
3. fgrhandle:sendRaw(header[, data])

## DESCRIPTION

Sends a message to the fingerprint scanner. The first form uses the 'Packet Protocol' without networking, the second form uses 'Network Packet Protocol'. The third form allows sending an arbitrary header.

The parameter addr contains the Terminal ID used for the 'Network Packet Protocol'. Allowable range is 1...0xFFFF.

The parameters cmd, param, size and flag are directly put into the corresponding header fields.

The parameter data is sent as data after the header.

When sending raw packets, the string header must contain a valid header without the checksum. Therefore, a normal header is 11 bytes, a networked header is 13 bytes. The checksum will be added automatically.

## RETURN VALUE

On success, returns true. On failure returns three values: nil, the name of the error and the numeric error code. Please see spfinger:lastError for a description of error codes.

## NOTES

The message is sent out immediately. Any response is received within the event loop and reported with callbacks.

## EXAMPLE

Ask for a an image scan.
>
fgr:send(0x83, 0, 4096)

## SEE ALSO

spfinger:lastError