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

Description

Class encapsulating proxcard data plus the ID of the associated symbology.

This structure is used by ProxcardListener to deliver the results of successful proxcard scans 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. query functions)

Public Member Functions

 ProxcardData ()
 Construct with empty proxcard contents and unknown type ID.
 
 ProxcardData (@NonNull ProxcardTypeID initTypeID, @NonNull byte[] initContents)
 Construct with given proxcard contents and type ID. More...
 
byte [] contents ()
 Retrieve the proxcard contents. More...
 
String contentsString ()
 Generate a string representation of the current tag contents. More...
 
void setContents (@NonNull byte[] newContents)
 Set the proxcard contents. More...
 
void setType (@NonNull ProxcardTypeID newTypeID)
 Set the type ID for the card. More...
 
ProxcardTypeID type ()
 Retrieve the type ID for the card. More...
 
String typeString ()
 Generate the string representation of the current type ID. More...
 

Static Public Member Functions

static String contentsString (byte[] contents)
 Generate a string representation of a given tag's contents. More...
 
static String typeString (@NonNull ProxcardTypeID ID)
 Generate the string representation of a given type ID. More...
 

Constructor & Destructor Documentation

◆ ProxcardData()

ProxcardData ( @NonNull ProxcardTypeID  initTypeID,
@NonNull byte []  initContents 
)

Construct with given proxcard contents and type ID.

Parameters
initTypeIDInitial value of type ID field
initContentsInitial value of contents field, represented as a byte array

Member Function Documentation

◆ contents()

byte [] contents ( )

Retrieve the proxcard contents.

Returns
Proxcard contents in byte-array format

◆ contentsString() [1/2]

String contentsString ( )

Generate a string representation of the current tag contents.

Tag-specific formatting may be supported in future; at present, the string is simply a hex dump of the tag contents.

Returns
String representation of the current tag contents

◆ contentsString() [2/2]

static String contentsString ( byte []  contents)
static

Generate a string representation of a given tag's contents.

Tag-specific formatting may be supported in future; at present, the string is simply a hex dump of the tag contents.

Parameters
contentsTag contents
Returns
String representation of the supplied value

◆ setContents()

void setContents ( @NonNull byte []  newContents)

Set the proxcard contents.

Parameters
newContentsNew proxcard contents in byte-array format

◆ setType()

void setType ( @NonNull ProxcardTypeID  newTypeID)

Set the type ID for the card.

Parameters
newTypeIDNew proxcard type ID if known and detected, or ProxcardTypeID.UNKNOWN otherwise

◆ type()

ProxcardTypeID type ( )

Retrieve the type ID for the card.

Returns
Proxcard type ID if known and detected, or ProxcardTypeID.UNKNOWN otherwise

◆ typeString() [1/2]

String typeString ( )

Generate the string representation of the current type ID.

Returns
String containing the type ID; these are equivalent to cleaned-up versions of the enumerators in ProxcardTypeID. Defaults to "UNKNOWN" if an invalid ID is supplied.

◆ typeString() [2/2]

static String typeString ( @NonNull ProxcardTypeID  ID)
static

Generate the string representation of a given type ID.

Parameters
IDCard type for which the string representation is to be generated
Returns
String containing the type ID; these are equivalent to cleaned-up versions of the enumerators in ProxcardTypeID. Defaults to "UNKNOWN" if an invalid ID is supplied.