-
-
Notifications
You must be signed in to change notification settings - Fork 215
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
FindMyFlipper: Add Tile Support, Save Tag Type, Dynamic Data Length (#41
- Loading branch information
Showing
12 changed files
with
153 additions
and
48 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,3 @@ | ||
#pragma once | ||
|
||
typedef struct FindMy FindMy; | ||
|
||
typedef enum FindMyType FindMyType; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
70 changes: 70 additions & 0 deletions
70
applications/system/findmy/scenes/findmy_scene_config_tagtype.c
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
#include "../findmy_i.h" | ||
|
||
enum VarItemListIndex { | ||
VarItemListIndexApple, | ||
VarItemListIndexSamsung, | ||
VarItemListIndexTile, | ||
}; | ||
|
||
void findmy_scene_config_tagtype_callback(void* context, uint32_t index) { | ||
furi_assert(context); | ||
FindMy* app = context; | ||
view_dispatcher_send_custom_event(app->view_dispatcher, index); | ||
} | ||
|
||
void findmy_scene_config_tagtype_on_enter(void* context) { | ||
FindMy* app = context; | ||
VariableItemList* var_item_list = app->var_item_list; | ||
VariableItem* item; | ||
|
||
variable_item_list_set_header(var_item_list, "Choose tag type"); | ||
|
||
item = variable_item_list_add(var_item_list, "Apple AirTag", 0, NULL, NULL); | ||
|
||
item = variable_item_list_add(var_item_list, "Samsung SmartTag", 0, NULL, NULL); | ||
|
||
item = variable_item_list_add(var_item_list, "Tile SmartTag", 0, NULL, NULL); | ||
|
||
UNUSED(item); | ||
|
||
variable_item_list_set_enter_callback( | ||
var_item_list, findmy_scene_config_tagtype_callback, app); | ||
|
||
variable_item_list_set_selected_item( | ||
var_item_list, scene_manager_get_scene_state(app->scene_manager, FindMySceneConfigImport)); | ||
view_dispatcher_switch_to_view(app->view_dispatcher, FindMyViewVarItemList); | ||
} | ||
|
||
bool findmy_scene_config_tagtype_on_event(void* context, SceneManagerEvent event) { | ||
FindMy* app = context; | ||
bool consumed = false; | ||
|
||
if(event.type == SceneManagerEventTypeCustom) { | ||
scene_manager_set_scene_state(app->scene_manager, FindMySceneConfigTagtype, event.event); | ||
consumed = true; | ||
|
||
switch(event.event) { | ||
case VarItemListIndexApple: | ||
findmy_set_tag_type(app, FindMyTypeApple); | ||
break; | ||
case VarItemListIndexSamsung: | ||
findmy_set_tag_type(app, FindMyTypeSamsung); | ||
break; | ||
case VarItemListIndexTile: | ||
findmy_set_tag_type(app, FindMyTypeTile); | ||
break; | ||
default: | ||
break; | ||
} | ||
scene_manager_next_scene(app->scene_manager, FindMySceneConfigImport); | ||
} | ||
|
||
return consumed; | ||
} | ||
|
||
void findmy_scene_config_tagtype_on_exit(void* context) { | ||
FindMy* app = context; | ||
VariableItemList* var_item_list = app->var_item_list; | ||
|
||
variable_item_list_reset(var_item_list); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,7 @@ | ||
ADD_SCENE(findmy, main, Main) | ||
ADD_SCENE(findmy, config, Config) | ||
ADD_SCENE(findmy, config_import, ConfigImport) | ||
ADD_SCENE(findmy, config_tagtype, ConfigTagtype) | ||
ADD_SCENE(findmy, config_import_result, ConfigImportResult) | ||
ADD_SCENE(findmy, config_mac, ConfigMac) | ||
ADD_SCENE(findmy, config_packet, ConfigPacket) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,7 @@ | ||
#pragma once | ||
|
||
#include "../findmy.h" | ||
#include "../findmy_state.h" | ||
#include <gui/view.h> | ||
|
||
typedef enum { | ||
|