Skip to content

Commit

Permalink
Format + cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
Willy-JL committed Mar 8, 2024
1 parent aa15ee6 commit 1941da7
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 15 deletions.
2 changes: 1 addition & 1 deletion applications/system/findmy/findmy.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
7 changes: 6 additions & 1 deletion applications/system/findmy/scenes/findmy_scene_config.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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, "");

}
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
22 changes: 12 additions & 10 deletions applications/system/findmy/views/findmy_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand All @@ -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;
Expand Down

0 comments on commit 1941da7

Please sign in to comment.