Add Ability to Display MAC

This commit is contained in:
Matthew
2024-03-28 17:33:57 -04:00
parent ab72ead379
commit a6b84847ac
8 changed files with 103 additions and 18 deletions

View File

@@ -29,6 +29,8 @@ bool findmy_state_load(FindMyState* out_state) {
if(!flipper_format_read_uint32(file, "transmit_power", &tmp, 1)) break;
state.transmit_power = tmp;
if(!flipper_format_read_bool(file, "show_mac", &state.show_mac, 1)) break;
if(!flipper_format_read_uint32(file, "tag_type", &tmp, 1)) {
// Support migrating from old config
tmp = FindMyTypeApple;
@@ -53,7 +55,7 @@ bool findmy_state_load(FindMyState* out_state) {
state.beacon_active = false;
state.broadcast_interval = 5;
state.transmit_power = 6;
state.show_mac = false;
state.tag_type = FindMyTypeApple;
// Set default mac
@@ -102,6 +104,7 @@ void findmy_state_apply(FindMyState* state) {
furi_check(
furi_hal_bt_extra_beacon_set_data(state->data, findmy_state_data_size(state->tag_type)));
if(state->beacon_active) {
furi_check(furi_hal_bt_extra_beacon_start());
}
@@ -135,6 +138,8 @@ void findmy_state_save(FindMyState* state) {
tmp = state->tag_type;
if(!flipper_format_write_uint32(file, "tag_type", &tmp, 1)) break;
if(!flipper_format_write_bool(file, "show_mac", &state->show_mac, 1)) break;
if(!flipper_format_write_hex(file, "mac", state->mac, sizeof(state->mac))) break;
if(!flipper_format_write_hex(