[FL-2589] RPC App control commands (#1350)
* RPC App control commands * Button release timeout * SubGhz tx fix Co-authored-by: Aleksandr Kutuzov <alleteam@gmail.com>
This commit is contained in:
37
applications/lfrfid/scene/lfrfid_app_scene_rpc.cpp
Normal file
37
applications/lfrfid/scene/lfrfid_app_scene_rpc.cpp
Normal file
@@ -0,0 +1,37 @@
|
||||
#include "lfrfid_app_scene_rpc.h"
|
||||
#include "furi/common_defines.h"
|
||||
#include <dolphin/dolphin.h>
|
||||
|
||||
void LfRfidAppSceneRpc::on_enter(LfRfidApp* app, bool /* need_restore */) {
|
||||
auto popup = app->view_controller.get<PopupVM>();
|
||||
|
||||
popup->set_header("RPC Mode", 64, 30, AlignCenter, AlignTop);
|
||||
|
||||
app->view_controller.switch_to<PopupVM>();
|
||||
|
||||
notification_message(app->notification, &sequence_display_backlight_on);
|
||||
}
|
||||
|
||||
bool LfRfidAppSceneRpc::on_event(LfRfidApp* app, LfRfidApp::Event* event) {
|
||||
UNUSED(app);
|
||||
UNUSED(event);
|
||||
bool consumed = false;
|
||||
|
||||
if(event->type == LfRfidApp::EventType::Exit) {
|
||||
consumed = true;
|
||||
LfRfidApp::Event view_event;
|
||||
view_event.type = LfRfidApp::EventType::Back;
|
||||
app->view_controller.send_event(&view_event);
|
||||
} else if(event->type == LfRfidApp::EventType::EmulateStart) {
|
||||
consumed = true;
|
||||
emulating = true;
|
||||
}
|
||||
return consumed;
|
||||
}
|
||||
|
||||
void LfRfidAppSceneRpc::on_exit(LfRfidApp* app) {
|
||||
if(emulating) {
|
||||
app->worker.stop_emulate();
|
||||
}
|
||||
app->view_controller.get<PopupVM>()->clean();
|
||||
}
|
Reference in New Issue
Block a user