2021-09-02 02:22:40 +03:00
|
|
|
#include "bt_settings.h"
|
2022-04-21 18:36:53 +03:00
|
|
|
|
2021-09-02 02:22:40 +03:00
|
|
|
#include <furi.h>
|
2022-04-21 18:36:53 +03:00
|
|
|
#include <lib/toolbox/saved_struct.h>
|
2021-09-02 02:22:40 +03:00
|
|
|
|
|
|
|
#define BT_SETTINGS_PATH "/int/bt.settings"
|
2022-04-21 18:36:53 +03:00
|
|
|
#define BT_SETTINGS_VERSION (0)
|
|
|
|
#define BT_SETTINGS_MAGIC (0x19)
|
2021-09-02 02:22:40 +03:00
|
|
|
|
|
|
|
bool bt_settings_load(BtSettings* bt_settings) {
|
|
|
|
furi_assert(bt_settings);
|
|
|
|
|
2022-04-21 18:36:53 +03:00
|
|
|
return saved_struct_load(
|
|
|
|
BT_SETTINGS_PATH, bt_settings, sizeof(BtSettings), BT_SETTINGS_MAGIC, BT_SETTINGS_VERSION);
|
2021-09-02 02:22:40 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
bool bt_settings_save(BtSettings* bt_settings) {
|
|
|
|
furi_assert(bt_settings);
|
|
|
|
|
2022-04-21 18:36:53 +03:00
|
|
|
return saved_struct_save(
|
|
|
|
BT_SETTINGS_PATH, bt_settings, sizeof(BtSettings), BT_SETTINGS_MAGIC, BT_SETTINGS_VERSION);
|
2021-09-02 02:22:40 +03:00
|
|
|
}
|