Loading...
Searching...
No Matches
nxp_native_command.h
1#pragma once
2
3#include "nxp_native_command_mode.h"
4
5#include <lib/nfc/protocols/iso14443_4a/iso14443_4a_poller.h>
6
7// ISO 7816 command wrapping
8#define NXP_NATIVE_COMMAND_ISO_CLA (0x90)
9#define NXP_NATIVE_COMMAND_ISO_P1 (0x00)
10#define NXP_NATIVE_COMMAND_ISO_P2 (0x00)
11#define NXP_NATIVE_COMMAND_ISO_LE (0x00)
12// ISO 7816 status wrapping
13#define NXP_NATIVE_COMMAND_ISO_SW1 (0x91)
14
15// Successful operation
16#define NXP_NATIVE_COMMAND_STATUS_OPERATION_OK (0x00)
17// No changes done to backup files, CommitTransaction / AbortTransaction not necessary
18#define NXP_NATIVE_COMMAND_STATUS_NO_CHANGES (0x0C)
19// Insufficient NV-Memory to complete command
20#define NXP_NATIVE_COMMAND_STATUS_OUT_OF_EEPROM_ERROR (0x0E)
21// Command code not supported
22#define NXP_NATIVE_COMMAND_STATUS_ILLEGAL_COMMAND_CODE (0x1C)
23// CRC or MAC does not match data Padding bytes not valid
24#define NXP_NATIVE_COMMAND_STATUS_INTEGRITY_ERROR (0x1E)
25// Invalid key number specified
26#define NXP_NATIVE_COMMAND_STATUS_NO_SUCH_KEY (0x40)
27// Length of command string invalid
28#define NXP_NATIVE_COMMAND_STATUS_LENGTH_ERROR (0x7E)
29// Current configuration / status does not allow the requested command
30#define NXP_NATIVE_COMMAND_STATUS_PERMISSION_DENIED (0x9D)
31// Value of the parameter(s) invalid
32#define NXP_NATIVE_COMMAND_STATUS_PARAMETER_ERROR (0x9E)
33// Requested AID not present on PICC
34#define NXP_NATIVE_COMMAND_STATUS_APPLICATION_NOT_FOUND (0xA0)
35// Unrecoverable error within application, application will be disabled
36#define NXP_NATIVE_COMMAND_STATUS_APPL_INTEGRITY_ERROR (0xA1)
37// Currently not allowed to authenticate. Keep trying until full delay is spent
38#define NXP_NATIVE_COMMAND_STATUS_STATUS_AUTHENTICATION_DELAY (0xAD)
39// Current authentication status does not allow the requested command
40#define NXP_NATIVE_COMMAND_STATUS_AUTHENTICATION_ERROR (0xAE)
41// Additional data frame is expected to be sent
42#define NXP_NATIVE_COMMAND_STATUS_ADDITIONAL_FRAME (0xAF)
43// Attempt to read/write data from/to beyond the file's/record's limits
44// Attempt to exceed the limits of a value file.
45#define NXP_NATIVE_COMMAND_STATUS_BOUNDARY_ERROR (0xBE)
46// Unrecoverable error within PICC, PICC will be disabled
47#define NXP_NATIVE_COMMAND_STATUS_PICC_INTEGRITY_ERROR (0xC1)
48// Previous Command was not fully completed. Not all Frames were requested or provided by the PCD
49#define NXP_NATIVE_COMMAND_STATUS_COMMAND_ABORTED (0xCA)
50// PICC was disabled by an unrecoverable error
51#define NXP_NATIVE_COMMAND_STATUS_PICC_DISABLED_ERROR (0xCD)
52// Number of Applications limited to 28, no additional CreateApplication possible
53#define NXP_NATIVE_COMMAND_STATUS_COUNT_ERROR (0xCE)
54// Creation of file/application failed because file/application with same number already exists
55#define NXP_NATIVE_COMMAND_STATUS_DUBLICATE_ERROR (0xDE)
56// Could not complete NV-write operation due to loss of power, internal backup/rollback mechanism activated
57#define NXP_NATIVE_COMMAND_STATUS_EEPROM_ERROR (0xEE)
58// Specified file number does not exist
59#define NXP_NATIVE_COMMAND_STATUS_FILE_NOT_FOUND (0xF0)
60// Unrecoverable error within file, file will be disabled
61#define NXP_NATIVE_COMMAND_STATUS_FILE_INTEGRITY_ERROR (0xF1)
62
63typedef uint8_t NxpNativeCommandStatus;
64
85Iso14443_4aError nxp_native_command_iso14443_4a_poller(
86 Iso14443_4aPoller* iso14443_4a_poller,
87 NxpNativeCommandStatus* status_code,
88 const BitBuffer* input_buffer,
89 BitBuffer* result_buffer,
90 NxpNativeCommandMode command_mode,
91 BitBuffer* tx_buffer,
92 BitBuffer* rx_buffer);
Definition bit_buffer.c:7
Definition iso14443_4a_poller_i.h:30