Embedded SDK
Embedded SDK
Loading...
Searching...
No Matches
transaction_check_ui.c File Reference
#include <string.h>
#include "os_helpers.h"
#include "os_print.h"
#include "io.h"
#include "macros.h"
#include "status_words.h"
#include "nbgl_use_case.h"
#include "transaction_check.h"
#include "transaction_check_entrypoints.h"
#include "transaction_check_internal.h"
Include dependency graph for transaction_check_ui.c:

Go to the source code of this file.

Macros

#define HOW_IT_WORKS_NB   3

Functions

static void send_opt_in_reply (bool enabled)
 Send the 1-byte enable state with SWO_SUCCESS.
static void finalize_opt_in (void)
 Hand the end of the opt-in flow over to the app.
static void opt_in_choice_cb (bool enable)
 Store the user choice, send the pending reply, then display the status.
static tx_check_status_t start_opt_in (bool response_expected, bool sdk_reply)
 Display the opt-in screen if allowed and not seen yet.
WEAK void handle_tx_check_opt_in_response (bool enabled)
 Default reply to an opt-in request on the app APDU: the 1-byte enable state.
tx_check_status_t tx_check_opt_in (bool response_expected)
 Display the opt-in screen, from the settings or for an app APDU.
tx_check_status_t tx_check_opt_in_sdk_apdu (void)
 Display the opt-in screen for the SDK APDU, replied by the SDK.

Variables

static bool s_response_expected
static bool s_sdk_reply
static nbgl_genericDetails_t s_how_it_works
static const char * s_how_it_works_texts [HOW_IT_WORKS_NB]
static const nbgl_icon_details_t * s_how_it_works_icons [HOW_IT_WORKS_NB]

Macro Definition Documentation

◆ HOW_IT_WORKS_NB

#define HOW_IT_WORKS_NB   3

Definition at line 32 of file transaction_check_ui.c.

Function Documentation

◆ finalize_opt_in()

void finalize_opt_in ( void )
static

Hand the end of the opt-in flow over to the app.

Definition at line 59 of file transaction_check_ui.c.

◆ handle_tx_check_opt_in_response()

WEAK void handle_tx_check_opt_in_response ( bool enabled)

Default reply to an opt-in request on the app APDU: the 1-byte enable state.

Reply to an opt-in request received on the app APDU.

Parameters
[in]enabledTransaction Check enable state

Definition at line 151 of file transaction_check_ui.c.

◆ opt_in_choice_cb()

void opt_in_choice_cb ( bool enable)
static

Store the user choice, send the pending reply, then display the status.

Parameters
[in]enableWhether the user enabled Transaction Check

Definition at line 69 of file transaction_check_ui.c.

◆ send_opt_in_reply()

void send_opt_in_reply ( bool enabled)
static

Send the 1-byte enable state with SWO_SUCCESS.

Parameters
[in]enabledTransaction Check enable state

Definition at line 50 of file transaction_check_ui.c.

◆ start_opt_in()

tx_check_status_t start_opt_in ( bool response_expected,
bool sdk_reply )
static

Display the opt-in screen if allowed and not seen yet.

Parameters
[in]response_expectedWhether an APDU reply is pending
[in]sdk_replyWhether that reply is sent by the SDK (SDK APDU)
Returns
TX_CHECK_PENDING, TX_CHECK_SUCCESS or TX_CHECK_NOT_ALLOWED

Definition at line 99 of file transaction_check_ui.c.

◆ tx_check_opt_in()

tx_check_status_t tx_check_opt_in ( bool response_expected)

Display the opt-in screen, from the settings or for an app APDU.

Display the opt-in screen if the user has not seen it yet.

Parameters
[in]response_expectedWhether an APDU reply is pending
Returns
Same as start_opt_in()

Definition at line 162 of file transaction_check_ui.c.

◆ tx_check_opt_in_sdk_apdu()

tx_check_status_t tx_check_opt_in_sdk_apdu ( void )

Display the opt-in screen for the SDK APDU, replied by the SDK.

Opt-in request received on the SDK APDU, whose reply is sent by the SDK.

Returns
Same as start_opt_in()

Definition at line 173 of file transaction_check_ui.c.

Variable Documentation

◆ s_how_it_works

nbgl_genericDetails_t s_how_it_works
static

Definition at line 40 of file transaction_check_ui.c.

◆ s_how_it_works_icons

const nbgl_icon_details_t* s_how_it_works_icons[HOW_IT_WORKS_NB]
static

Definition at line 42 of file transaction_check_ui.c.

◆ s_how_it_works_texts

const char* s_how_it_works_texts[HOW_IT_WORKS_NB]
static

Definition at line 41 of file transaction_check_ui.c.

◆ s_response_expected

bool s_response_expected
static

Definition at line 35 of file transaction_check_ui.c.

◆ s_sdk_reply

bool s_sdk_reply
static

Definition at line 37 of file transaction_check_ui.c.