|
Embedded SDK
Embedded SDK
|
Address Book APDU dispatcher. More...
#include <string.h>#include "os_apdu.h"#include "os_helpers.h"#include "os_print.h"#include "os_utils.h"#include "address_book.h"#include "apdu_chunks.h"#include "status_words.h"#include "identity.h"#include "ledger_account.h"
Go to the source code of this file.
Macros | |
| #define | P1_REGISTER_IDENTITY 0x01 |
| #define | P1_EDIT_CONTACT_NAME 0x02 |
| #define | P1_EDIT_IDENTIFIER 0x03 |
| #define | P1_EDIT_SCOPE 0x04 |
| #define | P1_PROVIDE_CONTACT 0x20 |
| #define | P1_REGISTER_LEDGER_ACCOUNT 0x11 |
| #define | P1_EDIT_LEDGER_ACCOUNT 0x12 |
| #define | P1_PROVIDE_LEDGER_ACCOUNT_CONTACT 0x21 |
Functions | |
| bolos_err_t | addr_book_handle_apdu (uint8_t *buffer, size_t buffer_len, uint8_t p1, uint8_t p2) |
Address Book APDU dispatcher.
Entry point for all Address Book sub-commands. Routes each APDU to the appropriate handler based on P1:
Every sub-command uses the same chunked transport, regardless of payload size. The first chunk (P2=0x00) is prefixed with a 2-byte big-endian total payload length. Continuation chunks (P2=0x80) are appended directly. The shared helper apdu_chunks_reassemble() accumulates the data and returns the assembled buffer. Once complete, the handler is then dispatched on P1. A uniform format keeps the protocol consistent and eases future payload-size evolutions.
Definition in file address_book.c.
| #define P1_EDIT_CONTACT_NAME 0x02 |
Definition at line 62 of file address_book.c.
| #define P1_EDIT_IDENTIFIER 0x03 |
Definition at line 63 of file address_book.c.
| #define P1_EDIT_LEDGER_ACCOUNT 0x12 |
Definition at line 69 of file address_book.c.
| #define P1_EDIT_SCOPE 0x04 |
Definition at line 64 of file address_book.c.
| #define P1_PROVIDE_CONTACT 0x20 |
Definition at line 65 of file address_book.c.
| #define P1_PROVIDE_LEDGER_ACCOUNT_CONTACT 0x21 |
Definition at line 70 of file address_book.c.
| #define P1_REGISTER_IDENTITY 0x01 |
Definition at line 61 of file address_book.c.
| #define P1_REGISTER_LEDGER_ACCOUNT 0x11 |
Definition at line 68 of file address_book.c.
| bolos_err_t addr_book_handle_apdu | ( | uint8_t * | buffer, |
| size_t | buffer_len, | ||
| uint8_t | p1, | ||
| uint8_t | p2 ) |
Definition at line 74 of file address_book.c.