| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150 |
- #pragma once
- #include <stdlib.h> // malloc
- #include <stdint.h> // uint32_t
- #include <stdarg.h> // __VA_ARGS__
- #include <string.h>
- #include <stdio.h>
- #include <furi.h>
- #include <furi_hal.h>
- #include <gui/gui.h>
- #include <gui/view_dispatcher.h>
- #include <gui/scene_manager.h>
- #include <notification/notification_messages.h>
- #include <seader_icons.h>
- #include <assets_icons.h>
- #include <gui/modules/submenu.h>
- #include <gui/modules/popup.h>
- #include <gui/modules/loading.h>
- #include <gui/modules/text_input.h>
- #include <gui/modules/text_box.h>
- #include <gui/modules/widget.h>
- #include <input/input.h>
- #include <lib/nfc/nfc.h>
- #include <nfc/nfc_poller.h>
- #include <nfc/nfc_device.h>
- #include <nfc/helpers/nfc_data_generator.h>
- // ASN1
- #include <asn_system.h>
- #include <asn_internal.h>
- #include <asn_codecs_prim.h>
- #include <asn_codecs.h>
- #include <asn_application.h>
- #include <Payload.h>
- #include <FrameProtocol.h>
- #include "plugin/interface.h"
- #include <flipper_application/flipper_application.h>
- #include <flipper_application/plugins/plugin_manager.h>
- #include <loader/firmware_api/firmware_api.h>
- #include "protocol/picopass_poller.h"
- #include "scenes/seader_scene.h"
- #include "seader_bridge.h"
- #include "seader.h"
- #include "ccid.h"
- #include "uart.h"
- #include "lrc.h"
- #include "seader_worker.h"
- #include "seader_credential.h"
- #define WORKER_ALL_RX_EVENTS \
- (WorkerEvtStop | WorkerEvtRxDone | WorkerEvtCfgChange | WorkerEvtLineCfgSet | \
- WorkerEvtCtrlLineSet | WorkerEvtSamTxComplete)
- #define WORKER_ALL_TX_EVENTS (WorkerEvtTxStop | WorkerEvtSamRx)
- #define SEADER_TEXT_STORE_SIZE 128
- enum SeaderCustomEvent {
- // Reserve first 100 events for button types and indexes, starting from 0
- SeaderCustomEventReserved = 100,
- SeaderCustomEventViewExit,
- SeaderCustomEventWorkerExit,
- SeaderCustomEventByteInputDone,
- SeaderCustomEventTextInputDone,
- SeaderCustomEventPollerDetect,
- SeaderCustomEventPollerSuccess,
- };
- typedef enum {
- WorkerEvtStop = (1 << 0),
- WorkerEvtRxDone = (1 << 1),
- WorkerEvtTxStop = (1 << 2),
- WorkerEvtSamRx = (1 << 3),
- WorkerEvtSamTxComplete = (1 << 4),
- WorkerEvtCfgChange = (1 << 5),
- WorkerEvtLineCfgSet = (1 << 6),
- WorkerEvtCtrlLineSet = (1 << 7),
- } WorkerEvtFlags;
- struct Seader {
- bool revert_power;
- bool is_debug_enabled;
- SeaderWorker* worker;
- ViewDispatcher* view_dispatcher;
- Gui* gui;
- NotificationApp* notifications;
- SceneManager* scene_manager;
- SeaderUartBridge* uart;
- SeaderCredential* credential;
- SamCommand_PR samCommand;
- char text_store[SEADER_TEXT_STORE_SIZE + 1];
- FuriString* text_box_store;
- // Common Views
- Submenu* submenu;
- Popup* popup;
- Loading* loading;
- TextInput* text_input;
- TextBox* text_box;
- Widget* widget;
- Nfc* nfc;
- NfcPoller* poller;
- PicopassPoller* picopass_poller;
- NfcDevice* nfc_device;
- PluginManager* plugin_manager;
- PluginWiegand* plugin_wiegand;
- };
- struct SeaderPollerContainer {
- Iso14443_4aPoller* iso14443_4a_poller;
- MfClassicPoller* mfc_poller;
- PicopassPoller* picopass_poller;
- };
- typedef enum {
- SeaderViewMenu,
- SeaderViewPopup,
- SeaderViewLoading,
- SeaderViewTextInput,
- SeaderViewTextBox,
- SeaderViewWidget,
- SeaderViewUart,
- } SeaderView;
- void seader_text_store_set(Seader* seader, const char* text, ...);
- void seader_text_store_clear(Seader* seader);
- void seader_blink_start(Seader* seader);
- void seader_blink_stop(Seader* seader);
- void seader_show_loading_popup(void* context, bool show);
|