ChipReadEnding

How a chip read through a platform entry point ended. Every read has exactly one ending.

Complete, Partial and Failed mirror ChipReadResult; the others come from the platform: the person, the app or the system ended the read, or it could not start. No ending's toString() carries document data.

May gain members in a later release: an exhaustive when over it then stops compiling until the new member is handled. An else branch keeps it compiling without handling the new member: that is your choice, and today the compiler warns that such an else is redundant.

Experimental: see ExperimentalTesseraChipApi.

Since

1.0.0

Inheritors

Types

Link copied to clipboard

The person or the app ended the read.

Link copied to clipboard

Every step ran; read holds what the chip gave.

Link copied to clipboard

The system ended the read, or the platform closed its link while the app had not cancelled. What leads here differs by platform:

Link copied to clipboard

No access was granted in any attempt, or the chip is blank, or the read could not go on for a reason that is not about the key. On Android this is also the ending when the app's own wait for a document (NfcReadSettings.waitForDocumentMillis) passed with none found: error is a io.lightine.tessera.types.errors.NfcTimeout with limit WAIT_FOR_DOCUMENT and attempts is 0. The app set that limit, so it is not EndedBySystem.

Link copied to clipboard

The chip refused the access protocol with this key: it refused the reader's proof of the key (ChipAccessDenied.Reason.KEY_NOT_MATCHED), or answered a step of the protocol with a status word that does not say why (ChipAccessDenied.Reason.CHIP_REFUSED). A ChipAccessDenied.Reason.CHIP_REFUSED is not always about the key: some chips answer a wrong key that way, and a chip also refuses a protocol step it does not support (for example a PACE setting); error keeps the chip's status word, and the SDK does not guess which. No status word is read as "blocked" or as a count of tries: the MRZ key and the card access number have no try counter.

Link copied to clipboard

The key was refused before anything was sent to the chip: no reader was turned on, no system sheet was shown, and no chip attempt was used. Two causes:

Link copied to clipboard

The read could not start: NFC is missing, off, not permitted, not eligible, not yet answered by the person, busy, or another read is running. See systemCode for the platform's own code, when it gave one.

Link copied to clipboard

Access was granted, then the read stopped before every step ran.

Properties

Link copied to clipboard
abstract val attempts: Int

How many attempts sent commands to a chip: 0 when none did, more than 1 after a lost link. A read that ends while it waits for the document after a lost link counts only the attempts that ran, so this can be one less than the ChipReadUpdate.attempt of the last updates, which already name the attempt the read was getting ready for.

Link copied to clipboard

The progress when the read ended: 1.0 only for Complete; the last value otherwise.

Link copied to clipboard
open val systemCode: Int?

The platform's own code for the failure that ended the read, as the platform reported it, when it gave one: on iPhone, Core NFC's NFCReaderError code of the session's end or of the failed connect that led to this ending (for example 2, 7 or 8 for NotStarted with NOT_PERMITTED, NOT_ELIGIBLE or ACCESS_NOT_ANSWERED). null when the ending did not come from a code of the platform, and always on Android, whose NFC calls report no codes. A fact for diagnosis: the typed reason is what the app acts on.