Enum pn532::ErrorCode

source ·
#[repr(u8)]
pub enum ErrorCode {
Show 26 variants Timeout = 1, CrcError = 2, ParityError = 3, WrongBitCountDuringAntiCollision = 4, FramingError = 5, AbnormalBitCollision = 6, InsufficientCommunicationBuffer = 7, RfBufferOverflow = 9, RfFieldHasNotBeenSwitchedOn = 10, RfProtocolError = 11, Overheating = 13, InternalBufferOverflow = 14, InvalidParameter = 16, CommandNotSupported = 18, WrongDataFormat = 19, AuthenticationError = 20, WrongUidCheckByte = 35, InvalidDeviceState = 37, OperationNotAllowed = 38, CommandNotAcceptable = 39, TargetHasBeenReleased = 41, CardHasBeenExchanged = 42, CardHasDisappeared = 43, NfcId3InitiatorTargetMismatch = 44, OverCurrent = 45, NadMissing = 46,
}
Expand description

Some commands return a status byte. If this byte is not zero it will contain an ErrorCode.

fn print_error(status_byte: u8){
    if let Ok(error_code) = ErrorCode::try_from(status_byte){
        println!("{:?}", error_code);
    } else {
        println!("unknown error code");
    }
}

Variants§

§

Timeout = 1

Time Out, the target has not answered

§

CrcError = 2

A CRC error has been detected by the CIU

§

ParityError = 3

A Parity error has been detected by the CIU

§

WrongBitCountDuringAntiCollision = 4

During an anti-collision/select operation (ISO/IEC14443-3 Type A and ISO/IEC18092 106 kbps passive mode), an erroneous Bit Count has been detected

§

FramingError = 5

Framing error during Mifare operation

§

AbnormalBitCollision = 6

An abnormal bit-collision has been detected during bit wise anti-collision at 106 kbps

§

InsufficientCommunicationBuffer = 7

Communication buffer size insufficient

§

RfBufferOverflow = 9

RF Buffer overflow has been detected by the CIU (bit BufferOvfl of the register CIU_Error)

§

RfFieldHasNotBeenSwitchedOn = 10

In active communication mode, the RF field has not been switched on in time by the counterpart (as defined in NFCIP-1 standard)

§

RfProtocolError = 11

RF Protocol error (cf. Error! Reference source not found., description of the CIU_Error register)

§

Overheating = 13

Temperature error: the internal temperature sensor has detected overheating, and therefore has automatically switched off the antenna drivers

§

InternalBufferOverflow = 14

Internal buffer overflow

§

InvalidParameter = 16

Invalid parameter (range, format, …)

§

CommandNotSupported = 18

DEP Protocol: The PN532 configured in target mode does not support the command received from the initiator (the command received is not one of the following: ATR_REQ, WUP_REQ, PSL_REQ, DEP_REQ, DSL_REQ, RLS_REQ Error! Reference source not found.).

§

WrongDataFormat = 19

DEP Protocol, Mifare or ISO/IEC14443-4: The data format does not match to the specification. Depending on the RF protocol used, it can be: • Bad length of RF received frame, • Incorrect value of PCB or PFB, • Invalid or unexpected RF received frame, • NAD or DID incoherence.

§

AuthenticationError = 20

Mifare: Authentication error

§

WrongUidCheckByte = 35

ISO/IEC14443-3: UID Check byte is wrong

§

InvalidDeviceState = 37

DEP Protocol: Invalid device state, the system is in a state which does not allow the operation

§

OperationNotAllowed = 38

Operation not allowed in this configuration (host controller interface)

§

CommandNotAcceptable = 39

This command is not acceptable due to the current context of the PN532 (Initiator vs. Target, unknown target number, Target not in the good state, …)

§

TargetHasBeenReleased = 41

The PN532 configured as target has been released by its initiator

§

CardHasBeenExchanged = 42

PN532 and ISO/IEC14443-3B only: the ID of the card does not match, meaning that the expected card has been exchanged with another one.

§

CardHasDisappeared = 43

PN532 and ISO/IEC14443-3B only: the card previously activated has disappeared.

§

NfcId3InitiatorTargetMismatch = 44

Mismatch between the NFCID3 initiator and the NFCID3 target in DEP 212/424 kbps passive.

§

OverCurrent = 45

An over-current event has been detected

§

NadMissing = 46

NAD missing in DEP frame

Trait Implementations§

source§

impl Clone for ErrorCode

source§

fn clone(&self) -> ErrorCode

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for ErrorCode

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl PartialEq for ErrorCode

source§

fn eq(&self, other: &ErrorCode) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl TryFrom<u8> for ErrorCode

§

type Error = ()

The type returned in the event of a conversion error.
source§

fn try_from(value: u8) -> Result<ErrorCode, ()>

Performs the conversion.
source§

impl Copy for ErrorCode

source§

impl Eq for ErrorCode

source§

impl StructuralPartialEq for ErrorCode

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.