mirror of
https://github.com/Next-Flip/Momentum-Firmware.git
synced 2026-05-10 05:59:08 -07:00
Format + cleanup
This commit is contained in:
@@ -92,7 +92,7 @@ static void findmy_start(FindMy* app) {
|
||||
uint8_t* it = data;
|
||||
|
||||
// For Apple AirTags
|
||||
*it++ = 0x1E, // Length
|
||||
*it++ = 0x1E; // Length
|
||||
*it++ = 0xFF; // Manufacturer Specific Data
|
||||
*it++ = 0x4C; // Company ID (Apple, Inc.)
|
||||
*it++ = 0x00; // State
|
||||
|
||||
@@ -58,7 +58,12 @@ void findmy_scene_config_on_enter(void* context) {
|
||||
variable_item_set_current_value_text(item, transmit_power_s);
|
||||
|
||||
item = variable_item_list_add(var_item_list, "Register Tag", 0, NULL, NULL);
|
||||
item = variable_item_list_add(var_item_list, "Matthew KuKanich, Thanks to Chapoly1305, WillyJL, OpenHaystack, Testers", 1, NULL, NULL);
|
||||
item = variable_item_list_add(
|
||||
var_item_list,
|
||||
"Matthew KuKanich, Thanks to Chapoly1305, WillyJL, OpenHaystack, Testers",
|
||||
1,
|
||||
NULL,
|
||||
NULL);
|
||||
variable_item_set_current_value_text(item, "Credits");
|
||||
|
||||
variable_item_list_set_enter_callback(var_item_list, findmy_scene_config_callback, app);
|
||||
|
||||
@@ -56,5 +56,4 @@ void findmy_scene_config_mac_on_exit(void* context) {
|
||||
|
||||
byte_input_set_result_callback(app->byte_input, NULL, NULL, NULL, NULL, 0);
|
||||
byte_input_set_header_text(app->byte_input, "");
|
||||
|
||||
}
|
||||
@@ -40,8 +40,9 @@ bool findmy_scene_config_packet_on_event(void* context, SceneManagerEvent event)
|
||||
case ByteInputResultOk:
|
||||
scene_manager_search_and_switch_to_previous_scene(
|
||||
app->scene_manager, FindMySceneConfig);
|
||||
furi_check(furi_hal_bt_extra_beacon_set_data(app->packet_buf, sizeof(app->packet_buf)));
|
||||
if (app->packet_buf[0] == 0x1E && app->packet_buf[3] == 0x00) {
|
||||
furi_check(
|
||||
furi_hal_bt_extra_beacon_set_data(app->packet_buf, sizeof(app->packet_buf)));
|
||||
if(app->packet_buf[0] == 0x1E && app->packet_buf[3] == 0x00) {
|
||||
app->apple = true; // Checks payload data for Apple identifier
|
||||
} else {
|
||||
app->apple = false;
|
||||
|
||||
@@ -34,7 +34,7 @@ static void findmy_main_draw_callback(Canvas* canvas, void* _model) {
|
||||
snprintf(interval_str, sizeof(interval_str), "Ping Interval: %ds", model->interval);
|
||||
canvas_draw_str(canvas, 4, 62, interval_str);
|
||||
canvas_set_font(canvas, FontPrimary);
|
||||
if(model->apple){
|
||||
if(model->apple) {
|
||||
canvas_draw_str(canvas, 4, 32, "Apple Network");
|
||||
canvas_draw_icon(canvas, 80, 24, &I_Lock_7x8);
|
||||
} else {
|
||||
@@ -56,30 +56,32 @@ static bool findmy_main_input_callback(InputEvent* event, void* context) {
|
||||
|
||||
if(event->type == InputTypePress) {
|
||||
consumed = true;
|
||||
// FIXME: finish implementing handlers in scene side
|
||||
FindMyMainEvent event;
|
||||
|
||||
switch(event->key) {
|
||||
case InputKeyBack:
|
||||
findmy_main->callback(FindMyMainEventQuit, findmy_main->context);
|
||||
// furi_hal_bt_extra_beacon_stop();
|
||||
event = FindMyMainEventQuit;
|
||||
break;
|
||||
case InputKeyOk:
|
||||
findmy_main->callback(FindMyMainEventToggle, findmy_main->context);
|
||||
event = FindMyMainEventToggle;
|
||||
break;
|
||||
case InputKeyLeft:
|
||||
findmy_main->callback(FindMyMainEventBackground, findmy_main->context);
|
||||
event = FindMyMainEventBackground;
|
||||
break;
|
||||
case InputKeyRight:
|
||||
findmy_main->callback(FindMyMainEventConfig, findmy_main->context);
|
||||
event = FindMyMainEventConfig;
|
||||
break;
|
||||
case InputKeyUp:
|
||||
findmy_main->callback(FindMyMainEventIntervalUp, findmy_main->context);
|
||||
event = FindMyMainEventIntervalUp;
|
||||
break;
|
||||
case InputKeyDown:
|
||||
findmy_main->callback(FindMyMainEventIntervalDown, findmy_main->context);
|
||||
event = FindMyMainEventIntervalDown;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
return consumed;
|
||||
}
|
||||
|
||||
findmy_main->callback(event, findmy_main->context);
|
||||
}
|
||||
|
||||
return consumed;
|
||||
|
||||
Reference in New Issue
Block a user