Provides access to Grabba proxcard reader functionality, such as triggering proxcard/RFID scans.
Callbacks to user-provided code may be triggered in response to relevant events, e.g. successful scan of a proxcard. Refer to the ProxcardListener class for the details of these callbacks and how to enable them.
Calls to this class will not succeed until a connection to a Grabba device has been established. Refer to the CoreAPI class for details of how to establish or query this connection.
Thread safety: Everything in this namespace is fully thread-safe.
Static Public Member Functions | |
static void | startScan (@NonNull ErrorCode error) |
Start an asynchronous proxcard scan. More... | |
static void | stopScan (boolean blocking, @NonNull ErrorCode error) |
Cancel an existing proxcard scan. More... | |
static boolean | supported () |
Query whether there is currently a connected Grabba device with proxcard functionality. More... | |
|
static |
Start an asynchronous proxcard scan.
If the supplied error code indicates no prior errors, there is a connected Grabba device with proxcard capabilities, and no proxcard scan is currently active, then a proxcard scan will be commenced.
If a proxcard scan is already active, or a prior error is indicated, then no action is taken, and the error code will not be updated.
If there is no connection, or if the connected Grabba device lacks proxcard capabilities, then the error code will be updated accordingly.
If the scan is commenced, then a NO_ERROR code is returned, and the proxcard reader will attempt to scan a proxcard. There are four possible outcomes:
Note that any error conditions detected during the scan will not be reported by this function (as it is non-blocking). Instead, feedback is given by way of callbacks to active ProxcardListener objects. Each such object will receive a Start event when the scan process commences, a Stop event when it completes (regardless of the reason), and either a Data, Error or TimeOut event depending on the outcome of the scan (if not cancelled).
For reader modules which support concurrent scanning of multiple tags, there may also be additional Data events - e.g. if four tags are all within the scanning field, and all are read within the timeout period, then four Data events and one Stop event will be triggered.
error | Error code; operation proceeds only if set to NO_ERROR. If an error is detected when starting the operation, then this will be updated with the details. |
|
static |
Cancel an existing proxcard scan.
If the supplied error code indicates no prior errors, there is a connected Grabba device with proxcard capabilities, and a proxcard scan is currently active, then that scan will be cancelled. The error code will be updated if any errors are detected during the cancellation.
If no proxcard scan is currently active, or a prior error is indicated, then no action is taken, and the error code will not be updated.
If there is no connection, or if the connected Grabba device lacks proxcard capabilities, then the error code will be updated accordingly.
blocking | If true (recommended), this call will not return until any active scan has been cancelled, and all associated internal resources have been cleaned up. If false, cancellation and cleanup will occur in the background, and this call will return prior to their completion. |
error | Error code; operation proceeds only if set to NO_ERROR. If an error is detected during the operation, then this will be updated with the details. |
|
static |
Query whether there is currently a connected Grabba device with proxcard functionality.
This is a non-blocking call; device capabilities are cached internally by the driver.