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>
|
2022-07-26 15:21:51 +03:00
|
|
|
#include <storage/storage.h>
|
2021-09-02 02:22:40 +03:00
|
|
|
|
2022-07-26 15:21:51 +03:00
|
|
|
#define BT_SETTINGS_PATH INT_PATH(BT_SETTINGS_FILE_NAME)
|
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
|
|
|
}
|
|
|
|
|
2024-03-25 21:48:18 +03:00
|
|
|
bool bt_settings_save(const BtSettings* bt_settings) {
|
2021-09-02 02:22:40 +03:00
|
|
|
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
|
|
|
}
|