app_settings.h
1 #pragma once 2 3 #include <stdint.h> 4 5 #include "nrf_crypto.h" 6 7 #if defined(__cplusplus) 8 extern "C" { 9 #endif // __cplusplus 10 11 #define CURRENT_SETTINGS_VERSION 0 12 13 #define NTAG_P_ACK_SIZE 2 14 #define CRYPTO_KEY_SIZE 80 15 16 typedef struct app_settings_s { 17 uint32_t version; 18 uint32_t boot_screen_timeout_ms; 19 uint8_t backlight_brightness; 20 uint8_t ntag_default_password_authentication_acknowledgement[NTAG_P_ACK_SIZE]; 21 struct crypto_expected_values_s 22 { 23 uint8_t combined_keys[NRF_CRYPTO_HASH_SIZE_SHA256]; 24 } crypto_expected_values; 25 struct crypto_key_s 26 { 27 char data_key[CRYPTO_KEY_SIZE]; 28 char tag_key[CRYPTO_KEY_SIZE]; 29 } crypto_keys; 30 } app_settings_t; 31 32 extern app_settings_t SETTINGS; 33 34 #if defined(__cplusplus) 35 } 36 #endif // __cplusplus 37 38 #ifdef __cplusplus 39 40 #include "files/files_littlefs.h" 41 42 namespace app::settings 43 { 44 bool Load(files::Littlefs& flash); 45 bool Save(files::Littlefs& flash); 46 } 47 48 #endif // __cplusplus