[FL-1371] New LF-RFID app. Second encounter. (#547)

* File worker: file operations helper.
* Notification app: removed yield
* File worker: write operations, calls to system file widgets
* App ibutton: use file worker
* Lfrfid: generic key loading, add path helper and hex conversion to lib
* FileWorker: plain C verison
* FileWorker: add to lib.mk
* FileWorker: add to C sources, instead of CPP
* Lfrfid: save scene
* App lfrfid: add key scene, saved key menu
* App lfrfid: saved key info scene
* App lfrfid: delete key scene
This commit is contained in:
SG
2021-06-30 22:02:46 +10:00
committed by GitHub
parent e8211226f3
commit 7a13391b2b
44 changed files with 1637 additions and 446 deletions

View File

@@ -14,7 +14,7 @@ void LfRfidAppSceneSaveName::on_enter(LfRfidApp* app, bool need_restore) {
text_input->set_header_text("Name the card");
text_input->set_result_callback(
save_callback, app, app->text_store.text, LFRFID_KEY_NAME_SIZE);
save_callback, app, app->text_store.text, app->worker.key.get_name_length());
app->view_controller.switch_to<TextInputVM>();
}
@@ -23,14 +23,18 @@ bool LfRfidAppSceneSaveName::on_event(LfRfidApp* app, LfRfidApp::Event* event) {
bool consumed = false;
if(event->type == LfRfidApp::EventType::Next) {
/*if(app->save_key(app->get_text_store())) {
app->switch_to_next_scene(iButtonApp::Scene::SceneSaveSuccess);
if(strlen(app->worker.key.get_name())) {
app->delete_key(&app->worker.key);
}
app->worker.key.set_name(app->text_store.text);
if(app->save_key(&app->worker.key)) {
app->scene_controller.switch_to_next_scene(LfRfidApp::SceneType::SaveSuccess);
} else {
app->search_and_switch_to_previous_scene(
{iButtonApp::Scene::SceneReadedKeyMenu,
iButtonApp::Scene::SceneSavedKeyMenu,
iButtonApp::Scene::SceneAddType});
}*/
app->scene_controller.search_and_switch_to_previous_scene(
{LfRfidApp::SceneType::ReadedMenu});
}
}
return consumed;