 52b5966262
			
		
	
	
		52b5966262
		
			
		
	
	
	
	
		
			
			* added filename mode setting * added furi_flag checks for when filename_mode is set * changed naming for ibutton, lfrfid and subghz * requested changes from PR * Lib: gather all naming bits and pieces under name generator module. Properly bump api version. FuriHal: fix RTC flag enum. * PR requested changes * bug fix for arg type * added functionality for other application scenes * Lib: cleanup name generator API, simplify usage. Sync API symbols. * Lib: proper size type in name_generator. Cleanup. * FuriHal: cleanup rtc api usage across firmware Co-authored-by: あく <alleteam@gmail.com>
		
			
				
	
	
		
			101 lines
		
	
	
		
			2.6 KiB
		
	
	
	
		
			C
		
	
	
	
	
	
			
		
		
	
	
			101 lines
		
	
	
		
			2.6 KiB
		
	
	
	
		
			C
		
	
	
	
	
	
| #pragma once
 | |
| 
 | |
| #include "ibutton.h"
 | |
| 
 | |
| #include <gui/gui.h>
 | |
| #include <gui/view.h>
 | |
| #include <gui/scene_manager.h>
 | |
| #include <gui/view_dispatcher.h>
 | |
| 
 | |
| #include <ibutton/ibutton_worker.h>
 | |
| #include <ibutton/ibutton_protocols.h>
 | |
| 
 | |
| #include <rpc/rpc_app.h>
 | |
| #include <storage/storage.h>
 | |
| #include <dialogs/dialogs.h>
 | |
| #include <notification/notification.h>
 | |
| #include <notification/notification_messages.h>
 | |
| 
 | |
| #include <gui/modules/submenu.h>
 | |
| #include <gui/modules/popup.h>
 | |
| #include <gui/modules/text_input.h>
 | |
| #include <gui/modules/byte_input.h>
 | |
| #include <gui/modules/widget.h>
 | |
| #include <gui/modules/loading.h>
 | |
| 
 | |
| #include <assets_icons.h>
 | |
| 
 | |
| #include "ibutton_custom_event.h"
 | |
| #include "scenes/ibutton_scene.h"
 | |
| 
 | |
| #define IBUTTON_APP_FOLDER ANY_PATH("ibutton")
 | |
| #define IBUTTON_APP_FILENAME_PREFIX "iBtn"
 | |
| #define IBUTTON_APP_FILENAME_EXTENSION ".ibtn"
 | |
| 
 | |
| #define IBUTTON_KEY_NAME_SIZE 22
 | |
| 
 | |
| typedef enum {
 | |
|     iButtonWriteModeInvalid,
 | |
|     iButtonWriteModeBlank,
 | |
|     iButtonWriteModeCopy,
 | |
| } iButtonWriteMode;
 | |
| 
 | |
| struct iButton {
 | |
|     SceneManager* scene_manager;
 | |
|     ViewDispatcher* view_dispatcher;
 | |
| 
 | |
|     Gui* gui;
 | |
|     Storage* storage;
 | |
|     DialogsApp* dialogs;
 | |
|     NotificationApp* notifications;
 | |
|     RpcAppSystem* rpc;
 | |
| 
 | |
|     iButtonKey* key;
 | |
|     iButtonWorker* worker;
 | |
|     iButtonProtocols* protocols;
 | |
|     iButtonWriteMode write_mode;
 | |
| 
 | |
|     FuriString* file_path;
 | |
|     char key_name[IBUTTON_KEY_NAME_SIZE + 1];
 | |
| 
 | |
|     Submenu* submenu;
 | |
|     ByteInput* byte_input;
 | |
|     TextInput* text_input;
 | |
|     Popup* popup;
 | |
|     Widget* widget;
 | |
|     Loading* loading;
 | |
| };
 | |
| 
 | |
| typedef enum {
 | |
|     iButtonViewSubmenu,
 | |
|     iButtonViewByteInput,
 | |
|     iButtonViewTextInput,
 | |
|     iButtonViewPopup,
 | |
|     iButtonViewWidget,
 | |
|     iButtonViewLoading,
 | |
| } iButtonView;
 | |
| 
 | |
| typedef enum {
 | |
|     iButtonNotificationMessageError,
 | |
|     iButtonNotificationMessageSuccess,
 | |
|     iButtonNotificationMessageReadStart,
 | |
|     iButtonNotificationMessageEmulateStart,
 | |
|     iButtonNotificationMessageYellowBlink,
 | |
|     iButtonNotificationMessageEmulateBlink,
 | |
|     iButtonNotificationMessageRedOn,
 | |
|     iButtonNotificationMessageRedOff,
 | |
|     iButtonNotificationMessageGreenOn,
 | |
|     iButtonNotificationMessageGreenOff,
 | |
|     iButtonNotificationMessageBlinkStop,
 | |
| } iButtonNotificationMessage;
 | |
| 
 | |
| bool ibutton_select_and_load_key(iButton* ibutton);
 | |
| bool ibutton_load_key(iButton* ibutton);
 | |
| bool ibutton_save_key(iButton* ibutton);
 | |
| bool ibutton_delete_key(iButton* ibutton);
 | |
| void ibutton_reset_key(iButton* ibutton);
 | |
| void ibutton_notification_message(iButton* ibutton, uint32_t message);
 | |
| 
 | |
| void ibutton_submenu_callback(void* context, uint32_t index);
 | |
| void ibutton_widget_callback(GuiButtonType result, InputType type, void* context);
 |