xtotpConfig.h (4067B)
1 /** 2 * @file xtotpConfig.h 3 * @author Adrian STEINER (steia19@bfh.ch) 4 * @brief Configuration file to set default values and buffer sizes. 5 * It is used that a user can redefine this values and configure their own 6 * application for his device. 7 * @version 0.1 8 * @date 01-08-2025 9 * 10 * @copyright (C) 2025 Adrian STEINER 11 * This program is free software: you can redistribute it and/or modify 12 * it under the terms of the GNU General Public License as published by 13 * the Free Software Foundation, either version 3 of the License, or 14 * (at your option) any later version. 15 * 16 * This program is distributed in the hope that it will be useful, 17 * but WITHOUT ANY WARRANTY; without even the implied warranty of 18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 19 * GNU General Public License for more details. 20 * 21 * You should have received a copy of the GNU General Public License 22 * along with this program. If not, see <https: //www.gnu.org/licenses/>. 23 * 24 */ 25 26 #ifndef XTOTP_CONFIG_H 27 #define XTOTP_CONFIG_H 28 29 #include "inputInterface.h" 30 #include "pbm_types.h" 31 #include "version.h" ///< Generated with a Makefile target with data from the git repository 32 #include "xtotpUtil.h" 33 34 /* ---------- Synch data: ----------*/ 35 /* Synchronize periodic in seconds */ 36 #ifndef XTOTP_SYNC_UPDATE_TIME 37 #define XTOTP_SYNC_UPDATE_PERIOD \ 38 (90 * 24 * 60 * 60) ///< 90 days (day * hour * min * sec) 39 #endif 40 /* Synchronize error time in ms*/ 41 #ifndef XTOTP_SYNC_ERROR_RESET 42 #define XTOTP_SYNC_ERROR_RESET \ 43 (3 * APP_SEC_BASE) ///< Error reset for synchronisation in ms 44 #endif 45 46 #ifndef XTOTP_SYNC_MIN_BATTERY_LEVEL 47 #define XTOTP_SYNC_MIN_BATTERY_LEVEL \ 48 (5) ///< Minimum battery state in percent to synchronize 49 #endif 50 51 #ifndef XTOTP_SYNC_MAX_SYNC_TIME 52 #define XTOTP_SYNC_MAX_SYNC_TIME \ 53 (30 * 60 * APP_SEC_BASE) ///< Maximum time to sync until force a newStart in s 54 #endif 55 56 /* ---------- Sample time in ms ----------*/ 57 #ifndef XTOTP_SAMPLE_TIME 58 #define XTOTP_SAMPLE_TIME (10) ///< Input sample time in ms 59 #endif 60 61 /* ---------- DEFAULT CONFIGURATION VALUES ---------- */ 62 63 /* */ 64 #ifndef XTOTP_STOP_TIME_BUTTON 65 #define XTOTP_STOP_TIME_BUTTON \ 66 (3 * APP_SEC_BASE) ///< Time to press the shutdown button (3000 ms) 67 #endif 68 69 #ifndef XTOTP_DEFAULT_TIMEOUT 70 #define XTOTP_DEFAULT_TIMEOUT \ 71 (2 * 60 * APP_SEC_BASE) ///< Timeout time to save energy (2min) 72 #endif 73 74 #ifndef XTOTP_MAX_TIMEOUT_TIME 75 #define XTOTP_MAX_TIMEOUT_TIME (999) ///< Maximum timeout time 76 #endif 77 78 #ifndef XTOTP_DEFAULT_THEME 79 #define XTOTP_DEFAULT_THEME (PBM_BLACK) ///< Default font color 80 #endif 81 82 #ifndef XTOTP_BATTERY_CHECK_TIME 83 #define XTOTP_BATTERY_CHECK_TIME \ 84 (1 * 60 * APP_SEC_BASE) ///< Time to force a battery measurement 85 #endif 86 87 #ifndef XTOTP_REACTION_EDGE 88 #define XTOTP_REACTION_EDGE (INPUT_STATE_RISING_EDGE) ///< Default edge reaction 89 #endif 90 91 /* ----------- xTOTP and autopay settings --------- */ 92 #ifndef XTOTP_STORABLE_SECRETS 93 #define XTOTP_STORABLE_SECRETS (10) ///< Storable secrets in the device 94 #endif 95 96 #ifndef XTOTP_DEVICE_ID 97 #define XTOTP_DEVICE_ID ("xTOTP") ///< Initialised device ID 98 #endif 99 100 #ifndef XTOTP_DEVICE_ID_SIZE 101 #define XTOTP_DEVICE_ID_SIZE (12) ///< Max size of device id 102 #endif 103 104 #ifndef XTOTP_MERCHANT_BACKEND 105 #define XTOTP_MERCHANT_BACKEND \ 106 ("") ///< Merchant backend default for automated paying 107 #endif 108 109 #ifndef XTOTP_MERCHANT_BACKEND_SIZE 110 #define XTOTP_MERCHANT_BACKEND_SIZE (96) ///< Merchant backend buffer size 111 #endif 112 113 #ifndef XTOTP_MERCHANT_TEMPLATE_SIZE 114 #define XTOTP_MERCHANT_TEMPLATE_SIZE (32) ///< Merchant template name size 115 #endif 116 117 #ifndef XTOTP_AUTOPAY_RECEIVED_PASSKEYS 118 #define XTOTP_AUTOPAY_RECEIVED_PASSKEYS (5) ///< Received passkey with autopay 119 #endif 120 121 #endif /*XTOTP_CONFIG_H*/