mirror of
https://github.com/Next-Flip/Momentum-Firmware.git
synced 2026-05-26 05:54:46 -07:00
Add Ability to Display MAC
This commit is contained in:
@@ -4,9 +4,11 @@ enum VarItemListIndex {
|
||||
VarItemListIndexBroadcastInterval,
|
||||
VarItemListIndexTransmitPower,
|
||||
VarItemListIndexRegisterTag,
|
||||
VarItemListIndexShowMac,
|
||||
VarItemListIndexAbout,
|
||||
};
|
||||
|
||||
|
||||
void findmy_scene_config_broadcast_interval_changed(VariableItem* item) {
|
||||
FindMy* app = variable_item_get_context(item);
|
||||
uint8_t index = variable_item_get_current_value_index(item);
|
||||
@@ -27,6 +29,18 @@ void findmy_scene_config_transmit_power_changed(VariableItem* item) {
|
||||
variable_item_set_current_value_index(item, app->state.transmit_power);
|
||||
}
|
||||
|
||||
void findmy_scene_config_show_mac(VariableItem* item) {
|
||||
FindMy* app = variable_item_get_context(item);
|
||||
uint8_t index = variable_item_get_current_value_index(item);
|
||||
findmy_toggle_show_mac(app, index);
|
||||
if (app->state.show_mac == true) {
|
||||
variable_item_set_current_value_text(item, "Yes");
|
||||
} else {
|
||||
variable_item_set_current_value_text(item, "No");
|
||||
}
|
||||
variable_item_set_current_value_index(item, app->state.show_mac);
|
||||
}
|
||||
|
||||
void findmy_scene_config_callback(void* context, uint32_t index) {
|
||||
furi_assert(context);
|
||||
FindMy* app = context;
|
||||
@@ -59,6 +73,14 @@ void findmy_scene_config_on_enter(void* context) {
|
||||
|
||||
item = variable_item_list_add(var_item_list, "Register Tag", 0, NULL, NULL);
|
||||
|
||||
item = variable_item_list_add(var_item_list, "Show MAC", 2, findmy_scene_config_show_mac, app);
|
||||
variable_item_set_current_value_index(item, app->state.show_mac);
|
||||
if(app->state.show_mac == true)
|
||||
variable_item_set_current_value_text(item, "Yes");
|
||||
else
|
||||
variable_item_set_current_value_text(item, "No");
|
||||
|
||||
|
||||
item = variable_item_list_add(
|
||||
var_item_list,
|
||||
"Matthew KuKanich, Thanks to Chapoly1305, WillyJL, OpenHaystack, Testers",
|
||||
|
||||
@@ -49,6 +49,7 @@ bool findmy_scene_config_mac_on_event(void* context, SceneManagerEvent event) {
|
||||
if(app->state.beacon_active) {
|
||||
furi_check(furi_hal_bt_extra_beacon_start());
|
||||
}
|
||||
findmy_main_update_mac(app->findmy_main, app->state.mac);
|
||||
scene_manager_next_scene(app->scene_manager, FindMySceneConfigPacket);
|
||||
break;
|
||||
default:
|
||||
|
||||
Reference in New Issue
Block a user