#[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