Grabba Driver for Android
Unified driver for Grabba devices on the Android operating system
FingerprintUserMessage Class Reference

Description

Class encapsulating fingerprint reader user message data.

This structure is used by FingerprintListener to deliver messages from the fingerprint reader to the user.

Thread safety:

  • Static functions: safe
  • Concurrent accesses to distinct objects: safe
  • Concurrent accesses to same object: unsafe, unless all accesses are read-only (i.e. property reads, Message())

Classes

enum  UserMessageID
 Enumeration of user messages which may be generated during fingerprint reader operations. More...
 

Public Member Functions

 FingerprintUserMessage ()
 Default constructor - null (empty) user message.
 
 FingerprintUserMessage (@NonNull UserMessageID initID, short initCount, short initTotal, @NonNull FingerprintUserRecord initUser)
 Construct a user message with given values. More...
 
 FingerprintUserMessage (@NonNull UserMessageID initID)
 Construct a user message, setting the ID to a given value and using default values for the other fields. More...
 
short count ()
 Query the message's count field. More...
 
UserMessageID ID ()
 Query the message's type ID. More...
 
String message ()
 
void setCount (short newCount)
 Set the message's count field. More...
 
void setID (@NonNull UserMessageID newID)
 Set the message's type ID. More...
 
void setTotal (short newTotal)
 Set the message's total field. More...
 
void setUser (@NonNull FingerprintUserRecord newUser)
 Set the message's user field. More...
 
short total ()
 Query the message's total field. More...
 
FingerprintUserRecord user ()
 Query the user field for this message. More...
 

Static Public Member Functions

static String message (@NonNull UserMessageID messageID)
 

Constructor & Destructor Documentation

◆ FingerprintUserMessage() [1/2]

FingerprintUserMessage ( @NonNull UserMessageID  initID,
short  initCount,
short  initTotal,
@NonNull FingerprintUserRecord  initUser 
)

Construct a user message with given values.

Parameters
initIDInitial message ID
initCountInitial count for message types which require one; valid range 0-255, and should be zero for message types which do not require an associated count (see count() for more details)
initTotalInitial total for message types which require one; valid range 0-255, and should be zero for message types which do not require an associated total (see total() for more details)
initUserInitial user record for message types which require one; should be set to a default-constructed user record otherwise (see user() for more details)
Exceptions
IllegalArgumentExceptionif the supplied count or total are out of range

◆ FingerprintUserMessage() [2/2]

FingerprintUserMessage ( @NonNull UserMessageID  initID)

Construct a user message, setting the ID to a given value and using default values for the other fields.

The count and total fields will default to zero, and the user record to an empty record.

This form of the constructor should not be used when the supplied ID indicates a message type which has an associated count, total or user record (see count(), total() and user() for more details). However, for all other message types it is appropriate.

Parameters
initIDInitial message ID

Member Function Documentation

◆ count()

short count ( )

Query the message's count field.

This field represents the scan count for capture/enrolment/identification/verification, code quality for images, or progress percentage for image transfer. It is only applicable to the following message types: IMAGE_CODE_QUALITY, IMAGE_PROGRESS, PLACE_FINGER_FOR_ACQUISITION, PLACE_FIRST_FINGER_FOR_ACQUISITION, PLACE_SECOND_FINGER_FOR_ACQUISITION.

◆ ID()

UserMessageID ID ( )

Query the message's type ID.

Returns
Message type ID (see UserMessageID for details)

◆ message() [1/2]

String message ( )

Obtain the user message associated with the current ID

Returns
User message string if ID is known; empty string otherwise

◆ message() [2/2]

static String message ( @NonNull UserMessageID  messageID)
static

Obtain the user message associated with a given ID

Parameters
messageIDUnique identifier for the message in question
Returns
User message string if ID is known; empty string otherwise

◆ setCount()

void setCount ( short  newCount)

Set the message's count field.

This field represents the scan count for capture/enrolment/identification/verification, code quality for images, or progress percentage for image transfer. It is only applicable to the following message types: IMAGE_CODE_QUALITY, IMAGE_PROGRESS, PLACE_FINGER_FOR_ACQUISITION, PLACE_FIRST_FINGER_FOR_ACQUISITION, PLACE_SECOND_FINGER_FOR_ACQUISITION.

For all other message types it should be set to zero.

Parameters
newCountNew value of the count field, valid range 0-255
Exceptions
IllegalArgumentExceptionif the supplied count is outside the valid range

◆ setID()

void setID ( @NonNull UserMessageID  newID)

Set the message's type ID.

Parameters
newIDNew message type ID (see UserMessageID for details)

◆ setTotal()

void setTotal ( short  newTotal)

Set the message's total field.

This field holds the total number of scans which will occur for capture/enrolment/identification/verification. It is only applicable to the following message types: PLACE_FINGER_FOR_ACQUISITION, PLACE_FIRST_FINGER_FOR_ACQUISITION, PLACE_SECOND_FINGER_FOR_ACQUISITION.

For all other message types it should be set to zero.

Parameters
newTotalNew value of the total field, valid range 0-255
Exceptions
IllegalArgumentExceptionif the supplied total is outside the valid range

◆ setUser()

void setUser ( @NonNull FingerprintUserRecord  newUser)

Set the message's user field.

This field is only applicable to the MATCH_SUCCESSFUL message type, and only for identify operations. It contains the record associated with the user whose identity was matched.

For all other message types it should be set to a default-constructed user record.

Parameters
newUserNew value of the user field

◆ total()

short total ( )

Query the message's total field.

This field holds the total number of scans which will occur for capture/enrolment/identification/verification. It is only applicable to the following message types: PLACE_FINGER_FOR_ACQUISITION, PLACE_FIRST_FINGER_FOR_ACQUISITION, PLACE_SECOND_FINGER_FOR_ACQUISITION.

◆ user()

Query the user field for this message.

This field is only applicable to the MATCH_SUCCESSFUL message type, and only for identify operations. It contains the record associated with the user whose identity was matched.

Returns
Copy of user record for this message