Griaule Biometrics

Home » Fingerprint SDK 2009 Developer's Manual » Programming Reference Guide » Fingerprint SDK DLL Reference Guide » Callback handlers » GRCAP_STATUS_EVENT_PROC

GRCAP_STATUS_EVENT_PROC

Callback function responsible for handling the status events. This callback function is called whenever a fingerprint reader is plugged in or unplugged from the computer.

Prerequisites The capture module must have been previously initialized.
At least one fingerprint reader must be connected and working.

Parameters

[in] idSensor

The ID of the fingerprint reader that raised the event.

[in] event

The event raised by the fingerprint reader:

  • GR_PLUG: the fingerprint reader was plugged into the computer;
  • GR_UNPLUG: the fingerprint reader was unplugged from the computer;

Declaration

C++

typedef void CALLBACK GRCAP_STATUS_EVENT_PROC(char* idSensor, GRCAP_STATUS_EVENTS event);

Delphi

GRCAP_STATUS_EVENT_PROC = Procedure(idSensor: Pchar; event: GRCAP_STATUS_EVENTS); stdcall;

Sample Code

C++

void StatusEventHandler(char* idSensor, GRCAP_STATUS_EVENTS event) {
// Signaling that a Status Event occurred.
WriteEvent(idSensor, event);
if (event == GR_PLUG) {
	// Start capturing from the plugged reader.
	GrCapStartCapture(idSensor, myFingerCallBack, myImageCallBack);
} else if (event == GR_UNPLUG) {
	// Stop capturing from the unplugged reader
	GrCapStopCapture(idSensor);
}
}

Delphi

Procedure StatusCallback(idSensor: Pchar; event: GRCAP_STATUS_EVENTS); stdcall;
begin
	// Signals that a status event occurred.
	WriteEvent(idSensor, event);
	// Checking if the event raised is a plug or unplug.
	if (event = GR_PLUG) then
		// Start capturing from the plugged reader.
		GrCapStartCapture(idSensor, @FingerCallback, @ImageCallback)
	else if (event = GR_UNPLUG) then
		// Stop capturing from the unplugged reader.
		GrCapStopCapture(idSensor);
end;