|
cryptnox-sdk-arduino 1.0.0
Arduino library for Cryptnox Hardware Wallet
|
#include <CryptnoxWallet.h>#include <SPI.h>Go to the source code of this file.
Macros | |
| #define | PN532_SS_PIN (10U) |
| SPI slave-select (CS) pin connected to the PN532 module. | |
| #define | DEMO_PIN "000000000" |
| Demo PIN used by this example. Must match the PIN that the card was initialised with (4–9 ASCII digits). | |
Functions | |
| PN532Adapter | nfc (serialAdapter, PN532_SS_PIN, &SPI) |
| PN532 transport adapter over SPI. | |
| void | setup () |
| Arduino setup hook. | |
| void | loop () |
| Arduino main loop. | |
Variables | |
| ArduinoLoggerAdapter | serialAdapter |
Arduino logger adapter — emits SDK diagnostics on Serial. | |
| ArduinoCryptoProvider | cryptoProvider |
| Crypto provider (AES / SHA / micro-ecc / TRNG bridge for Arduino). | |
| ArduinoPlatform | platform |
| Platform adapter (Arduino blocking delay). | |
| CryptnoxWallet | wallet (nfc, serialAdapter, cryptoProvider, platform) |
| High-level Cryptnox wallet wiring the four adapters together. | |
| #define DEMO_PIN "000000000" |
Demo PIN used by this example. Must match the PIN that the card was initialised with (4–9 ASCII digits).
Definition at line 47 of file VerifyPin.ino.
| #define PN532_SS_PIN (10U) |
SPI slave-select (CS) pin connected to the PN532 module.
Definition at line 41 of file VerifyPin.ino.
| void loop | ( | ) |
Arduino main loop.
One full secure-channel session per iteration on the happy path:
If CryptnoxWallet::verifyPin returns false the sketch enters an infinite halt. This is deliberate: looping would resubmit the same wrong PIN on every iteration and exhaust the card's retry counter within a few seconds, permanently blocking the PIN.
The 1 s delay between successful iterations gives time to remove/replace the card and keeps the Serial output readable.
Definition at line 97 of file VerifyPin.ino.
References DEMO_PIN, F, serialAdapter, and wallet.
| PN532Adapter nfc | ( | serialAdapter | , |
| PN532_SS_PIN | , | ||
| & | SPI ) |
PN532 transport adapter over SPI.
References PN532_SS_PIN, and serialAdapter.
| void setup | ( | ) |
Arduino setup hook.
Brings up Serial, the SPI bus and the PN532 reader. Halts on init failure (no reader detected) so the user can inspect the Serial output.
Definition at line 70 of file VerifyPin.ino.
References F, serialAdapter, and wallet.
| ArduinoCryptoProvider cryptoProvider |
Crypto provider (AES / SHA / micro-ecc / TRNG bridge for Arduino).
Definition at line 56 of file VerifyPin.ino.
| ArduinoPlatform platform |
Platform adapter (Arduino blocking delay).
Definition at line 59 of file VerifyPin.ino.
| ArduinoLoggerAdapter serialAdapter |
Arduino logger adapter — emits SDK diagnostics on Serial.
Definition at line 50 of file VerifyPin.ino.
| CryptnoxWallet wallet(nfc, serialAdapter, cryptoProvider, platform) | ( | nfc | , |
| serialAdapter | , | ||
| cryptoProvider | , | ||
| platform | ) |
High-level Cryptnox wallet wiring the four adapters together.