BSB Developer Docs
Loading...
Searching...
No Matches
busy_timer_common_i.h
1#pragma once
2
3#include "busy_timer_common.h"
4
5#include <cjson/cJSON.h>
6
7#include <busy/busy_common.h>
8
9#define KEY_COMMON_TIMER_SETTINGS_TYPE "type"
10
11#define KEY_COMMON_SIMPLE_SETTINGS_TOTAL_TIME "total_time_ms"
12
13#define KEY_COMMON_INTERVAL_SETTINGS_WORK "interval_work_ms"
14#define KEY_COMMON_INTERVAL_SETTINGS_REST "interval_rest_ms"
15#define KEY_COMMON_INTERVAL_SETTINGS_CYCLES "interval_work_cycles_count"
16#define KEY_COMMON_INTERVAL_SETTINGS_AUTOSTART "is_autostart_enabled"
17
18#define KEY_COMMON_BUSY_BAR_SETTINGS "busy_bar_settings"
19#define KEY_COMMON_BUSY_BAR_SETTINGS_THEME "theme"
20#define KEY_COMMON_BUSY_BAR_SETTINGS_SHOW_WORK_PHASE_ONLY "show_work_phase_only"
21#define KEY_COMMON_BUSY_BAR_SETTINGS_TRIGGER_SMART_HOME "trigger_smart_home"
22
23// Serialization
24
25void busy_timer_common_serialize_app_config(cJSON* json, const BusyAppConfig* app_config);
26
27void busy_timer_common_serialize_infinite_config(cJSON* json);
28
29void busy_timer_common_serialize_simple_config(
30 cJSON* json,
31 const BusyTimerSimpleConfig* simple_config);
32
33void busy_timer_common_serialize_interval_config(
34 cJSON* json,
35 const BusyTimerIntervalConfig* interval_config);
36
37// Deserialization
38
39bool busy_timer_common_deserialize_app_config(const cJSON* json, BusyAppConfig* app_config);
40
41bool busy_timer_common_deserialize_timer_mode(const cJSON* json, BusyTimerMode* timer_mode);
42
43bool busy_timer_common_deserialize_simple_config(
44 const cJSON* json,
45 BusyTimerSimpleConfig* simple_config);
46
47bool busy_timer_common_deserialize_interval_config(
48 const cJSON* json,
49 BusyTimerIntervalConfig* interval_config);
50
51// Validation
52
53bool busy_timer_common_is_valid_card_id(const char* card_id);
54
55bool busy_timer_common_is_valid_simple_config(const BusyTimerSimpleConfig* simple_config);
56
57bool busy_timer_common_is_valid_interval_config(const BusyTimerIntervalConfig* interval_config);
Common BUSY application defines and variables.
Common BusyTimer types & macros.
BusyApp configuration structure.
Definition busy_common.h:22
Definition busy_timer_common.h:59
Definition busy_timer_common.h:55