60#define POS_AMOUNT_UNITS_MAX_NATIVE 18446744ULL
91#define TZ_OFFSET_MIN (-720)
92#define TZ_OFFSET_MAX (840)
132 uint16_t *y_min, uint16_t *y_max);
138 uint16_t y_min, uint16_t y_max);
214#define SETTINGS_PAYOUT_MAX 64U
bool settings_check_admin_code(const char *code)
Check a candidate code, maintaining the failure counter.
bool settings_has_wifi(void)
true if a Wi-Fi SSID has been stored.
bool settings_get_wifi(char *ssid, size_t ssid_n, char *pass, size_t pass_n)
Read the stored Wi-Fi credentials.
bool settings_set_tz_offset_min(int16_t minutes)
Store the panel clock's UTC offset.
bool settings_wipe_if_new_build(void)
Erase NVS unless this exact build is the one that wrote it.
const char * settings_net_str(const char *testnet, const char *mainnet)
Pick the string belonging to the network the terminal is on.
pos_chain_t settings_get_chain(void)
Selected chain, or POS_CHAIN_ETH_USDC if never set.
bool settings_get_contract(pos_chain_t chain, char *out, size_t n)
Read the token-contract address for a network.
int16_t settings_get_tz_offset_min(void)
The panel clock's standard (winter) offset from UTC, in minutes east.
uint8_t settings_get_tz_dst(void)
The clock's DST rule, a civil_dst_t; CIVIL_DST_NONE when unset.
uint32_t settings_get_priority_fee_gwei(void)
EIP-1559 max priority fee (tip) per gas, in Gwei.
bool settings_set_fees_gwei(uint32_t max_gwei, uint32_t prio_gwei)
Persist the max fee and the tip per gas (Gwei), as a pair.
void settings_set_wifi(const char *ssid, const char *pass)
Persist Wi-Fi credentials (plaintext — see README threat model).
bool settings_get_payout(bool tron, char *out, size_t n)
Read the payout address for a network.
bool settings_set_admin_code(const char *code)
Store a new admin code, with a fresh random salt.
uint8_t settings_get_brightness(void)
Backlight level in percent, or 80 if never set.
void settings_set_chain(pos_chain_t chain)
Persist the selected chain.
bool settings_inflight_load(void *rec, size_t n)
Read the persisted sale back. false if none, or not n bytes.
void settings_set_mainnet(bool mainnet)
Persist the production/test network choice.
bool settings_set_contract(pos_chain_t chain, const char *addr)
Persist a token-contract address, value and echo copy.
void settings_get_touch_cal(uint16_t *x_min, uint16_t *x_max, uint16_t *y_min, uint16_t *y_max)
Raw XPT2046 range that maps to the panel's four edges.
bool settings_set_payout(bool tron, const char *addr)
Persist a payout address, writing both the value and its echo copy.
pos_chain_t
Which chain (and therefore which asset) the terminal charges in.
void settings_factory_reset(void)
Erase all stored settings (brightness, auto, Wi-Fi creds, fees).
uint8_t settings_admin_fail_count(void)
Consecutive failed unlock attempts, persisted.
bool settings_set_tz_dst(uint8_t rule)
Store the DST rule.
void settings_set_brightness(uint8_t pct)
Persist the backlight level (0..100).
bool settings_has_admin_code(void)
true once an admin code exists.
void settings_set_touch_cal(uint16_t x_min, uint16_t x_max, uint16_t y_min, uint16_t y_max)
Persist a calibration. Rejected (and ignored) if an axis is inverted or collapsed — a bad store here ...
bool settings_get_mainnet(void)
true when the terminal is on the production networks.
void settings_inflight_clear(void)
Drop the persisted sale. Writes nothing when there is none.
bool settings_has_payout(bool tron)
Whether an operator has actually set the payout address for a network.
uint32_t settings_get_max_fee_gwei(void)
EIP-1559 max fee per gas, in Gwei.
bool settings_inflight_save(const void *rec, size_t n)
Persist the sale between broadcast and verdict (opaque record).