new iButton app (#328)
* rename old ibutton app to ibutton-test
* more renames
* updated onewire library compilation condition
* add submenu_clean subroutine
* add index for submenu callback
* c++ guard for gui modules
* add released ibutton app
* fix the position of the submenu window if there are too few items
* iButton app basis
* negative icon position info
* fix submenu_clean subroutine
* add ibutton app to applications makefile
* add onewire key read routine to read mode
* rename mode to scene
* rename files and folder (mode to scene)
* rename ibutton view to view manager
* rename get_view to get_view_manager
* cpp guards
* key read, store and notify features
* syntax fix
* make iButtonScene functions pure virtual
* fix syntax
* add text store, add new scene (crc error)
* not a key scene
* syntax fix
* read success scene
* app, switching to the previous scene with the number of scenes to be skipped
* scene whith menu when key is readed
* fix font height calculation, fix offsets
* add key write scene
* view_dispatcher_remove_view subroutine
* generic pause/resume os methods
* fix furi_assert usage
* key store, worker
* fix pointer comparsion
* saved keys, saved key action scenes
* key delete/confirm delete scenes and routines
* use last input subsystem changes
* fix syntax
* fix new model usage in submenu
* fix includes
* use vibro pin
* use stored key name if valid
* emulate scene
* random name generator
* name and save readed key scenes, new icon
* fix icon position
* fix text scene exit
* fix naming, fix text placement, new info scene
* state-driven cyfral decoder
* better cyfral decoder
* better cyfral decoder
* one wire: search command set
* metakom decoder
* more key types
* add next scene to error scenes
* universal key reader
* use new key reader
* syntax fix
* warning fix
* byte input module template
* new thread and insomnia api usage
* New element: slightly rounded frame
* Use elements_slightly_rounded_frame in text input
* Gui test app: byte input usage
* Byte input module: data drawing and selection
* Byte input: comment currently unused fns
* remove volatile qualifier
* base byte input realisation
* App gui test: remove internal fns visibility
* Byne input, final version
* test install gcc-arm-none-eabi-10-2020-q4-major
* test install gcc-arm-none-eabi-10-2020-q4-major
* App iButton: byte input view managment
* App iButton: add key manually scenes
* App iButton: rename scenes, add popup timeout
* App iButton: use new scenes, new fn for rollback to specific prevous scene.
* App iButton: remove byte input view on app exit
* App iButton: edit key scene
* Module byte input: reduce swintch value to uint8_t
* Module byte input: switch from switch-case to if, unfortunately we need compile-time constants to use with switch
* Icons: new small arrows
* Module byte input: new arrangement of elements
* OneWire slave lib: fix deattach sequence
* App iButton: pulse sequencer
* App iButton: add more keys to store
* App iButton: split key worker to separate read/write/emulate entitys
* App iButton: use new read/emulate entities
* fix callback pointer saving
* App iButton: use KeyReader error enum instead of KeyWorker error list handling
* App iButton: do not use insomnia fns in pulse sequencer
* App iButton: use KeyReader error enum in read scene
* OneWire slave lib: more READ ROM command variants, call callback only if positive result
* GPIO resources: add external gpio
* App SD/NFC: removed application
* App iButton-test: update to new light api
* App iButton: update to new light-api
* Outdated apps: add api-light-usage
* Gpio: update SD card CS pin settings
* API-power: added fns to disable/enable external 3v3 dc-dc
* API-gpio: separated SD card detect routines
* Resources: removed sd cs pin
* SD card: low level init now resets card power supply
* App SD-filesystem: use new card detect fns
* SD card: fix low level init headers
* SD card: more realilable low level init, power reset, exit from command read cycle conditionally
* App SD-filesystem: led notifiers, init cycling
* SD card: backport to F4
* Api PWM: add c++ guards
* App iButton: yellow blink in emulate scene, vibro on
* App iButton: one wire keys command set
* App iButton: successful write scene
* App iButton: key writer
* App iButton: syntax fix
* App iButton: notify write success
* App iButton: fix double scene change
* SD card: handle eject in init sequence
* SD card: api to set level on detect gpio
* SPI: api to set state on bus pins
* SD card: set low state on bus pins while power reset
* File select: init
* File select: fix input consuming
* SD Card: fixed dir open api error
* SD-card: replace strncpy by strlcpy. Fix buffer overflow error.
* API HAL OS: replace CMP based ticks with ARR based one, hard reset lptimer on reconfiguration.
* GUI: More stack size for (temporary, wee need to implement sd card api in separate thread)
* GUI: File select module.
* App iButton-test: remove obsolete app
Co-authored-by: rusdacent <rusdacentx0x08@gmail.com>
Co-authored-by: coreglitch <mail@s3f.ru>
Co-authored-by: Aleksandr Kutuzov <alleteam@gmail.com>
2021-03-12 12:45:18 +00:00
|
|
|
#include "ibutton-app.h"
|
|
|
|
#include <stdarg.h>
|
2021-04-14 14:24:33 +00:00
|
|
|
#include <callback-connector.h>
|
|
|
|
#include <m-string.h>
|
2021-06-30 12:02:46 +00:00
|
|
|
#include <file-worker-cpp.h>
|
2021-07-15 21:39:21 +00:00
|
|
|
#include <path.h>
|
new iButton app (#328)
* rename old ibutton app to ibutton-test
* more renames
* updated onewire library compilation condition
* add submenu_clean subroutine
* add index for submenu callback
* c++ guard for gui modules
* add released ibutton app
* fix the position of the submenu window if there are too few items
* iButton app basis
* negative icon position info
* fix submenu_clean subroutine
* add ibutton app to applications makefile
* add onewire key read routine to read mode
* rename mode to scene
* rename files and folder (mode to scene)
* rename ibutton view to view manager
* rename get_view to get_view_manager
* cpp guards
* key read, store and notify features
* syntax fix
* make iButtonScene functions pure virtual
* fix syntax
* add text store, add new scene (crc error)
* not a key scene
* syntax fix
* read success scene
* app, switching to the previous scene with the number of scenes to be skipped
* scene whith menu when key is readed
* fix font height calculation, fix offsets
* add key write scene
* view_dispatcher_remove_view subroutine
* generic pause/resume os methods
* fix furi_assert usage
* key store, worker
* fix pointer comparsion
* saved keys, saved key action scenes
* key delete/confirm delete scenes and routines
* use last input subsystem changes
* fix syntax
* fix new model usage in submenu
* fix includes
* use vibro pin
* use stored key name if valid
* emulate scene
* random name generator
* name and save readed key scenes, new icon
* fix icon position
* fix text scene exit
* fix naming, fix text placement, new info scene
* state-driven cyfral decoder
* better cyfral decoder
* better cyfral decoder
* one wire: search command set
* metakom decoder
* more key types
* add next scene to error scenes
* universal key reader
* use new key reader
* syntax fix
* warning fix
* byte input module template
* new thread and insomnia api usage
* New element: slightly rounded frame
* Use elements_slightly_rounded_frame in text input
* Gui test app: byte input usage
* Byte input module: data drawing and selection
* Byte input: comment currently unused fns
* remove volatile qualifier
* base byte input realisation
* App gui test: remove internal fns visibility
* Byne input, final version
* test install gcc-arm-none-eabi-10-2020-q4-major
* test install gcc-arm-none-eabi-10-2020-q4-major
* App iButton: byte input view managment
* App iButton: add key manually scenes
* App iButton: rename scenes, add popup timeout
* App iButton: use new scenes, new fn for rollback to specific prevous scene.
* App iButton: remove byte input view on app exit
* App iButton: edit key scene
* Module byte input: reduce swintch value to uint8_t
* Module byte input: switch from switch-case to if, unfortunately we need compile-time constants to use with switch
* Icons: new small arrows
* Module byte input: new arrangement of elements
* OneWire slave lib: fix deattach sequence
* App iButton: pulse sequencer
* App iButton: add more keys to store
* App iButton: split key worker to separate read/write/emulate entitys
* App iButton: use new read/emulate entities
* fix callback pointer saving
* App iButton: use KeyReader error enum instead of KeyWorker error list handling
* App iButton: do not use insomnia fns in pulse sequencer
* App iButton: use KeyReader error enum in read scene
* OneWire slave lib: more READ ROM command variants, call callback only if positive result
* GPIO resources: add external gpio
* App SD/NFC: removed application
* App iButton-test: update to new light api
* App iButton: update to new light-api
* Outdated apps: add api-light-usage
* Gpio: update SD card CS pin settings
* API-power: added fns to disable/enable external 3v3 dc-dc
* API-gpio: separated SD card detect routines
* Resources: removed sd cs pin
* SD card: low level init now resets card power supply
* App SD-filesystem: use new card detect fns
* SD card: fix low level init headers
* SD card: more realilable low level init, power reset, exit from command read cycle conditionally
* App SD-filesystem: led notifiers, init cycling
* SD card: backport to F4
* Api PWM: add c++ guards
* App iButton: yellow blink in emulate scene, vibro on
* App iButton: one wire keys command set
* App iButton: successful write scene
* App iButton: key writer
* App iButton: syntax fix
* App iButton: notify write success
* App iButton: fix double scene change
* SD card: handle eject in init sequence
* SD card: api to set level on detect gpio
* SPI: api to set state on bus pins
* SD card: set low state on bus pins while power reset
* File select: init
* File select: fix input consuming
* SD Card: fixed dir open api error
* SD-card: replace strncpy by strlcpy. Fix buffer overflow error.
* API HAL OS: replace CMP based ticks with ARR based one, hard reset lptimer on reconfiguration.
* GUI: More stack size for (temporary, wee need to implement sd card api in separate thread)
* GUI: File select module.
* App iButton-test: remove obsolete app
Co-authored-by: rusdacent <rusdacentx0x08@gmail.com>
Co-authored-by: coreglitch <mail@s3f.ru>
Co-authored-by: Aleksandr Kutuzov <alleteam@gmail.com>
2021-03-12 12:45:18 +00:00
|
|
|
|
[FL-1191][FL-1524] Filesystem rework (#568)
* FS-Api: removed datetime manipulation functions and most of the file flags
* Filesystem: common proxy api
* Filesystem: renamed to Storage. Work has begun on a glue layer. Added functions for reentrance.
* Storage: sd mount and sd file open
* Storage: sd file close
* Storage: temporary test app
* Storage: free filedata on close
* Storage: sd file read and write
* Storage: added internal storage (LittleFS)
* Storage: renamed internal commands
* Storage: seek, tell, truncate, size, sync, eof
* Storage: error descriptions
* Storage: directory management api (open, close, read, rewind)
* Storage: common management api (stat, fs_stat, remove, rename, mkdir)
* Dolphin app and Notifications app now use raw storage.
* Storage: storage statuses renamed. Implemented sd card icon.
* Storage: added raw sd-card api.
* Storage settings: work started
* Assets: use new icons approach
* Storage settings: working storage settings
* Storage: completely redesigned api, no longer sticking out FS_Api
* Storage: more simplified api, getting error_id from file is hidden from user, pointer to api is hidden inside file
* Storage: cli info and format commands
* Storage-cli: file list
* Storage: a simpler and more reliable api
* FatFS: slightly lighter and faster config. Also disabled reentrancy and file locking functions. They moved to a storage service.
* Storage-cli: accommodate to the new cli api.
* Storage: filesystem api is separated into internal and common api.
* Cli: added the ability to print the list of free heap blocks
* Storage: uses a list instead of an array to store the StorageFile. Rewrote api calls to use semaphores instead of thread flags.
* Storage settings: added the ability to benchmark the SD card.
* Gui module file select: uses new storage api
* Apps: removed deprecated sd_card_test application
* Args lib: support for enquoted arguments
* Dialogs: a new gui app for simple non-asynchronous apps
* Dialogs: view holder for easy single view work
* File worker: use new storage api
* IButton and lfrrfid apps: save keys to any storage
* Apps: fix ibutton and lfrfid stack, remove sd_card_test.
* SD filesystem: app removed
* File worker: fixed api pointer type
* Subghz: loading assets using the new storage api
* NFC: use the new storage api
* Dialogs: the better api for the message element
* Archive: use new storage api
* Irda: changed assest path, changed app path
* FileWorker: removed unused file_buf_cnt
* Storage: copying and renaming files now works between storages
* Storage cli: read, copy, remove, rename commands
* Archive: removed commented code
* Storage cli: write command
* Applications: add SRV_STORAGE and SRV_DIALOGS
* Internal-storage: removed
* Storage: improved api
* Storage app: changed api pointer from StorageApp to Storage
* Storage: better file_id handling
* Storage: more consistent errors
* Loader: support for NULL icons
* Storage: do nothing with the lfs file or directory if it is not open
* Storage: fix typo
* Storage: minor float usage cleanup, rename some symbols.
* Storage: compact doxygen comments.
Co-authored-by: あく <alleteam@gmail.com>
2021-07-23 12:20:19 +00:00
|
|
|
const char* iButtonApp::app_folder = "/any/ibutton";
|
2021-05-26 16:50:16 +00:00
|
|
|
const char* iButtonApp::app_extension = ".ibtn";
|
|
|
|
|
2021-06-24 11:32:33 +00:00
|
|
|
void iButtonApp::run(void* args) {
|
new iButton app (#328)
* rename old ibutton app to ibutton-test
* more renames
* updated onewire library compilation condition
* add submenu_clean subroutine
* add index for submenu callback
* c++ guard for gui modules
* add released ibutton app
* fix the position of the submenu window if there are too few items
* iButton app basis
* negative icon position info
* fix submenu_clean subroutine
* add ibutton app to applications makefile
* add onewire key read routine to read mode
* rename mode to scene
* rename files and folder (mode to scene)
* rename ibutton view to view manager
* rename get_view to get_view_manager
* cpp guards
* key read, store and notify features
* syntax fix
* make iButtonScene functions pure virtual
* fix syntax
* add text store, add new scene (crc error)
* not a key scene
* syntax fix
* read success scene
* app, switching to the previous scene with the number of scenes to be skipped
* scene whith menu when key is readed
* fix font height calculation, fix offsets
* add key write scene
* view_dispatcher_remove_view subroutine
* generic pause/resume os methods
* fix furi_assert usage
* key store, worker
* fix pointer comparsion
* saved keys, saved key action scenes
* key delete/confirm delete scenes and routines
* use last input subsystem changes
* fix syntax
* fix new model usage in submenu
* fix includes
* use vibro pin
* use stored key name if valid
* emulate scene
* random name generator
* name and save readed key scenes, new icon
* fix icon position
* fix text scene exit
* fix naming, fix text placement, new info scene
* state-driven cyfral decoder
* better cyfral decoder
* better cyfral decoder
* one wire: search command set
* metakom decoder
* more key types
* add next scene to error scenes
* universal key reader
* use new key reader
* syntax fix
* warning fix
* byte input module template
* new thread and insomnia api usage
* New element: slightly rounded frame
* Use elements_slightly_rounded_frame in text input
* Gui test app: byte input usage
* Byte input module: data drawing and selection
* Byte input: comment currently unused fns
* remove volatile qualifier
* base byte input realisation
* App gui test: remove internal fns visibility
* Byne input, final version
* test install gcc-arm-none-eabi-10-2020-q4-major
* test install gcc-arm-none-eabi-10-2020-q4-major
* App iButton: byte input view managment
* App iButton: add key manually scenes
* App iButton: rename scenes, add popup timeout
* App iButton: use new scenes, new fn for rollback to specific prevous scene.
* App iButton: remove byte input view on app exit
* App iButton: edit key scene
* Module byte input: reduce swintch value to uint8_t
* Module byte input: switch from switch-case to if, unfortunately we need compile-time constants to use with switch
* Icons: new small arrows
* Module byte input: new arrangement of elements
* OneWire slave lib: fix deattach sequence
* App iButton: pulse sequencer
* App iButton: add more keys to store
* App iButton: split key worker to separate read/write/emulate entitys
* App iButton: use new read/emulate entities
* fix callback pointer saving
* App iButton: use KeyReader error enum instead of KeyWorker error list handling
* App iButton: do not use insomnia fns in pulse sequencer
* App iButton: use KeyReader error enum in read scene
* OneWire slave lib: more READ ROM command variants, call callback only if positive result
* GPIO resources: add external gpio
* App SD/NFC: removed application
* App iButton-test: update to new light api
* App iButton: update to new light-api
* Outdated apps: add api-light-usage
* Gpio: update SD card CS pin settings
* API-power: added fns to disable/enable external 3v3 dc-dc
* API-gpio: separated SD card detect routines
* Resources: removed sd cs pin
* SD card: low level init now resets card power supply
* App SD-filesystem: use new card detect fns
* SD card: fix low level init headers
* SD card: more realilable low level init, power reset, exit from command read cycle conditionally
* App SD-filesystem: led notifiers, init cycling
* SD card: backport to F4
* Api PWM: add c++ guards
* App iButton: yellow blink in emulate scene, vibro on
* App iButton: one wire keys command set
* App iButton: successful write scene
* App iButton: key writer
* App iButton: syntax fix
* App iButton: notify write success
* App iButton: fix double scene change
* SD card: handle eject in init sequence
* SD card: api to set level on detect gpio
* SPI: api to set state on bus pins
* SD card: set low state on bus pins while power reset
* File select: init
* File select: fix input consuming
* SD Card: fixed dir open api error
* SD-card: replace strncpy by strlcpy. Fix buffer overflow error.
* API HAL OS: replace CMP based ticks with ARR based one, hard reset lptimer on reconfiguration.
* GUI: More stack size for (temporary, wee need to implement sd card api in separate thread)
* GUI: File select module.
* App iButton-test: remove obsolete app
Co-authored-by: rusdacent <rusdacentx0x08@gmail.com>
Co-authored-by: coreglitch <mail@s3f.ru>
Co-authored-by: Aleksandr Kutuzov <alleteam@gmail.com>
2021-03-12 12:45:18 +00:00
|
|
|
iButtonEvent event;
|
|
|
|
bool consumed;
|
|
|
|
bool exit = false;
|
|
|
|
|
[FL-1191][FL-1524] Filesystem rework (#568)
* FS-Api: removed datetime manipulation functions and most of the file flags
* Filesystem: common proxy api
* Filesystem: renamed to Storage. Work has begun on a glue layer. Added functions for reentrance.
* Storage: sd mount and sd file open
* Storage: sd file close
* Storage: temporary test app
* Storage: free filedata on close
* Storage: sd file read and write
* Storage: added internal storage (LittleFS)
* Storage: renamed internal commands
* Storage: seek, tell, truncate, size, sync, eof
* Storage: error descriptions
* Storage: directory management api (open, close, read, rewind)
* Storage: common management api (stat, fs_stat, remove, rename, mkdir)
* Dolphin app and Notifications app now use raw storage.
* Storage: storage statuses renamed. Implemented sd card icon.
* Storage: added raw sd-card api.
* Storage settings: work started
* Assets: use new icons approach
* Storage settings: working storage settings
* Storage: completely redesigned api, no longer sticking out FS_Api
* Storage: more simplified api, getting error_id from file is hidden from user, pointer to api is hidden inside file
* Storage: cli info and format commands
* Storage-cli: file list
* Storage: a simpler and more reliable api
* FatFS: slightly lighter and faster config. Also disabled reentrancy and file locking functions. They moved to a storage service.
* Storage-cli: accommodate to the new cli api.
* Storage: filesystem api is separated into internal and common api.
* Cli: added the ability to print the list of free heap blocks
* Storage: uses a list instead of an array to store the StorageFile. Rewrote api calls to use semaphores instead of thread flags.
* Storage settings: added the ability to benchmark the SD card.
* Gui module file select: uses new storage api
* Apps: removed deprecated sd_card_test application
* Args lib: support for enquoted arguments
* Dialogs: a new gui app for simple non-asynchronous apps
* Dialogs: view holder for easy single view work
* File worker: use new storage api
* IButton and lfrrfid apps: save keys to any storage
* Apps: fix ibutton and lfrfid stack, remove sd_card_test.
* SD filesystem: app removed
* File worker: fixed api pointer type
* Subghz: loading assets using the new storage api
* NFC: use the new storage api
* Dialogs: the better api for the message element
* Archive: use new storage api
* Irda: changed assest path, changed app path
* FileWorker: removed unused file_buf_cnt
* Storage: copying and renaming files now works between storages
* Storage cli: read, copy, remove, rename commands
* Archive: removed commented code
* Storage cli: write command
* Applications: add SRV_STORAGE and SRV_DIALOGS
* Internal-storage: removed
* Storage: improved api
* Storage app: changed api pointer from StorageApp to Storage
* Storage: better file_id handling
* Storage: more consistent errors
* Loader: support for NULL icons
* Storage: do nothing with the lfs file or directory if it is not open
* Storage: fix typo
* Storage: minor float usage cleanup, rename some symbols.
* Storage: compact doxygen comments.
Co-authored-by: あく <alleteam@gmail.com>
2021-07-23 12:20:19 +00:00
|
|
|
make_app_folder();
|
|
|
|
|
2021-06-24 11:32:33 +00:00
|
|
|
if(args && load_key((const char*)args)) {
|
|
|
|
current_scene = Scene::SceneEmulate;
|
|
|
|
}
|
|
|
|
|
new iButton app (#328)
* rename old ibutton app to ibutton-test
* more renames
* updated onewire library compilation condition
* add submenu_clean subroutine
* add index for submenu callback
* c++ guard for gui modules
* add released ibutton app
* fix the position of the submenu window if there are too few items
* iButton app basis
* negative icon position info
* fix submenu_clean subroutine
* add ibutton app to applications makefile
* add onewire key read routine to read mode
* rename mode to scene
* rename files and folder (mode to scene)
* rename ibutton view to view manager
* rename get_view to get_view_manager
* cpp guards
* key read, store and notify features
* syntax fix
* make iButtonScene functions pure virtual
* fix syntax
* add text store, add new scene (crc error)
* not a key scene
* syntax fix
* read success scene
* app, switching to the previous scene with the number of scenes to be skipped
* scene whith menu when key is readed
* fix font height calculation, fix offsets
* add key write scene
* view_dispatcher_remove_view subroutine
* generic pause/resume os methods
* fix furi_assert usage
* key store, worker
* fix pointer comparsion
* saved keys, saved key action scenes
* key delete/confirm delete scenes and routines
* use last input subsystem changes
* fix syntax
* fix new model usage in submenu
* fix includes
* use vibro pin
* use stored key name if valid
* emulate scene
* random name generator
* name and save readed key scenes, new icon
* fix icon position
* fix text scene exit
* fix naming, fix text placement, new info scene
* state-driven cyfral decoder
* better cyfral decoder
* better cyfral decoder
* one wire: search command set
* metakom decoder
* more key types
* add next scene to error scenes
* universal key reader
* use new key reader
* syntax fix
* warning fix
* byte input module template
* new thread and insomnia api usage
* New element: slightly rounded frame
* Use elements_slightly_rounded_frame in text input
* Gui test app: byte input usage
* Byte input module: data drawing and selection
* Byte input: comment currently unused fns
* remove volatile qualifier
* base byte input realisation
* App gui test: remove internal fns visibility
* Byne input, final version
* test install gcc-arm-none-eabi-10-2020-q4-major
* test install gcc-arm-none-eabi-10-2020-q4-major
* App iButton: byte input view managment
* App iButton: add key manually scenes
* App iButton: rename scenes, add popup timeout
* App iButton: use new scenes, new fn for rollback to specific prevous scene.
* App iButton: remove byte input view on app exit
* App iButton: edit key scene
* Module byte input: reduce swintch value to uint8_t
* Module byte input: switch from switch-case to if, unfortunately we need compile-time constants to use with switch
* Icons: new small arrows
* Module byte input: new arrangement of elements
* OneWire slave lib: fix deattach sequence
* App iButton: pulse sequencer
* App iButton: add more keys to store
* App iButton: split key worker to separate read/write/emulate entitys
* App iButton: use new read/emulate entities
* fix callback pointer saving
* App iButton: use KeyReader error enum instead of KeyWorker error list handling
* App iButton: do not use insomnia fns in pulse sequencer
* App iButton: use KeyReader error enum in read scene
* OneWire slave lib: more READ ROM command variants, call callback only if positive result
* GPIO resources: add external gpio
* App SD/NFC: removed application
* App iButton-test: update to new light api
* App iButton: update to new light-api
* Outdated apps: add api-light-usage
* Gpio: update SD card CS pin settings
* API-power: added fns to disable/enable external 3v3 dc-dc
* API-gpio: separated SD card detect routines
* Resources: removed sd cs pin
* SD card: low level init now resets card power supply
* App SD-filesystem: use new card detect fns
* SD card: fix low level init headers
* SD card: more realilable low level init, power reset, exit from command read cycle conditionally
* App SD-filesystem: led notifiers, init cycling
* SD card: backport to F4
* Api PWM: add c++ guards
* App iButton: yellow blink in emulate scene, vibro on
* App iButton: one wire keys command set
* App iButton: successful write scene
* App iButton: key writer
* App iButton: syntax fix
* App iButton: notify write success
* App iButton: fix double scene change
* SD card: handle eject in init sequence
* SD card: api to set level on detect gpio
* SPI: api to set state on bus pins
* SD card: set low state on bus pins while power reset
* File select: init
* File select: fix input consuming
* SD Card: fixed dir open api error
* SD-card: replace strncpy by strlcpy. Fix buffer overflow error.
* API HAL OS: replace CMP based ticks with ARR based one, hard reset lptimer on reconfiguration.
* GUI: More stack size for (temporary, wee need to implement sd card api in separate thread)
* GUI: File select module.
* App iButton-test: remove obsolete app
Co-authored-by: rusdacent <rusdacentx0x08@gmail.com>
Co-authored-by: coreglitch <mail@s3f.ru>
Co-authored-by: Aleksandr Kutuzov <alleteam@gmail.com>
2021-03-12 12:45:18 +00:00
|
|
|
scenes[current_scene]->on_enter(this);
|
|
|
|
|
|
|
|
while(!exit) {
|
|
|
|
view.receive_event(&event);
|
|
|
|
|
|
|
|
consumed = scenes[current_scene]->on_event(this, &event);
|
|
|
|
|
|
|
|
if(!consumed) {
|
|
|
|
if(event.type == iButtonEvent::Type::EventTypeBack) {
|
|
|
|
exit = switch_to_previous_scene();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
scenes[current_scene]->on_exit(this);
|
|
|
|
}
|
|
|
|
|
2021-06-18 08:04:53 +00:00
|
|
|
iButtonApp::iButtonApp()
|
2021-06-29 13:08:45 +00:00
|
|
|
: notification{"notification"} {
|
new iButton app (#328)
* rename old ibutton app to ibutton-test
* more renames
* updated onewire library compilation condition
* add submenu_clean subroutine
* add index for submenu callback
* c++ guard for gui modules
* add released ibutton app
* fix the position of the submenu window if there are too few items
* iButton app basis
* negative icon position info
* fix submenu_clean subroutine
* add ibutton app to applications makefile
* add onewire key read routine to read mode
* rename mode to scene
* rename files and folder (mode to scene)
* rename ibutton view to view manager
* rename get_view to get_view_manager
* cpp guards
* key read, store and notify features
* syntax fix
* make iButtonScene functions pure virtual
* fix syntax
* add text store, add new scene (crc error)
* not a key scene
* syntax fix
* read success scene
* app, switching to the previous scene with the number of scenes to be skipped
* scene whith menu when key is readed
* fix font height calculation, fix offsets
* add key write scene
* view_dispatcher_remove_view subroutine
* generic pause/resume os methods
* fix furi_assert usage
* key store, worker
* fix pointer comparsion
* saved keys, saved key action scenes
* key delete/confirm delete scenes and routines
* use last input subsystem changes
* fix syntax
* fix new model usage in submenu
* fix includes
* use vibro pin
* use stored key name if valid
* emulate scene
* random name generator
* name and save readed key scenes, new icon
* fix icon position
* fix text scene exit
* fix naming, fix text placement, new info scene
* state-driven cyfral decoder
* better cyfral decoder
* better cyfral decoder
* one wire: search command set
* metakom decoder
* more key types
* add next scene to error scenes
* universal key reader
* use new key reader
* syntax fix
* warning fix
* byte input module template
* new thread and insomnia api usage
* New element: slightly rounded frame
* Use elements_slightly_rounded_frame in text input
* Gui test app: byte input usage
* Byte input module: data drawing and selection
* Byte input: comment currently unused fns
* remove volatile qualifier
* base byte input realisation
* App gui test: remove internal fns visibility
* Byne input, final version
* test install gcc-arm-none-eabi-10-2020-q4-major
* test install gcc-arm-none-eabi-10-2020-q4-major
* App iButton: byte input view managment
* App iButton: add key manually scenes
* App iButton: rename scenes, add popup timeout
* App iButton: use new scenes, new fn for rollback to specific prevous scene.
* App iButton: remove byte input view on app exit
* App iButton: edit key scene
* Module byte input: reduce swintch value to uint8_t
* Module byte input: switch from switch-case to if, unfortunately we need compile-time constants to use with switch
* Icons: new small arrows
* Module byte input: new arrangement of elements
* OneWire slave lib: fix deattach sequence
* App iButton: pulse sequencer
* App iButton: add more keys to store
* App iButton: split key worker to separate read/write/emulate entitys
* App iButton: use new read/emulate entities
* fix callback pointer saving
* App iButton: use KeyReader error enum instead of KeyWorker error list handling
* App iButton: do not use insomnia fns in pulse sequencer
* App iButton: use KeyReader error enum in read scene
* OneWire slave lib: more READ ROM command variants, call callback only if positive result
* GPIO resources: add external gpio
* App SD/NFC: removed application
* App iButton-test: update to new light api
* App iButton: update to new light-api
* Outdated apps: add api-light-usage
* Gpio: update SD card CS pin settings
* API-power: added fns to disable/enable external 3v3 dc-dc
* API-gpio: separated SD card detect routines
* Resources: removed sd cs pin
* SD card: low level init now resets card power supply
* App SD-filesystem: use new card detect fns
* SD card: fix low level init headers
* SD card: more realilable low level init, power reset, exit from command read cycle conditionally
* App SD-filesystem: led notifiers, init cycling
* SD card: backport to F4
* Api PWM: add c++ guards
* App iButton: yellow blink in emulate scene, vibro on
* App iButton: one wire keys command set
* App iButton: successful write scene
* App iButton: key writer
* App iButton: syntax fix
* App iButton: notify write success
* App iButton: fix double scene change
* SD card: handle eject in init sequence
* SD card: api to set level on detect gpio
* SPI: api to set state on bus pins
* SD card: set low state on bus pins while power reset
* File select: init
* File select: fix input consuming
* SD Card: fixed dir open api error
* SD-card: replace strncpy by strlcpy. Fix buffer overflow error.
* API HAL OS: replace CMP based ticks with ARR based one, hard reset lptimer on reconfiguration.
* GUI: More stack size for (temporary, wee need to implement sd card api in separate thread)
* GUI: File select module.
* App iButton-test: remove obsolete app
Co-authored-by: rusdacent <rusdacentx0x08@gmail.com>
Co-authored-by: coreglitch <mail@s3f.ru>
Co-authored-by: Aleksandr Kutuzov <alleteam@gmail.com>
2021-03-12 12:45:18 +00:00
|
|
|
api_hal_power_insomnia_enter();
|
|
|
|
key_worker = new KeyWorker(&ibutton_gpio);
|
2021-05-24 13:44:14 +00:00
|
|
|
|
new iButton app (#328)
* rename old ibutton app to ibutton-test
* more renames
* updated onewire library compilation condition
* add submenu_clean subroutine
* add index for submenu callback
* c++ guard for gui modules
* add released ibutton app
* fix the position of the submenu window if there are too few items
* iButton app basis
* negative icon position info
* fix submenu_clean subroutine
* add ibutton app to applications makefile
* add onewire key read routine to read mode
* rename mode to scene
* rename files and folder (mode to scene)
* rename ibutton view to view manager
* rename get_view to get_view_manager
* cpp guards
* key read, store and notify features
* syntax fix
* make iButtonScene functions pure virtual
* fix syntax
* add text store, add new scene (crc error)
* not a key scene
* syntax fix
* read success scene
* app, switching to the previous scene with the number of scenes to be skipped
* scene whith menu when key is readed
* fix font height calculation, fix offsets
* add key write scene
* view_dispatcher_remove_view subroutine
* generic pause/resume os methods
* fix furi_assert usage
* key store, worker
* fix pointer comparsion
* saved keys, saved key action scenes
* key delete/confirm delete scenes and routines
* use last input subsystem changes
* fix syntax
* fix new model usage in submenu
* fix includes
* use vibro pin
* use stored key name if valid
* emulate scene
* random name generator
* name and save readed key scenes, new icon
* fix icon position
* fix text scene exit
* fix naming, fix text placement, new info scene
* state-driven cyfral decoder
* better cyfral decoder
* better cyfral decoder
* one wire: search command set
* metakom decoder
* more key types
* add next scene to error scenes
* universal key reader
* use new key reader
* syntax fix
* warning fix
* byte input module template
* new thread and insomnia api usage
* New element: slightly rounded frame
* Use elements_slightly_rounded_frame in text input
* Gui test app: byte input usage
* Byte input module: data drawing and selection
* Byte input: comment currently unused fns
* remove volatile qualifier
* base byte input realisation
* App gui test: remove internal fns visibility
* Byne input, final version
* test install gcc-arm-none-eabi-10-2020-q4-major
* test install gcc-arm-none-eabi-10-2020-q4-major
* App iButton: byte input view managment
* App iButton: add key manually scenes
* App iButton: rename scenes, add popup timeout
* App iButton: use new scenes, new fn for rollback to specific prevous scene.
* App iButton: remove byte input view on app exit
* App iButton: edit key scene
* Module byte input: reduce swintch value to uint8_t
* Module byte input: switch from switch-case to if, unfortunately we need compile-time constants to use with switch
* Icons: new small arrows
* Module byte input: new arrangement of elements
* OneWire slave lib: fix deattach sequence
* App iButton: pulse sequencer
* App iButton: add more keys to store
* App iButton: split key worker to separate read/write/emulate entitys
* App iButton: use new read/emulate entities
* fix callback pointer saving
* App iButton: use KeyReader error enum instead of KeyWorker error list handling
* App iButton: do not use insomnia fns in pulse sequencer
* App iButton: use KeyReader error enum in read scene
* OneWire slave lib: more READ ROM command variants, call callback only if positive result
* GPIO resources: add external gpio
* App SD/NFC: removed application
* App iButton-test: update to new light api
* App iButton: update to new light-api
* Outdated apps: add api-light-usage
* Gpio: update SD card CS pin settings
* API-power: added fns to disable/enable external 3v3 dc-dc
* API-gpio: separated SD card detect routines
* Resources: removed sd cs pin
* SD card: low level init now resets card power supply
* App SD-filesystem: use new card detect fns
* SD card: fix low level init headers
* SD card: more realilable low level init, power reset, exit from command read cycle conditionally
* App SD-filesystem: led notifiers, init cycling
* SD card: backport to F4
* Api PWM: add c++ guards
* App iButton: yellow blink in emulate scene, vibro on
* App iButton: one wire keys command set
* App iButton: successful write scene
* App iButton: key writer
* App iButton: syntax fix
* App iButton: notify write success
* App iButton: fix double scene change
* SD card: handle eject in init sequence
* SD card: api to set level on detect gpio
* SPI: api to set state on bus pins
* SD card: set low state on bus pins while power reset
* File select: init
* File select: fix input consuming
* SD Card: fixed dir open api error
* SD-card: replace strncpy by strlcpy. Fix buffer overflow error.
* API HAL OS: replace CMP based ticks with ARR based one, hard reset lptimer on reconfiguration.
* GUI: More stack size for (temporary, wee need to implement sd card api in separate thread)
* GUI: File select module.
* App iButton-test: remove obsolete app
Co-authored-by: rusdacent <rusdacentx0x08@gmail.com>
Co-authored-by: coreglitch <mail@s3f.ru>
Co-authored-by: Aleksandr Kutuzov <alleteam@gmail.com>
2021-03-12 12:45:18 +00:00
|
|
|
// we need random
|
|
|
|
srand(DWT->CYCCNT);
|
|
|
|
}
|
|
|
|
|
|
|
|
iButtonApp::~iButtonApp() {
|
2021-05-04 13:21:16 +00:00
|
|
|
for(std::map<Scene, iButtonScene*>::iterator it = scenes.begin(); it != scenes.end(); ++it) {
|
|
|
|
delete it->second;
|
|
|
|
scenes.erase(it);
|
|
|
|
}
|
2021-06-24 11:32:33 +00:00
|
|
|
delete key_worker;
|
2021-05-04 13:21:16 +00:00
|
|
|
|
new iButton app (#328)
* rename old ibutton app to ibutton-test
* more renames
* updated onewire library compilation condition
* add submenu_clean subroutine
* add index for submenu callback
* c++ guard for gui modules
* add released ibutton app
* fix the position of the submenu window if there are too few items
* iButton app basis
* negative icon position info
* fix submenu_clean subroutine
* add ibutton app to applications makefile
* add onewire key read routine to read mode
* rename mode to scene
* rename files and folder (mode to scene)
* rename ibutton view to view manager
* rename get_view to get_view_manager
* cpp guards
* key read, store and notify features
* syntax fix
* make iButtonScene functions pure virtual
* fix syntax
* add text store, add new scene (crc error)
* not a key scene
* syntax fix
* read success scene
* app, switching to the previous scene with the number of scenes to be skipped
* scene whith menu when key is readed
* fix font height calculation, fix offsets
* add key write scene
* view_dispatcher_remove_view subroutine
* generic pause/resume os methods
* fix furi_assert usage
* key store, worker
* fix pointer comparsion
* saved keys, saved key action scenes
* key delete/confirm delete scenes and routines
* use last input subsystem changes
* fix syntax
* fix new model usage in submenu
* fix includes
* use vibro pin
* use stored key name if valid
* emulate scene
* random name generator
* name and save readed key scenes, new icon
* fix icon position
* fix text scene exit
* fix naming, fix text placement, new info scene
* state-driven cyfral decoder
* better cyfral decoder
* better cyfral decoder
* one wire: search command set
* metakom decoder
* more key types
* add next scene to error scenes
* universal key reader
* use new key reader
* syntax fix
* warning fix
* byte input module template
* new thread and insomnia api usage
* New element: slightly rounded frame
* Use elements_slightly_rounded_frame in text input
* Gui test app: byte input usage
* Byte input module: data drawing and selection
* Byte input: comment currently unused fns
* remove volatile qualifier
* base byte input realisation
* App gui test: remove internal fns visibility
* Byne input, final version
* test install gcc-arm-none-eabi-10-2020-q4-major
* test install gcc-arm-none-eabi-10-2020-q4-major
* App iButton: byte input view managment
* App iButton: add key manually scenes
* App iButton: rename scenes, add popup timeout
* App iButton: use new scenes, new fn for rollback to specific prevous scene.
* App iButton: remove byte input view on app exit
* App iButton: edit key scene
* Module byte input: reduce swintch value to uint8_t
* Module byte input: switch from switch-case to if, unfortunately we need compile-time constants to use with switch
* Icons: new small arrows
* Module byte input: new arrangement of elements
* OneWire slave lib: fix deattach sequence
* App iButton: pulse sequencer
* App iButton: add more keys to store
* App iButton: split key worker to separate read/write/emulate entitys
* App iButton: use new read/emulate entities
* fix callback pointer saving
* App iButton: use KeyReader error enum instead of KeyWorker error list handling
* App iButton: do not use insomnia fns in pulse sequencer
* App iButton: use KeyReader error enum in read scene
* OneWire slave lib: more READ ROM command variants, call callback only if positive result
* GPIO resources: add external gpio
* App SD/NFC: removed application
* App iButton-test: update to new light api
* App iButton: update to new light-api
* Outdated apps: add api-light-usage
* Gpio: update SD card CS pin settings
* API-power: added fns to disable/enable external 3v3 dc-dc
* API-gpio: separated SD card detect routines
* Resources: removed sd cs pin
* SD card: low level init now resets card power supply
* App SD-filesystem: use new card detect fns
* SD card: fix low level init headers
* SD card: more realilable low level init, power reset, exit from command read cycle conditionally
* App SD-filesystem: led notifiers, init cycling
* SD card: backport to F4
* Api PWM: add c++ guards
* App iButton: yellow blink in emulate scene, vibro on
* App iButton: one wire keys command set
* App iButton: successful write scene
* App iButton: key writer
* App iButton: syntax fix
* App iButton: notify write success
* App iButton: fix double scene change
* SD card: handle eject in init sequence
* SD card: api to set level on detect gpio
* SPI: api to set state on bus pins
* SD card: set low state on bus pins while power reset
* File select: init
* File select: fix input consuming
* SD Card: fixed dir open api error
* SD-card: replace strncpy by strlcpy. Fix buffer overflow error.
* API HAL OS: replace CMP based ticks with ARR based one, hard reset lptimer on reconfiguration.
* GUI: More stack size for (temporary, wee need to implement sd card api in separate thread)
* GUI: File select module.
* App iButton-test: remove obsolete app
Co-authored-by: rusdacent <rusdacentx0x08@gmail.com>
Co-authored-by: coreglitch <mail@s3f.ru>
Co-authored-by: Aleksandr Kutuzov <alleteam@gmail.com>
2021-03-12 12:45:18 +00:00
|
|
|
api_hal_power_insomnia_exit();
|
|
|
|
}
|
|
|
|
|
|
|
|
iButtonAppViewManager* iButtonApp::get_view_manager() {
|
|
|
|
return &view;
|
|
|
|
}
|
|
|
|
|
|
|
|
void iButtonApp::switch_to_next_scene(Scene next_scene) {
|
|
|
|
previous_scenes_list.push_front(current_scene);
|
|
|
|
|
|
|
|
if(next_scene != Scene::SceneExit) {
|
|
|
|
scenes[current_scene]->on_exit(this);
|
|
|
|
current_scene = next_scene;
|
|
|
|
scenes[current_scene]->on_enter(this);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void iButtonApp::search_and_switch_to_previous_scene(std::initializer_list<Scene> scenes_list) {
|
|
|
|
Scene previous_scene = Scene::SceneStart;
|
|
|
|
bool scene_found = false;
|
|
|
|
|
|
|
|
while(!scene_found) {
|
|
|
|
previous_scene = get_previous_scene();
|
|
|
|
for(Scene element : scenes_list) {
|
|
|
|
if(previous_scene == element || previous_scene == Scene::SceneStart) {
|
|
|
|
scene_found = true;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
scenes[current_scene]->on_exit(this);
|
|
|
|
current_scene = previous_scene;
|
|
|
|
scenes[current_scene]->on_enter(this);
|
|
|
|
}
|
|
|
|
|
|
|
|
bool iButtonApp::switch_to_previous_scene(uint8_t count) {
|
|
|
|
Scene previous_scene = Scene::SceneStart;
|
|
|
|
|
|
|
|
for(uint8_t i = 0; i < count; i++) {
|
|
|
|
previous_scene = get_previous_scene();
|
|
|
|
if(previous_scene == Scene::SceneExit) break;
|
|
|
|
}
|
|
|
|
|
|
|
|
if(previous_scene == Scene::SceneExit) {
|
|
|
|
return true;
|
|
|
|
} else {
|
|
|
|
scenes[current_scene]->on_exit(this);
|
|
|
|
current_scene = previous_scene;
|
|
|
|
scenes[current_scene]->on_enter(this);
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
iButtonApp::Scene iButtonApp::get_previous_scene() {
|
|
|
|
Scene scene = previous_scenes_list.front();
|
|
|
|
previous_scenes_list.pop_front();
|
|
|
|
return scene;
|
|
|
|
}
|
|
|
|
|
|
|
|
const GpioPin* iButtonApp::get_ibutton_pin() {
|
|
|
|
// TODO open record
|
|
|
|
return &ibutton_gpio;
|
|
|
|
}
|
|
|
|
|
|
|
|
KeyWorker* iButtonApp::get_key_worker() {
|
|
|
|
return key_worker;
|
|
|
|
}
|
|
|
|
|
|
|
|
iButtonKey* iButtonApp::get_key() {
|
|
|
|
return &key;
|
|
|
|
}
|
|
|
|
|
2021-03-31 17:47:32 +00:00
|
|
|
char* iButtonApp::get_file_name() {
|
|
|
|
return file_name;
|
|
|
|
}
|
|
|
|
|
|
|
|
uint8_t iButtonApp::get_file_name_size() {
|
|
|
|
return file_name_size;
|
|
|
|
}
|
|
|
|
|
new iButton app (#328)
* rename old ibutton app to ibutton-test
* more renames
* updated onewire library compilation condition
* add submenu_clean subroutine
* add index for submenu callback
* c++ guard for gui modules
* add released ibutton app
* fix the position of the submenu window if there are too few items
* iButton app basis
* negative icon position info
* fix submenu_clean subroutine
* add ibutton app to applications makefile
* add onewire key read routine to read mode
* rename mode to scene
* rename files and folder (mode to scene)
* rename ibutton view to view manager
* rename get_view to get_view_manager
* cpp guards
* key read, store and notify features
* syntax fix
* make iButtonScene functions pure virtual
* fix syntax
* add text store, add new scene (crc error)
* not a key scene
* syntax fix
* read success scene
* app, switching to the previous scene with the number of scenes to be skipped
* scene whith menu when key is readed
* fix font height calculation, fix offsets
* add key write scene
* view_dispatcher_remove_view subroutine
* generic pause/resume os methods
* fix furi_assert usage
* key store, worker
* fix pointer comparsion
* saved keys, saved key action scenes
* key delete/confirm delete scenes and routines
* use last input subsystem changes
* fix syntax
* fix new model usage in submenu
* fix includes
* use vibro pin
* use stored key name if valid
* emulate scene
* random name generator
* name and save readed key scenes, new icon
* fix icon position
* fix text scene exit
* fix naming, fix text placement, new info scene
* state-driven cyfral decoder
* better cyfral decoder
* better cyfral decoder
* one wire: search command set
* metakom decoder
* more key types
* add next scene to error scenes
* universal key reader
* use new key reader
* syntax fix
* warning fix
* byte input module template
* new thread and insomnia api usage
* New element: slightly rounded frame
* Use elements_slightly_rounded_frame in text input
* Gui test app: byte input usage
* Byte input module: data drawing and selection
* Byte input: comment currently unused fns
* remove volatile qualifier
* base byte input realisation
* App gui test: remove internal fns visibility
* Byne input, final version
* test install gcc-arm-none-eabi-10-2020-q4-major
* test install gcc-arm-none-eabi-10-2020-q4-major
* App iButton: byte input view managment
* App iButton: add key manually scenes
* App iButton: rename scenes, add popup timeout
* App iButton: use new scenes, new fn for rollback to specific prevous scene.
* App iButton: remove byte input view on app exit
* App iButton: edit key scene
* Module byte input: reduce swintch value to uint8_t
* Module byte input: switch from switch-case to if, unfortunately we need compile-time constants to use with switch
* Icons: new small arrows
* Module byte input: new arrangement of elements
* OneWire slave lib: fix deattach sequence
* App iButton: pulse sequencer
* App iButton: add more keys to store
* App iButton: split key worker to separate read/write/emulate entitys
* App iButton: use new read/emulate entities
* fix callback pointer saving
* App iButton: use KeyReader error enum instead of KeyWorker error list handling
* App iButton: do not use insomnia fns in pulse sequencer
* App iButton: use KeyReader error enum in read scene
* OneWire slave lib: more READ ROM command variants, call callback only if positive result
* GPIO resources: add external gpio
* App SD/NFC: removed application
* App iButton-test: update to new light api
* App iButton: update to new light-api
* Outdated apps: add api-light-usage
* Gpio: update SD card CS pin settings
* API-power: added fns to disable/enable external 3v3 dc-dc
* API-gpio: separated SD card detect routines
* Resources: removed sd cs pin
* SD card: low level init now resets card power supply
* App SD-filesystem: use new card detect fns
* SD card: fix low level init headers
* SD card: more realilable low level init, power reset, exit from command read cycle conditionally
* App SD-filesystem: led notifiers, init cycling
* SD card: backport to F4
* Api PWM: add c++ guards
* App iButton: yellow blink in emulate scene, vibro on
* App iButton: one wire keys command set
* App iButton: successful write scene
* App iButton: key writer
* App iButton: syntax fix
* App iButton: notify write success
* App iButton: fix double scene change
* SD card: handle eject in init sequence
* SD card: api to set level on detect gpio
* SPI: api to set state on bus pins
* SD card: set low state on bus pins while power reset
* File select: init
* File select: fix input consuming
* SD Card: fixed dir open api error
* SD-card: replace strncpy by strlcpy. Fix buffer overflow error.
* API HAL OS: replace CMP based ticks with ARR based one, hard reset lptimer on reconfiguration.
* GUI: More stack size for (temporary, wee need to implement sd card api in separate thread)
* GUI: File select module.
* App iButton-test: remove obsolete app
Co-authored-by: rusdacent <rusdacentx0x08@gmail.com>
Co-authored-by: coreglitch <mail@s3f.ru>
Co-authored-by: Aleksandr Kutuzov <alleteam@gmail.com>
2021-03-12 12:45:18 +00:00
|
|
|
void iButtonApp::notify_green_blink() {
|
2021-05-24 13:44:14 +00:00
|
|
|
notification_message(notification, &sequence_blink_green_10);
|
new iButton app (#328)
* rename old ibutton app to ibutton-test
* more renames
* updated onewire library compilation condition
* add submenu_clean subroutine
* add index for submenu callback
* c++ guard for gui modules
* add released ibutton app
* fix the position of the submenu window if there are too few items
* iButton app basis
* negative icon position info
* fix submenu_clean subroutine
* add ibutton app to applications makefile
* add onewire key read routine to read mode
* rename mode to scene
* rename files and folder (mode to scene)
* rename ibutton view to view manager
* rename get_view to get_view_manager
* cpp guards
* key read, store and notify features
* syntax fix
* make iButtonScene functions pure virtual
* fix syntax
* add text store, add new scene (crc error)
* not a key scene
* syntax fix
* read success scene
* app, switching to the previous scene with the number of scenes to be skipped
* scene whith menu when key is readed
* fix font height calculation, fix offsets
* add key write scene
* view_dispatcher_remove_view subroutine
* generic pause/resume os methods
* fix furi_assert usage
* key store, worker
* fix pointer comparsion
* saved keys, saved key action scenes
* key delete/confirm delete scenes and routines
* use last input subsystem changes
* fix syntax
* fix new model usage in submenu
* fix includes
* use vibro pin
* use stored key name if valid
* emulate scene
* random name generator
* name and save readed key scenes, new icon
* fix icon position
* fix text scene exit
* fix naming, fix text placement, new info scene
* state-driven cyfral decoder
* better cyfral decoder
* better cyfral decoder
* one wire: search command set
* metakom decoder
* more key types
* add next scene to error scenes
* universal key reader
* use new key reader
* syntax fix
* warning fix
* byte input module template
* new thread and insomnia api usage
* New element: slightly rounded frame
* Use elements_slightly_rounded_frame in text input
* Gui test app: byte input usage
* Byte input module: data drawing and selection
* Byte input: comment currently unused fns
* remove volatile qualifier
* base byte input realisation
* App gui test: remove internal fns visibility
* Byne input, final version
* test install gcc-arm-none-eabi-10-2020-q4-major
* test install gcc-arm-none-eabi-10-2020-q4-major
* App iButton: byte input view managment
* App iButton: add key manually scenes
* App iButton: rename scenes, add popup timeout
* App iButton: use new scenes, new fn for rollback to specific prevous scene.
* App iButton: remove byte input view on app exit
* App iButton: edit key scene
* Module byte input: reduce swintch value to uint8_t
* Module byte input: switch from switch-case to if, unfortunately we need compile-time constants to use with switch
* Icons: new small arrows
* Module byte input: new arrangement of elements
* OneWire slave lib: fix deattach sequence
* App iButton: pulse sequencer
* App iButton: add more keys to store
* App iButton: split key worker to separate read/write/emulate entitys
* App iButton: use new read/emulate entities
* fix callback pointer saving
* App iButton: use KeyReader error enum instead of KeyWorker error list handling
* App iButton: do not use insomnia fns in pulse sequencer
* App iButton: use KeyReader error enum in read scene
* OneWire slave lib: more READ ROM command variants, call callback only if positive result
* GPIO resources: add external gpio
* App SD/NFC: removed application
* App iButton-test: update to new light api
* App iButton: update to new light-api
* Outdated apps: add api-light-usage
* Gpio: update SD card CS pin settings
* API-power: added fns to disable/enable external 3v3 dc-dc
* API-gpio: separated SD card detect routines
* Resources: removed sd cs pin
* SD card: low level init now resets card power supply
* App SD-filesystem: use new card detect fns
* SD card: fix low level init headers
* SD card: more realilable low level init, power reset, exit from command read cycle conditionally
* App SD-filesystem: led notifiers, init cycling
* SD card: backport to F4
* Api PWM: add c++ guards
* App iButton: yellow blink in emulate scene, vibro on
* App iButton: one wire keys command set
* App iButton: successful write scene
* App iButton: key writer
* App iButton: syntax fix
* App iButton: notify write success
* App iButton: fix double scene change
* SD card: handle eject in init sequence
* SD card: api to set level on detect gpio
* SPI: api to set state on bus pins
* SD card: set low state on bus pins while power reset
* File select: init
* File select: fix input consuming
* SD Card: fixed dir open api error
* SD-card: replace strncpy by strlcpy. Fix buffer overflow error.
* API HAL OS: replace CMP based ticks with ARR based one, hard reset lptimer on reconfiguration.
* GUI: More stack size for (temporary, wee need to implement sd card api in separate thread)
* GUI: File select module.
* App iButton-test: remove obsolete app
Co-authored-by: rusdacent <rusdacentx0x08@gmail.com>
Co-authored-by: coreglitch <mail@s3f.ru>
Co-authored-by: Aleksandr Kutuzov <alleteam@gmail.com>
2021-03-12 12:45:18 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void iButtonApp::notify_yellow_blink() {
|
2021-05-24 13:44:14 +00:00
|
|
|
notification_message(notification, &sequence_blink_yellow_10);
|
new iButton app (#328)
* rename old ibutton app to ibutton-test
* more renames
* updated onewire library compilation condition
* add submenu_clean subroutine
* add index for submenu callback
* c++ guard for gui modules
* add released ibutton app
* fix the position of the submenu window if there are too few items
* iButton app basis
* negative icon position info
* fix submenu_clean subroutine
* add ibutton app to applications makefile
* add onewire key read routine to read mode
* rename mode to scene
* rename files and folder (mode to scene)
* rename ibutton view to view manager
* rename get_view to get_view_manager
* cpp guards
* key read, store and notify features
* syntax fix
* make iButtonScene functions pure virtual
* fix syntax
* add text store, add new scene (crc error)
* not a key scene
* syntax fix
* read success scene
* app, switching to the previous scene with the number of scenes to be skipped
* scene whith menu when key is readed
* fix font height calculation, fix offsets
* add key write scene
* view_dispatcher_remove_view subroutine
* generic pause/resume os methods
* fix furi_assert usage
* key store, worker
* fix pointer comparsion
* saved keys, saved key action scenes
* key delete/confirm delete scenes and routines
* use last input subsystem changes
* fix syntax
* fix new model usage in submenu
* fix includes
* use vibro pin
* use stored key name if valid
* emulate scene
* random name generator
* name and save readed key scenes, new icon
* fix icon position
* fix text scene exit
* fix naming, fix text placement, new info scene
* state-driven cyfral decoder
* better cyfral decoder
* better cyfral decoder
* one wire: search command set
* metakom decoder
* more key types
* add next scene to error scenes
* universal key reader
* use new key reader
* syntax fix
* warning fix
* byte input module template
* new thread and insomnia api usage
* New element: slightly rounded frame
* Use elements_slightly_rounded_frame in text input
* Gui test app: byte input usage
* Byte input module: data drawing and selection
* Byte input: comment currently unused fns
* remove volatile qualifier
* base byte input realisation
* App gui test: remove internal fns visibility
* Byne input, final version
* test install gcc-arm-none-eabi-10-2020-q4-major
* test install gcc-arm-none-eabi-10-2020-q4-major
* App iButton: byte input view managment
* App iButton: add key manually scenes
* App iButton: rename scenes, add popup timeout
* App iButton: use new scenes, new fn for rollback to specific prevous scene.
* App iButton: remove byte input view on app exit
* App iButton: edit key scene
* Module byte input: reduce swintch value to uint8_t
* Module byte input: switch from switch-case to if, unfortunately we need compile-time constants to use with switch
* Icons: new small arrows
* Module byte input: new arrangement of elements
* OneWire slave lib: fix deattach sequence
* App iButton: pulse sequencer
* App iButton: add more keys to store
* App iButton: split key worker to separate read/write/emulate entitys
* App iButton: use new read/emulate entities
* fix callback pointer saving
* App iButton: use KeyReader error enum instead of KeyWorker error list handling
* App iButton: do not use insomnia fns in pulse sequencer
* App iButton: use KeyReader error enum in read scene
* OneWire slave lib: more READ ROM command variants, call callback only if positive result
* GPIO resources: add external gpio
* App SD/NFC: removed application
* App iButton-test: update to new light api
* App iButton: update to new light-api
* Outdated apps: add api-light-usage
* Gpio: update SD card CS pin settings
* API-power: added fns to disable/enable external 3v3 dc-dc
* API-gpio: separated SD card detect routines
* Resources: removed sd cs pin
* SD card: low level init now resets card power supply
* App SD-filesystem: use new card detect fns
* SD card: fix low level init headers
* SD card: more realilable low level init, power reset, exit from command read cycle conditionally
* App SD-filesystem: led notifiers, init cycling
* SD card: backport to F4
* Api PWM: add c++ guards
* App iButton: yellow blink in emulate scene, vibro on
* App iButton: one wire keys command set
* App iButton: successful write scene
* App iButton: key writer
* App iButton: syntax fix
* App iButton: notify write success
* App iButton: fix double scene change
* SD card: handle eject in init sequence
* SD card: api to set level on detect gpio
* SPI: api to set state on bus pins
* SD card: set low state on bus pins while power reset
* File select: init
* File select: fix input consuming
* SD Card: fixed dir open api error
* SD-card: replace strncpy by strlcpy. Fix buffer overflow error.
* API HAL OS: replace CMP based ticks with ARR based one, hard reset lptimer on reconfiguration.
* GUI: More stack size for (temporary, wee need to implement sd card api in separate thread)
* GUI: File select module.
* App iButton-test: remove obsolete app
Co-authored-by: rusdacent <rusdacentx0x08@gmail.com>
Co-authored-by: coreglitch <mail@s3f.ru>
Co-authored-by: Aleksandr Kutuzov <alleteam@gmail.com>
2021-03-12 12:45:18 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void iButtonApp::notify_red_blink() {
|
2021-05-24 13:44:14 +00:00
|
|
|
notification_message(notification, &sequence_blink_red_10);
|
new iButton app (#328)
* rename old ibutton app to ibutton-test
* more renames
* updated onewire library compilation condition
* add submenu_clean subroutine
* add index for submenu callback
* c++ guard for gui modules
* add released ibutton app
* fix the position of the submenu window if there are too few items
* iButton app basis
* negative icon position info
* fix submenu_clean subroutine
* add ibutton app to applications makefile
* add onewire key read routine to read mode
* rename mode to scene
* rename files and folder (mode to scene)
* rename ibutton view to view manager
* rename get_view to get_view_manager
* cpp guards
* key read, store and notify features
* syntax fix
* make iButtonScene functions pure virtual
* fix syntax
* add text store, add new scene (crc error)
* not a key scene
* syntax fix
* read success scene
* app, switching to the previous scene with the number of scenes to be skipped
* scene whith menu when key is readed
* fix font height calculation, fix offsets
* add key write scene
* view_dispatcher_remove_view subroutine
* generic pause/resume os methods
* fix furi_assert usage
* key store, worker
* fix pointer comparsion
* saved keys, saved key action scenes
* key delete/confirm delete scenes and routines
* use last input subsystem changes
* fix syntax
* fix new model usage in submenu
* fix includes
* use vibro pin
* use stored key name if valid
* emulate scene
* random name generator
* name and save readed key scenes, new icon
* fix icon position
* fix text scene exit
* fix naming, fix text placement, new info scene
* state-driven cyfral decoder
* better cyfral decoder
* better cyfral decoder
* one wire: search command set
* metakom decoder
* more key types
* add next scene to error scenes
* universal key reader
* use new key reader
* syntax fix
* warning fix
* byte input module template
* new thread and insomnia api usage
* New element: slightly rounded frame
* Use elements_slightly_rounded_frame in text input
* Gui test app: byte input usage
* Byte input module: data drawing and selection
* Byte input: comment currently unused fns
* remove volatile qualifier
* base byte input realisation
* App gui test: remove internal fns visibility
* Byne input, final version
* test install gcc-arm-none-eabi-10-2020-q4-major
* test install gcc-arm-none-eabi-10-2020-q4-major
* App iButton: byte input view managment
* App iButton: add key manually scenes
* App iButton: rename scenes, add popup timeout
* App iButton: use new scenes, new fn for rollback to specific prevous scene.
* App iButton: remove byte input view on app exit
* App iButton: edit key scene
* Module byte input: reduce swintch value to uint8_t
* Module byte input: switch from switch-case to if, unfortunately we need compile-time constants to use with switch
* Icons: new small arrows
* Module byte input: new arrangement of elements
* OneWire slave lib: fix deattach sequence
* App iButton: pulse sequencer
* App iButton: add more keys to store
* App iButton: split key worker to separate read/write/emulate entitys
* App iButton: use new read/emulate entities
* fix callback pointer saving
* App iButton: use KeyReader error enum instead of KeyWorker error list handling
* App iButton: do not use insomnia fns in pulse sequencer
* App iButton: use KeyReader error enum in read scene
* OneWire slave lib: more READ ROM command variants, call callback only if positive result
* GPIO resources: add external gpio
* App SD/NFC: removed application
* App iButton-test: update to new light api
* App iButton: update to new light-api
* Outdated apps: add api-light-usage
* Gpio: update SD card CS pin settings
* API-power: added fns to disable/enable external 3v3 dc-dc
* API-gpio: separated SD card detect routines
* Resources: removed sd cs pin
* SD card: low level init now resets card power supply
* App SD-filesystem: use new card detect fns
* SD card: fix low level init headers
* SD card: more realilable low level init, power reset, exit from command read cycle conditionally
* App SD-filesystem: led notifiers, init cycling
* SD card: backport to F4
* Api PWM: add c++ guards
* App iButton: yellow blink in emulate scene, vibro on
* App iButton: one wire keys command set
* App iButton: successful write scene
* App iButton: key writer
* App iButton: syntax fix
* App iButton: notify write success
* App iButton: fix double scene change
* SD card: handle eject in init sequence
* SD card: api to set level on detect gpio
* SPI: api to set state on bus pins
* SD card: set low state on bus pins while power reset
* File select: init
* File select: fix input consuming
* SD Card: fixed dir open api error
* SD-card: replace strncpy by strlcpy. Fix buffer overflow error.
* API HAL OS: replace CMP based ticks with ARR based one, hard reset lptimer on reconfiguration.
* GUI: More stack size for (temporary, wee need to implement sd card api in separate thread)
* GUI: File select module.
* App iButton-test: remove obsolete app
Co-authored-by: rusdacent <rusdacentx0x08@gmail.com>
Co-authored-by: coreglitch <mail@s3f.ru>
Co-authored-by: Aleksandr Kutuzov <alleteam@gmail.com>
2021-03-12 12:45:18 +00:00
|
|
|
}
|
|
|
|
|
2021-05-24 13:44:14 +00:00
|
|
|
void iButtonApp::notify_error() {
|
|
|
|
notification_message(notification, &sequence_error);
|
new iButton app (#328)
* rename old ibutton app to ibutton-test
* more renames
* updated onewire library compilation condition
* add submenu_clean subroutine
* add index for submenu callback
* c++ guard for gui modules
* add released ibutton app
* fix the position of the submenu window if there are too few items
* iButton app basis
* negative icon position info
* fix submenu_clean subroutine
* add ibutton app to applications makefile
* add onewire key read routine to read mode
* rename mode to scene
* rename files and folder (mode to scene)
* rename ibutton view to view manager
* rename get_view to get_view_manager
* cpp guards
* key read, store and notify features
* syntax fix
* make iButtonScene functions pure virtual
* fix syntax
* add text store, add new scene (crc error)
* not a key scene
* syntax fix
* read success scene
* app, switching to the previous scene with the number of scenes to be skipped
* scene whith menu when key is readed
* fix font height calculation, fix offsets
* add key write scene
* view_dispatcher_remove_view subroutine
* generic pause/resume os methods
* fix furi_assert usage
* key store, worker
* fix pointer comparsion
* saved keys, saved key action scenes
* key delete/confirm delete scenes and routines
* use last input subsystem changes
* fix syntax
* fix new model usage in submenu
* fix includes
* use vibro pin
* use stored key name if valid
* emulate scene
* random name generator
* name and save readed key scenes, new icon
* fix icon position
* fix text scene exit
* fix naming, fix text placement, new info scene
* state-driven cyfral decoder
* better cyfral decoder
* better cyfral decoder
* one wire: search command set
* metakom decoder
* more key types
* add next scene to error scenes
* universal key reader
* use new key reader
* syntax fix
* warning fix
* byte input module template
* new thread and insomnia api usage
* New element: slightly rounded frame
* Use elements_slightly_rounded_frame in text input
* Gui test app: byte input usage
* Byte input module: data drawing and selection
* Byte input: comment currently unused fns
* remove volatile qualifier
* base byte input realisation
* App gui test: remove internal fns visibility
* Byne input, final version
* test install gcc-arm-none-eabi-10-2020-q4-major
* test install gcc-arm-none-eabi-10-2020-q4-major
* App iButton: byte input view managment
* App iButton: add key manually scenes
* App iButton: rename scenes, add popup timeout
* App iButton: use new scenes, new fn for rollback to specific prevous scene.
* App iButton: remove byte input view on app exit
* App iButton: edit key scene
* Module byte input: reduce swintch value to uint8_t
* Module byte input: switch from switch-case to if, unfortunately we need compile-time constants to use with switch
* Icons: new small arrows
* Module byte input: new arrangement of elements
* OneWire slave lib: fix deattach sequence
* App iButton: pulse sequencer
* App iButton: add more keys to store
* App iButton: split key worker to separate read/write/emulate entitys
* App iButton: use new read/emulate entities
* fix callback pointer saving
* App iButton: use KeyReader error enum instead of KeyWorker error list handling
* App iButton: do not use insomnia fns in pulse sequencer
* App iButton: use KeyReader error enum in read scene
* OneWire slave lib: more READ ROM command variants, call callback only if positive result
* GPIO resources: add external gpio
* App SD/NFC: removed application
* App iButton-test: update to new light api
* App iButton: update to new light-api
* Outdated apps: add api-light-usage
* Gpio: update SD card CS pin settings
* API-power: added fns to disable/enable external 3v3 dc-dc
* API-gpio: separated SD card detect routines
* Resources: removed sd cs pin
* SD card: low level init now resets card power supply
* App SD-filesystem: use new card detect fns
* SD card: fix low level init headers
* SD card: more realilable low level init, power reset, exit from command read cycle conditionally
* App SD-filesystem: led notifiers, init cycling
* SD card: backport to F4
* Api PWM: add c++ guards
* App iButton: yellow blink in emulate scene, vibro on
* App iButton: one wire keys command set
* App iButton: successful write scene
* App iButton: key writer
* App iButton: syntax fix
* App iButton: notify write success
* App iButton: fix double scene change
* SD card: handle eject in init sequence
* SD card: api to set level on detect gpio
* SPI: api to set state on bus pins
* SD card: set low state on bus pins while power reset
* File select: init
* File select: fix input consuming
* SD Card: fixed dir open api error
* SD-card: replace strncpy by strlcpy. Fix buffer overflow error.
* API HAL OS: replace CMP based ticks with ARR based one, hard reset lptimer on reconfiguration.
* GUI: More stack size for (temporary, wee need to implement sd card api in separate thread)
* GUI: File select module.
* App iButton-test: remove obsolete app
Co-authored-by: rusdacent <rusdacentx0x08@gmail.com>
Co-authored-by: coreglitch <mail@s3f.ru>
Co-authored-by: Aleksandr Kutuzov <alleteam@gmail.com>
2021-03-12 12:45:18 +00:00
|
|
|
}
|
|
|
|
|
2021-05-24 13:44:14 +00:00
|
|
|
void iButtonApp::notify_success() {
|
|
|
|
notification_message(notification, &sequence_success);
|
new iButton app (#328)
* rename old ibutton app to ibutton-test
* more renames
* updated onewire library compilation condition
* add submenu_clean subroutine
* add index for submenu callback
* c++ guard for gui modules
* add released ibutton app
* fix the position of the submenu window if there are too few items
* iButton app basis
* negative icon position info
* fix submenu_clean subroutine
* add ibutton app to applications makefile
* add onewire key read routine to read mode
* rename mode to scene
* rename files and folder (mode to scene)
* rename ibutton view to view manager
* rename get_view to get_view_manager
* cpp guards
* key read, store and notify features
* syntax fix
* make iButtonScene functions pure virtual
* fix syntax
* add text store, add new scene (crc error)
* not a key scene
* syntax fix
* read success scene
* app, switching to the previous scene with the number of scenes to be skipped
* scene whith menu when key is readed
* fix font height calculation, fix offsets
* add key write scene
* view_dispatcher_remove_view subroutine
* generic pause/resume os methods
* fix furi_assert usage
* key store, worker
* fix pointer comparsion
* saved keys, saved key action scenes
* key delete/confirm delete scenes and routines
* use last input subsystem changes
* fix syntax
* fix new model usage in submenu
* fix includes
* use vibro pin
* use stored key name if valid
* emulate scene
* random name generator
* name and save readed key scenes, new icon
* fix icon position
* fix text scene exit
* fix naming, fix text placement, new info scene
* state-driven cyfral decoder
* better cyfral decoder
* better cyfral decoder
* one wire: search command set
* metakom decoder
* more key types
* add next scene to error scenes
* universal key reader
* use new key reader
* syntax fix
* warning fix
* byte input module template
* new thread and insomnia api usage
* New element: slightly rounded frame
* Use elements_slightly_rounded_frame in text input
* Gui test app: byte input usage
* Byte input module: data drawing and selection
* Byte input: comment currently unused fns
* remove volatile qualifier
* base byte input realisation
* App gui test: remove internal fns visibility
* Byne input, final version
* test install gcc-arm-none-eabi-10-2020-q4-major
* test install gcc-arm-none-eabi-10-2020-q4-major
* App iButton: byte input view managment
* App iButton: add key manually scenes
* App iButton: rename scenes, add popup timeout
* App iButton: use new scenes, new fn for rollback to specific prevous scene.
* App iButton: remove byte input view on app exit
* App iButton: edit key scene
* Module byte input: reduce swintch value to uint8_t
* Module byte input: switch from switch-case to if, unfortunately we need compile-time constants to use with switch
* Icons: new small arrows
* Module byte input: new arrangement of elements
* OneWire slave lib: fix deattach sequence
* App iButton: pulse sequencer
* App iButton: add more keys to store
* App iButton: split key worker to separate read/write/emulate entitys
* App iButton: use new read/emulate entities
* fix callback pointer saving
* App iButton: use KeyReader error enum instead of KeyWorker error list handling
* App iButton: do not use insomnia fns in pulse sequencer
* App iButton: use KeyReader error enum in read scene
* OneWire slave lib: more READ ROM command variants, call callback only if positive result
* GPIO resources: add external gpio
* App SD/NFC: removed application
* App iButton-test: update to new light api
* App iButton: update to new light-api
* Outdated apps: add api-light-usage
* Gpio: update SD card CS pin settings
* API-power: added fns to disable/enable external 3v3 dc-dc
* API-gpio: separated SD card detect routines
* Resources: removed sd cs pin
* SD card: low level init now resets card power supply
* App SD-filesystem: use new card detect fns
* SD card: fix low level init headers
* SD card: more realilable low level init, power reset, exit from command read cycle conditionally
* App SD-filesystem: led notifiers, init cycling
* SD card: backport to F4
* Api PWM: add c++ guards
* App iButton: yellow blink in emulate scene, vibro on
* App iButton: one wire keys command set
* App iButton: successful write scene
* App iButton: key writer
* App iButton: syntax fix
* App iButton: notify write success
* App iButton: fix double scene change
* SD card: handle eject in init sequence
* SD card: api to set level on detect gpio
* SPI: api to set state on bus pins
* SD card: set low state on bus pins while power reset
* File select: init
* File select: fix input consuming
* SD Card: fixed dir open api error
* SD-card: replace strncpy by strlcpy. Fix buffer overflow error.
* API HAL OS: replace CMP based ticks with ARR based one, hard reset lptimer on reconfiguration.
* GUI: More stack size for (temporary, wee need to implement sd card api in separate thread)
* GUI: File select module.
* App iButton-test: remove obsolete app
Co-authored-by: rusdacent <rusdacentx0x08@gmail.com>
Co-authored-by: coreglitch <mail@s3f.ru>
Co-authored-by: Aleksandr Kutuzov <alleteam@gmail.com>
2021-03-12 12:45:18 +00:00
|
|
|
}
|
|
|
|
|
2021-05-24 13:44:14 +00:00
|
|
|
void iButtonApp::notify_green_on() {
|
|
|
|
notification_message_block(notification, &sequence_set_green_255);
|
new iButton app (#328)
* rename old ibutton app to ibutton-test
* more renames
* updated onewire library compilation condition
* add submenu_clean subroutine
* add index for submenu callback
* c++ guard for gui modules
* add released ibutton app
* fix the position of the submenu window if there are too few items
* iButton app basis
* negative icon position info
* fix submenu_clean subroutine
* add ibutton app to applications makefile
* add onewire key read routine to read mode
* rename mode to scene
* rename files and folder (mode to scene)
* rename ibutton view to view manager
* rename get_view to get_view_manager
* cpp guards
* key read, store and notify features
* syntax fix
* make iButtonScene functions pure virtual
* fix syntax
* add text store, add new scene (crc error)
* not a key scene
* syntax fix
* read success scene
* app, switching to the previous scene with the number of scenes to be skipped
* scene whith menu when key is readed
* fix font height calculation, fix offsets
* add key write scene
* view_dispatcher_remove_view subroutine
* generic pause/resume os methods
* fix furi_assert usage
* key store, worker
* fix pointer comparsion
* saved keys, saved key action scenes
* key delete/confirm delete scenes and routines
* use last input subsystem changes
* fix syntax
* fix new model usage in submenu
* fix includes
* use vibro pin
* use stored key name if valid
* emulate scene
* random name generator
* name and save readed key scenes, new icon
* fix icon position
* fix text scene exit
* fix naming, fix text placement, new info scene
* state-driven cyfral decoder
* better cyfral decoder
* better cyfral decoder
* one wire: search command set
* metakom decoder
* more key types
* add next scene to error scenes
* universal key reader
* use new key reader
* syntax fix
* warning fix
* byte input module template
* new thread and insomnia api usage
* New element: slightly rounded frame
* Use elements_slightly_rounded_frame in text input
* Gui test app: byte input usage
* Byte input module: data drawing and selection
* Byte input: comment currently unused fns
* remove volatile qualifier
* base byte input realisation
* App gui test: remove internal fns visibility
* Byne input, final version
* test install gcc-arm-none-eabi-10-2020-q4-major
* test install gcc-arm-none-eabi-10-2020-q4-major
* App iButton: byte input view managment
* App iButton: add key manually scenes
* App iButton: rename scenes, add popup timeout
* App iButton: use new scenes, new fn for rollback to specific prevous scene.
* App iButton: remove byte input view on app exit
* App iButton: edit key scene
* Module byte input: reduce swintch value to uint8_t
* Module byte input: switch from switch-case to if, unfortunately we need compile-time constants to use with switch
* Icons: new small arrows
* Module byte input: new arrangement of elements
* OneWire slave lib: fix deattach sequence
* App iButton: pulse sequencer
* App iButton: add more keys to store
* App iButton: split key worker to separate read/write/emulate entitys
* App iButton: use new read/emulate entities
* fix callback pointer saving
* App iButton: use KeyReader error enum instead of KeyWorker error list handling
* App iButton: do not use insomnia fns in pulse sequencer
* App iButton: use KeyReader error enum in read scene
* OneWire slave lib: more READ ROM command variants, call callback only if positive result
* GPIO resources: add external gpio
* App SD/NFC: removed application
* App iButton-test: update to new light api
* App iButton: update to new light-api
* Outdated apps: add api-light-usage
* Gpio: update SD card CS pin settings
* API-power: added fns to disable/enable external 3v3 dc-dc
* API-gpio: separated SD card detect routines
* Resources: removed sd cs pin
* SD card: low level init now resets card power supply
* App SD-filesystem: use new card detect fns
* SD card: fix low level init headers
* SD card: more realilable low level init, power reset, exit from command read cycle conditionally
* App SD-filesystem: led notifiers, init cycling
* SD card: backport to F4
* Api PWM: add c++ guards
* App iButton: yellow blink in emulate scene, vibro on
* App iButton: one wire keys command set
* App iButton: successful write scene
* App iButton: key writer
* App iButton: syntax fix
* App iButton: notify write success
* App iButton: fix double scene change
* SD card: handle eject in init sequence
* SD card: api to set level on detect gpio
* SPI: api to set state on bus pins
* SD card: set low state on bus pins while power reset
* File select: init
* File select: fix input consuming
* SD Card: fixed dir open api error
* SD-card: replace strncpy by strlcpy. Fix buffer overflow error.
* API HAL OS: replace CMP based ticks with ARR based one, hard reset lptimer on reconfiguration.
* GUI: More stack size for (temporary, wee need to implement sd card api in separate thread)
* GUI: File select module.
* App iButton-test: remove obsolete app
Co-authored-by: rusdacent <rusdacentx0x08@gmail.com>
Co-authored-by: coreglitch <mail@s3f.ru>
Co-authored-by: Aleksandr Kutuzov <alleteam@gmail.com>
2021-03-12 12:45:18 +00:00
|
|
|
}
|
|
|
|
|
2021-05-24 13:44:14 +00:00
|
|
|
void iButtonApp::notify_green_off() {
|
|
|
|
notification_message(notification, &sequence_reset_green);
|
new iButton app (#328)
* rename old ibutton app to ibutton-test
* more renames
* updated onewire library compilation condition
* add submenu_clean subroutine
* add index for submenu callback
* c++ guard for gui modules
* add released ibutton app
* fix the position of the submenu window if there are too few items
* iButton app basis
* negative icon position info
* fix submenu_clean subroutine
* add ibutton app to applications makefile
* add onewire key read routine to read mode
* rename mode to scene
* rename files and folder (mode to scene)
* rename ibutton view to view manager
* rename get_view to get_view_manager
* cpp guards
* key read, store and notify features
* syntax fix
* make iButtonScene functions pure virtual
* fix syntax
* add text store, add new scene (crc error)
* not a key scene
* syntax fix
* read success scene
* app, switching to the previous scene with the number of scenes to be skipped
* scene whith menu when key is readed
* fix font height calculation, fix offsets
* add key write scene
* view_dispatcher_remove_view subroutine
* generic pause/resume os methods
* fix furi_assert usage
* key store, worker
* fix pointer comparsion
* saved keys, saved key action scenes
* key delete/confirm delete scenes and routines
* use last input subsystem changes
* fix syntax
* fix new model usage in submenu
* fix includes
* use vibro pin
* use stored key name if valid
* emulate scene
* random name generator
* name and save readed key scenes, new icon
* fix icon position
* fix text scene exit
* fix naming, fix text placement, new info scene
* state-driven cyfral decoder
* better cyfral decoder
* better cyfral decoder
* one wire: search command set
* metakom decoder
* more key types
* add next scene to error scenes
* universal key reader
* use new key reader
* syntax fix
* warning fix
* byte input module template
* new thread and insomnia api usage
* New element: slightly rounded frame
* Use elements_slightly_rounded_frame in text input
* Gui test app: byte input usage
* Byte input module: data drawing and selection
* Byte input: comment currently unused fns
* remove volatile qualifier
* base byte input realisation
* App gui test: remove internal fns visibility
* Byne input, final version
* test install gcc-arm-none-eabi-10-2020-q4-major
* test install gcc-arm-none-eabi-10-2020-q4-major
* App iButton: byte input view managment
* App iButton: add key manually scenes
* App iButton: rename scenes, add popup timeout
* App iButton: use new scenes, new fn for rollback to specific prevous scene.
* App iButton: remove byte input view on app exit
* App iButton: edit key scene
* Module byte input: reduce swintch value to uint8_t
* Module byte input: switch from switch-case to if, unfortunately we need compile-time constants to use with switch
* Icons: new small arrows
* Module byte input: new arrangement of elements
* OneWire slave lib: fix deattach sequence
* App iButton: pulse sequencer
* App iButton: add more keys to store
* App iButton: split key worker to separate read/write/emulate entitys
* App iButton: use new read/emulate entities
* fix callback pointer saving
* App iButton: use KeyReader error enum instead of KeyWorker error list handling
* App iButton: do not use insomnia fns in pulse sequencer
* App iButton: use KeyReader error enum in read scene
* OneWire slave lib: more READ ROM command variants, call callback only if positive result
* GPIO resources: add external gpio
* App SD/NFC: removed application
* App iButton-test: update to new light api
* App iButton: update to new light-api
* Outdated apps: add api-light-usage
* Gpio: update SD card CS pin settings
* API-power: added fns to disable/enable external 3v3 dc-dc
* API-gpio: separated SD card detect routines
* Resources: removed sd cs pin
* SD card: low level init now resets card power supply
* App SD-filesystem: use new card detect fns
* SD card: fix low level init headers
* SD card: more realilable low level init, power reset, exit from command read cycle conditionally
* App SD-filesystem: led notifiers, init cycling
* SD card: backport to F4
* Api PWM: add c++ guards
* App iButton: yellow blink in emulate scene, vibro on
* App iButton: one wire keys command set
* App iButton: successful write scene
* App iButton: key writer
* App iButton: syntax fix
* App iButton: notify write success
* App iButton: fix double scene change
* SD card: handle eject in init sequence
* SD card: api to set level on detect gpio
* SPI: api to set state on bus pins
* SD card: set low state on bus pins while power reset
* File select: init
* File select: fix input consuming
* SD Card: fixed dir open api error
* SD-card: replace strncpy by strlcpy. Fix buffer overflow error.
* API HAL OS: replace CMP based ticks with ARR based one, hard reset lptimer on reconfiguration.
* GUI: More stack size for (temporary, wee need to implement sd card api in separate thread)
* GUI: File select module.
* App iButton-test: remove obsolete app
Co-authored-by: rusdacent <rusdacentx0x08@gmail.com>
Co-authored-by: coreglitch <mail@s3f.ru>
Co-authored-by: Aleksandr Kutuzov <alleteam@gmail.com>
2021-03-12 12:45:18 +00:00
|
|
|
}
|
|
|
|
|
2021-05-24 13:44:14 +00:00
|
|
|
void iButtonApp::notify_red_on() {
|
|
|
|
notification_message_block(notification, &sequence_set_red_255);
|
new iButton app (#328)
* rename old ibutton app to ibutton-test
* more renames
* updated onewire library compilation condition
* add submenu_clean subroutine
* add index for submenu callback
* c++ guard for gui modules
* add released ibutton app
* fix the position of the submenu window if there are too few items
* iButton app basis
* negative icon position info
* fix submenu_clean subroutine
* add ibutton app to applications makefile
* add onewire key read routine to read mode
* rename mode to scene
* rename files and folder (mode to scene)
* rename ibutton view to view manager
* rename get_view to get_view_manager
* cpp guards
* key read, store and notify features
* syntax fix
* make iButtonScene functions pure virtual
* fix syntax
* add text store, add new scene (crc error)
* not a key scene
* syntax fix
* read success scene
* app, switching to the previous scene with the number of scenes to be skipped
* scene whith menu when key is readed
* fix font height calculation, fix offsets
* add key write scene
* view_dispatcher_remove_view subroutine
* generic pause/resume os methods
* fix furi_assert usage
* key store, worker
* fix pointer comparsion
* saved keys, saved key action scenes
* key delete/confirm delete scenes and routines
* use last input subsystem changes
* fix syntax
* fix new model usage in submenu
* fix includes
* use vibro pin
* use stored key name if valid
* emulate scene
* random name generator
* name and save readed key scenes, new icon
* fix icon position
* fix text scene exit
* fix naming, fix text placement, new info scene
* state-driven cyfral decoder
* better cyfral decoder
* better cyfral decoder
* one wire: search command set
* metakom decoder
* more key types
* add next scene to error scenes
* universal key reader
* use new key reader
* syntax fix
* warning fix
* byte input module template
* new thread and insomnia api usage
* New element: slightly rounded frame
* Use elements_slightly_rounded_frame in text input
* Gui test app: byte input usage
* Byte input module: data drawing and selection
* Byte input: comment currently unused fns
* remove volatile qualifier
* base byte input realisation
* App gui test: remove internal fns visibility
* Byne input, final version
* test install gcc-arm-none-eabi-10-2020-q4-major
* test install gcc-arm-none-eabi-10-2020-q4-major
* App iButton: byte input view managment
* App iButton: add key manually scenes
* App iButton: rename scenes, add popup timeout
* App iButton: use new scenes, new fn for rollback to specific prevous scene.
* App iButton: remove byte input view on app exit
* App iButton: edit key scene
* Module byte input: reduce swintch value to uint8_t
* Module byte input: switch from switch-case to if, unfortunately we need compile-time constants to use with switch
* Icons: new small arrows
* Module byte input: new arrangement of elements
* OneWire slave lib: fix deattach sequence
* App iButton: pulse sequencer
* App iButton: add more keys to store
* App iButton: split key worker to separate read/write/emulate entitys
* App iButton: use new read/emulate entities
* fix callback pointer saving
* App iButton: use KeyReader error enum instead of KeyWorker error list handling
* App iButton: do not use insomnia fns in pulse sequencer
* App iButton: use KeyReader error enum in read scene
* OneWire slave lib: more READ ROM command variants, call callback only if positive result
* GPIO resources: add external gpio
* App SD/NFC: removed application
* App iButton-test: update to new light api
* App iButton: update to new light-api
* Outdated apps: add api-light-usage
* Gpio: update SD card CS pin settings
* API-power: added fns to disable/enable external 3v3 dc-dc
* API-gpio: separated SD card detect routines
* Resources: removed sd cs pin
* SD card: low level init now resets card power supply
* App SD-filesystem: use new card detect fns
* SD card: fix low level init headers
* SD card: more realilable low level init, power reset, exit from command read cycle conditionally
* App SD-filesystem: led notifiers, init cycling
* SD card: backport to F4
* Api PWM: add c++ guards
* App iButton: yellow blink in emulate scene, vibro on
* App iButton: one wire keys command set
* App iButton: successful write scene
* App iButton: key writer
* App iButton: syntax fix
* App iButton: notify write success
* App iButton: fix double scene change
* SD card: handle eject in init sequence
* SD card: api to set level on detect gpio
* SPI: api to set state on bus pins
* SD card: set low state on bus pins while power reset
* File select: init
* File select: fix input consuming
* SD Card: fixed dir open api error
* SD-card: replace strncpy by strlcpy. Fix buffer overflow error.
* API HAL OS: replace CMP based ticks with ARR based one, hard reset lptimer on reconfiguration.
* GUI: More stack size for (temporary, wee need to implement sd card api in separate thread)
* GUI: File select module.
* App iButton-test: remove obsolete app
Co-authored-by: rusdacent <rusdacentx0x08@gmail.com>
Co-authored-by: coreglitch <mail@s3f.ru>
Co-authored-by: Aleksandr Kutuzov <alleteam@gmail.com>
2021-03-12 12:45:18 +00:00
|
|
|
}
|
|
|
|
|
2021-05-24 13:44:14 +00:00
|
|
|
void iButtonApp::notify_red_off() {
|
|
|
|
notification_message(notification, &sequence_reset_red);
|
new iButton app (#328)
* rename old ibutton app to ibutton-test
* more renames
* updated onewire library compilation condition
* add submenu_clean subroutine
* add index for submenu callback
* c++ guard for gui modules
* add released ibutton app
* fix the position of the submenu window if there are too few items
* iButton app basis
* negative icon position info
* fix submenu_clean subroutine
* add ibutton app to applications makefile
* add onewire key read routine to read mode
* rename mode to scene
* rename files and folder (mode to scene)
* rename ibutton view to view manager
* rename get_view to get_view_manager
* cpp guards
* key read, store and notify features
* syntax fix
* make iButtonScene functions pure virtual
* fix syntax
* add text store, add new scene (crc error)
* not a key scene
* syntax fix
* read success scene
* app, switching to the previous scene with the number of scenes to be skipped
* scene whith menu when key is readed
* fix font height calculation, fix offsets
* add key write scene
* view_dispatcher_remove_view subroutine
* generic pause/resume os methods
* fix furi_assert usage
* key store, worker
* fix pointer comparsion
* saved keys, saved key action scenes
* key delete/confirm delete scenes and routines
* use last input subsystem changes
* fix syntax
* fix new model usage in submenu
* fix includes
* use vibro pin
* use stored key name if valid
* emulate scene
* random name generator
* name and save readed key scenes, new icon
* fix icon position
* fix text scene exit
* fix naming, fix text placement, new info scene
* state-driven cyfral decoder
* better cyfral decoder
* better cyfral decoder
* one wire: search command set
* metakom decoder
* more key types
* add next scene to error scenes
* universal key reader
* use new key reader
* syntax fix
* warning fix
* byte input module template
* new thread and insomnia api usage
* New element: slightly rounded frame
* Use elements_slightly_rounded_frame in text input
* Gui test app: byte input usage
* Byte input module: data drawing and selection
* Byte input: comment currently unused fns
* remove volatile qualifier
* base byte input realisation
* App gui test: remove internal fns visibility
* Byne input, final version
* test install gcc-arm-none-eabi-10-2020-q4-major
* test install gcc-arm-none-eabi-10-2020-q4-major
* App iButton: byte input view managment
* App iButton: add key manually scenes
* App iButton: rename scenes, add popup timeout
* App iButton: use new scenes, new fn for rollback to specific prevous scene.
* App iButton: remove byte input view on app exit
* App iButton: edit key scene
* Module byte input: reduce swintch value to uint8_t
* Module byte input: switch from switch-case to if, unfortunately we need compile-time constants to use with switch
* Icons: new small arrows
* Module byte input: new arrangement of elements
* OneWire slave lib: fix deattach sequence
* App iButton: pulse sequencer
* App iButton: add more keys to store
* App iButton: split key worker to separate read/write/emulate entitys
* App iButton: use new read/emulate entities
* fix callback pointer saving
* App iButton: use KeyReader error enum instead of KeyWorker error list handling
* App iButton: do not use insomnia fns in pulse sequencer
* App iButton: use KeyReader error enum in read scene
* OneWire slave lib: more READ ROM command variants, call callback only if positive result
* GPIO resources: add external gpio
* App SD/NFC: removed application
* App iButton-test: update to new light api
* App iButton: update to new light-api
* Outdated apps: add api-light-usage
* Gpio: update SD card CS pin settings
* API-power: added fns to disable/enable external 3v3 dc-dc
* API-gpio: separated SD card detect routines
* Resources: removed sd cs pin
* SD card: low level init now resets card power supply
* App SD-filesystem: use new card detect fns
* SD card: fix low level init headers
* SD card: more realilable low level init, power reset, exit from command read cycle conditionally
* App SD-filesystem: led notifiers, init cycling
* SD card: backport to F4
* Api PWM: add c++ guards
* App iButton: yellow blink in emulate scene, vibro on
* App iButton: one wire keys command set
* App iButton: successful write scene
* App iButton: key writer
* App iButton: syntax fix
* App iButton: notify write success
* App iButton: fix double scene change
* SD card: handle eject in init sequence
* SD card: api to set level on detect gpio
* SPI: api to set state on bus pins
* SD card: set low state on bus pins while power reset
* File select: init
* File select: fix input consuming
* SD Card: fixed dir open api error
* SD-card: replace strncpy by strlcpy. Fix buffer overflow error.
* API HAL OS: replace CMP based ticks with ARR based one, hard reset lptimer on reconfiguration.
* GUI: More stack size for (temporary, wee need to implement sd card api in separate thread)
* GUI: File select module.
* App iButton-test: remove obsolete app
Co-authored-by: rusdacent <rusdacentx0x08@gmail.com>
Co-authored-by: coreglitch <mail@s3f.ru>
Co-authored-by: Aleksandr Kutuzov <alleteam@gmail.com>
2021-03-12 12:45:18 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void iButtonApp::set_text_store(const char* text...) {
|
|
|
|
va_list args;
|
|
|
|
va_start(args, text);
|
|
|
|
|
|
|
|
vsnprintf(text_store, text_store_size, text, args);
|
|
|
|
|
|
|
|
va_end(args);
|
|
|
|
}
|
|
|
|
|
|
|
|
char* iButtonApp::get_text_store() {
|
|
|
|
return text_store;
|
|
|
|
}
|
|
|
|
|
|
|
|
uint8_t iButtonApp::get_text_store_size() {
|
|
|
|
return text_store_size;
|
|
|
|
}
|
|
|
|
|
|
|
|
void iButtonApp::generate_random_name(char* name, uint8_t max_name_size) {
|
|
|
|
const uint8_t prefix_size = 9;
|
|
|
|
const char* prefix[prefix_size] = {
|
|
|
|
"ancient",
|
|
|
|
"hollow",
|
|
|
|
"strange",
|
|
|
|
"disappeared",
|
|
|
|
"unknown",
|
|
|
|
"unthinkable",
|
|
|
|
"unnamable",
|
|
|
|
"nameless",
|
|
|
|
"my",
|
|
|
|
};
|
|
|
|
|
|
|
|
const uint8_t suffix_size = 8;
|
|
|
|
const char* suffix[suffix_size] = {
|
|
|
|
"door",
|
|
|
|
"entrance",
|
|
|
|
"doorway",
|
|
|
|
"entry",
|
|
|
|
"portal",
|
|
|
|
"entree",
|
|
|
|
"opening",
|
|
|
|
"crack",
|
|
|
|
};
|
|
|
|
|
|
|
|
sniprintf(
|
|
|
|
name, max_name_size, "%s_%s", prefix[rand() % prefix_size], suffix[rand() % suffix_size]);
|
|
|
|
// to upper
|
|
|
|
name[0] = name[0] - 0x20;
|
2021-05-26 16:50:16 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// file managment
|
|
|
|
bool iButtonApp::save_key(const char* key_name) {
|
[FL-1191][FL-1524] Filesystem rework (#568)
* FS-Api: removed datetime manipulation functions and most of the file flags
* Filesystem: common proxy api
* Filesystem: renamed to Storage. Work has begun on a glue layer. Added functions for reentrance.
* Storage: sd mount and sd file open
* Storage: sd file close
* Storage: temporary test app
* Storage: free filedata on close
* Storage: sd file read and write
* Storage: added internal storage (LittleFS)
* Storage: renamed internal commands
* Storage: seek, tell, truncate, size, sync, eof
* Storage: error descriptions
* Storage: directory management api (open, close, read, rewind)
* Storage: common management api (stat, fs_stat, remove, rename, mkdir)
* Dolphin app and Notifications app now use raw storage.
* Storage: storage statuses renamed. Implemented sd card icon.
* Storage: added raw sd-card api.
* Storage settings: work started
* Assets: use new icons approach
* Storage settings: working storage settings
* Storage: completely redesigned api, no longer sticking out FS_Api
* Storage: more simplified api, getting error_id from file is hidden from user, pointer to api is hidden inside file
* Storage: cli info and format commands
* Storage-cli: file list
* Storage: a simpler and more reliable api
* FatFS: slightly lighter and faster config. Also disabled reentrancy and file locking functions. They moved to a storage service.
* Storage-cli: accommodate to the new cli api.
* Storage: filesystem api is separated into internal and common api.
* Cli: added the ability to print the list of free heap blocks
* Storage: uses a list instead of an array to store the StorageFile. Rewrote api calls to use semaphores instead of thread flags.
* Storage settings: added the ability to benchmark the SD card.
* Gui module file select: uses new storage api
* Apps: removed deprecated sd_card_test application
* Args lib: support for enquoted arguments
* Dialogs: a new gui app for simple non-asynchronous apps
* Dialogs: view holder for easy single view work
* File worker: use new storage api
* IButton and lfrrfid apps: save keys to any storage
* Apps: fix ibutton and lfrfid stack, remove sd_card_test.
* SD filesystem: app removed
* File worker: fixed api pointer type
* Subghz: loading assets using the new storage api
* NFC: use the new storage api
* Dialogs: the better api for the message element
* Archive: use new storage api
* Irda: changed assest path, changed app path
* FileWorker: removed unused file_buf_cnt
* Storage: copying and renaming files now works between storages
* Storage cli: read, copy, remove, rename commands
* Archive: removed commented code
* Storage cli: write command
* Applications: add SRV_STORAGE and SRV_DIALOGS
* Internal-storage: removed
* Storage: improved api
* Storage app: changed api pointer from StorageApp to Storage
* Storage: better file_id handling
* Storage: more consistent errors
* Loader: support for NULL icons
* Storage: do nothing with the lfs file or directory if it is not open
* Storage: fix typo
* Storage: minor float usage cleanup, rename some symbols.
* Storage: compact doxygen comments.
Co-authored-by: あく <alleteam@gmail.com>
2021-07-23 12:20:19 +00:00
|
|
|
// Create ibutton directory if necessary
|
|
|
|
make_app_folder();
|
|
|
|
|
2021-06-30 12:02:46 +00:00
|
|
|
FileWorkerCpp file_worker;
|
2021-05-26 16:50:16 +00:00
|
|
|
string_t key_file_name;
|
|
|
|
bool result = false;
|
|
|
|
|
|
|
|
// First remove key if it was saved
|
2021-06-29 13:08:45 +00:00
|
|
|
string_init_printf(key_file_name, "%s/%s%s", app_folder, get_key()->get_name(), app_extension);
|
|
|
|
if(!file_worker.remove(string_get_cstr(key_file_name))) {
|
2021-05-26 16:50:16 +00:00
|
|
|
string_clear(key_file_name);
|
|
|
|
return false;
|
|
|
|
};
|
|
|
|
|
|
|
|
// Save the key
|
|
|
|
get_key()->set_name(key_name);
|
2021-06-29 13:08:45 +00:00
|
|
|
string_printf(key_file_name, "%s/%s%s", app_folder, get_key()->get_name(), app_extension);
|
2021-05-26 16:50:16 +00:00
|
|
|
|
2021-06-29 13:08:45 +00:00
|
|
|
bool res = file_worker.open(string_get_cstr(key_file_name), FSAM_WRITE, FSOM_CREATE_ALWAYS);
|
2021-05-26 16:50:16 +00:00
|
|
|
string_clear(key_file_name);
|
|
|
|
|
|
|
|
if(res) {
|
|
|
|
// type header
|
2021-06-29 13:08:45 +00:00
|
|
|
const char* key_type = "E ";
|
2021-05-26 16:50:16 +00:00
|
|
|
|
|
|
|
switch(get_key()->get_key_type()) {
|
|
|
|
case iButtonKeyType::KeyCyfral:
|
2021-06-29 13:08:45 +00:00
|
|
|
key_type = "C ";
|
2021-05-26 16:50:16 +00:00
|
|
|
break;
|
|
|
|
case iButtonKeyType::KeyDallas:
|
2021-06-29 13:08:45 +00:00
|
|
|
key_type = "D ";
|
2021-05-26 16:50:16 +00:00
|
|
|
break;
|
|
|
|
case iButtonKeyType::KeyMetakom:
|
2021-06-29 13:08:45 +00:00
|
|
|
key_type = "M ";
|
2021-05-26 16:50:16 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
2021-06-29 13:08:45 +00:00
|
|
|
if(!file_worker.write(key_type, 2)) {
|
|
|
|
file_worker.close();
|
2021-05-26 16:50:16 +00:00
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
2021-06-29 13:08:45 +00:00
|
|
|
if(!file_worker.write_hex(get_key()->get_data(), get_key()->get_type_data_size())) {
|
|
|
|
file_worker.close();
|
|
|
|
return false;
|
2021-05-26 16:50:16 +00:00
|
|
|
}
|
|
|
|
result = true;
|
|
|
|
}
|
|
|
|
|
2021-06-29 13:08:45 +00:00
|
|
|
file_worker.close();
|
2021-05-26 16:50:16 +00:00
|
|
|
|
|
|
|
return result;
|
|
|
|
}
|
|
|
|
|
2021-06-24 11:32:33 +00:00
|
|
|
bool iButtonApp::load_key_data(string_t key_path) {
|
2021-06-30 12:02:46 +00:00
|
|
|
FileWorkerCpp file_worker;
|
2021-05-26 16:50:16 +00:00
|
|
|
|
2021-06-24 11:32:33 +00:00
|
|
|
// Open key file
|
2021-06-29 13:08:45 +00:00
|
|
|
if(!file_worker.open(string_get_cstr(key_path), FSAM_READ, FSOM_OPEN_EXISTING)) {
|
|
|
|
file_worker.close();
|
2021-06-24 11:32:33 +00:00
|
|
|
return false;
|
|
|
|
}
|
2021-05-26 16:50:16 +00:00
|
|
|
|
2021-06-24 11:32:33 +00:00
|
|
|
const uint8_t byte_text_size = 4;
|
|
|
|
char byte_text[byte_text_size] = {0, 0, 0, 0};
|
2021-05-26 16:50:16 +00:00
|
|
|
|
2021-06-29 13:08:45 +00:00
|
|
|
// Load type header
|
|
|
|
if(!file_worker.read(byte_text, 2)) {
|
|
|
|
file_worker.close();
|
2021-06-24 11:32:33 +00:00
|
|
|
return false;
|
|
|
|
}
|
2021-05-26 16:50:16 +00:00
|
|
|
|
2021-06-24 11:32:33 +00:00
|
|
|
iButtonKeyType key_type = iButtonKeyType::KeyCyfral;
|
2021-06-29 13:08:45 +00:00
|
|
|
if(strcmp(byte_text, "C ") == 0) {
|
2021-06-24 11:32:33 +00:00
|
|
|
key_type = iButtonKeyType::KeyCyfral;
|
2021-06-29 13:08:45 +00:00
|
|
|
} else if(strcmp(byte_text, "M ") == 0) {
|
2021-06-24 11:32:33 +00:00
|
|
|
key_type = iButtonKeyType::KeyMetakom;
|
2021-06-29 13:08:45 +00:00
|
|
|
} else if(strcmp(byte_text, "D ") == 0) {
|
2021-06-24 11:32:33 +00:00
|
|
|
key_type = iButtonKeyType::KeyDallas;
|
|
|
|
} else {
|
2021-06-29 13:08:45 +00:00
|
|
|
file_worker.show_error("Cannot parse\nkey file");
|
|
|
|
file_worker.close();
|
2021-06-24 11:32:33 +00:00
|
|
|
return false;
|
|
|
|
}
|
2021-05-26 16:50:16 +00:00
|
|
|
|
2021-06-29 13:08:45 +00:00
|
|
|
iButtonKeyType old_type = get_key()->get_key_type();
|
2021-06-24 11:32:33 +00:00
|
|
|
get_key()->set_type(key_type);
|
2021-05-26 16:50:16 +00:00
|
|
|
|
2021-06-24 11:32:33 +00:00
|
|
|
uint8_t key_data[IBUTTON_KEY_DATA_SIZE] = {0, 0, 0, 0, 0, 0, 0, 0};
|
2021-06-29 13:08:45 +00:00
|
|
|
if(!file_worker.read_hex(key_data, get_key()->get_type_data_size())) {
|
|
|
|
get_key()->set_type(old_type);
|
|
|
|
file_worker.close();
|
|
|
|
return false;
|
2021-06-24 11:32:33 +00:00
|
|
|
}
|
2021-05-26 16:50:16 +00:00
|
|
|
|
2021-06-29 13:08:45 +00:00
|
|
|
file_worker.close();
|
2021-06-24 11:32:33 +00:00
|
|
|
get_key()->set_data(key_data, IBUTTON_KEY_DATA_SIZE);
|
2021-05-26 16:50:16 +00:00
|
|
|
|
2021-06-24 11:32:33 +00:00
|
|
|
return true;
|
|
|
|
}
|
2021-05-26 16:50:16 +00:00
|
|
|
|
2021-06-24 11:32:33 +00:00
|
|
|
bool iButtonApp::load_key(const char* key_name) {
|
|
|
|
bool result = false;
|
|
|
|
string_t key_path;
|
2021-05-26 16:50:16 +00:00
|
|
|
|
2021-06-24 11:32:33 +00:00
|
|
|
string_init_set_str(key_path, key_name);
|
2021-05-26 16:50:16 +00:00
|
|
|
|
2021-06-24 11:32:33 +00:00
|
|
|
result = load_key_data(key_path);
|
|
|
|
if(result) {
|
2021-07-15 21:39:21 +00:00
|
|
|
path_extract_filename_no_ext(key_name, key_path);
|
2021-06-24 11:32:33 +00:00
|
|
|
get_key()->set_name(string_get_cstr(key_path));
|
|
|
|
}
|
|
|
|
string_clear(key_path);
|
|
|
|
return result;
|
|
|
|
}
|
|
|
|
|
|
|
|
bool iButtonApp::load_key() {
|
|
|
|
bool result = false;
|
2021-06-30 12:02:46 +00:00
|
|
|
FileWorkerCpp file_worker;
|
2021-06-24 11:32:33 +00:00
|
|
|
|
|
|
|
// Input events and views are managed by file_select
|
2021-06-29 13:08:45 +00:00
|
|
|
bool res = file_worker.file_select(
|
|
|
|
app_folder, app_extension, get_file_name(), get_file_name_size(), get_key()->get_name());
|
2021-06-24 11:32:33 +00:00
|
|
|
|
|
|
|
if(res) {
|
|
|
|
string_t key_str;
|
|
|
|
|
|
|
|
// Get key file path
|
2021-06-29 13:08:45 +00:00
|
|
|
string_init_printf(key_str, "%s/%s%s", app_folder, get_file_name(), app_extension);
|
2021-06-24 11:32:33 +00:00
|
|
|
|
|
|
|
result = load_key_data(key_str);
|
|
|
|
if(result) {
|
|
|
|
get_key()->set_name(get_file_name());
|
|
|
|
}
|
|
|
|
string_clear(key_str);
|
2021-05-26 16:50:16 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
return result;
|
|
|
|
}
|
|
|
|
|
|
|
|
bool iButtonApp::delete_key() {
|
2021-06-29 13:08:45 +00:00
|
|
|
string_t file_name;
|
2021-05-26 16:50:16 +00:00
|
|
|
bool result = false;
|
2021-06-30 12:02:46 +00:00
|
|
|
FileWorkerCpp file_worker;
|
2021-05-26 16:50:16 +00:00
|
|
|
|
2021-06-29 13:08:45 +00:00
|
|
|
string_init_printf(file_name, "%s/%s%s", app_folder, get_key()->get_name(), app_extension);
|
|
|
|
result = file_worker.remove(string_get_cstr(file_name));
|
|
|
|
string_clear(file_name);
|
2021-05-26 16:50:16 +00:00
|
|
|
|
|
|
|
return result;
|
[FL-1191][FL-1524] Filesystem rework (#568)
* FS-Api: removed datetime manipulation functions and most of the file flags
* Filesystem: common proxy api
* Filesystem: renamed to Storage. Work has begun on a glue layer. Added functions for reentrance.
* Storage: sd mount and sd file open
* Storage: sd file close
* Storage: temporary test app
* Storage: free filedata on close
* Storage: sd file read and write
* Storage: added internal storage (LittleFS)
* Storage: renamed internal commands
* Storage: seek, tell, truncate, size, sync, eof
* Storage: error descriptions
* Storage: directory management api (open, close, read, rewind)
* Storage: common management api (stat, fs_stat, remove, rename, mkdir)
* Dolphin app and Notifications app now use raw storage.
* Storage: storage statuses renamed. Implemented sd card icon.
* Storage: added raw sd-card api.
* Storage settings: work started
* Assets: use new icons approach
* Storage settings: working storage settings
* Storage: completely redesigned api, no longer sticking out FS_Api
* Storage: more simplified api, getting error_id from file is hidden from user, pointer to api is hidden inside file
* Storage: cli info and format commands
* Storage-cli: file list
* Storage: a simpler and more reliable api
* FatFS: slightly lighter and faster config. Also disabled reentrancy and file locking functions. They moved to a storage service.
* Storage-cli: accommodate to the new cli api.
* Storage: filesystem api is separated into internal and common api.
* Cli: added the ability to print the list of free heap blocks
* Storage: uses a list instead of an array to store the StorageFile. Rewrote api calls to use semaphores instead of thread flags.
* Storage settings: added the ability to benchmark the SD card.
* Gui module file select: uses new storage api
* Apps: removed deprecated sd_card_test application
* Args lib: support for enquoted arguments
* Dialogs: a new gui app for simple non-asynchronous apps
* Dialogs: view holder for easy single view work
* File worker: use new storage api
* IButton and lfrrfid apps: save keys to any storage
* Apps: fix ibutton and lfrfid stack, remove sd_card_test.
* SD filesystem: app removed
* File worker: fixed api pointer type
* Subghz: loading assets using the new storage api
* NFC: use the new storage api
* Dialogs: the better api for the message element
* Archive: use new storage api
* Irda: changed assest path, changed app path
* FileWorker: removed unused file_buf_cnt
* Storage: copying and renaming files now works between storages
* Storage cli: read, copy, remove, rename commands
* Archive: removed commented code
* Storage cli: write command
* Applications: add SRV_STORAGE and SRV_DIALOGS
* Internal-storage: removed
* Storage: improved api
* Storage app: changed api pointer from StorageApp to Storage
* Storage: better file_id handling
* Storage: more consistent errors
* Loader: support for NULL icons
* Storage: do nothing with the lfs file or directory if it is not open
* Storage: fix typo
* Storage: minor float usage cleanup, rename some symbols.
* Storage: compact doxygen comments.
Co-authored-by: あく <alleteam@gmail.com>
2021-07-23 12:20:19 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void iButtonApp::make_app_folder() {
|
|
|
|
FileWorkerCpp file_worker;
|
|
|
|
file_worker.mkdir(app_folder);
|
new iButton app (#328)
* rename old ibutton app to ibutton-test
* more renames
* updated onewire library compilation condition
* add submenu_clean subroutine
* add index for submenu callback
* c++ guard for gui modules
* add released ibutton app
* fix the position of the submenu window if there are too few items
* iButton app basis
* negative icon position info
* fix submenu_clean subroutine
* add ibutton app to applications makefile
* add onewire key read routine to read mode
* rename mode to scene
* rename files and folder (mode to scene)
* rename ibutton view to view manager
* rename get_view to get_view_manager
* cpp guards
* key read, store and notify features
* syntax fix
* make iButtonScene functions pure virtual
* fix syntax
* add text store, add new scene (crc error)
* not a key scene
* syntax fix
* read success scene
* app, switching to the previous scene with the number of scenes to be skipped
* scene whith menu when key is readed
* fix font height calculation, fix offsets
* add key write scene
* view_dispatcher_remove_view subroutine
* generic pause/resume os methods
* fix furi_assert usage
* key store, worker
* fix pointer comparsion
* saved keys, saved key action scenes
* key delete/confirm delete scenes and routines
* use last input subsystem changes
* fix syntax
* fix new model usage in submenu
* fix includes
* use vibro pin
* use stored key name if valid
* emulate scene
* random name generator
* name and save readed key scenes, new icon
* fix icon position
* fix text scene exit
* fix naming, fix text placement, new info scene
* state-driven cyfral decoder
* better cyfral decoder
* better cyfral decoder
* one wire: search command set
* metakom decoder
* more key types
* add next scene to error scenes
* universal key reader
* use new key reader
* syntax fix
* warning fix
* byte input module template
* new thread and insomnia api usage
* New element: slightly rounded frame
* Use elements_slightly_rounded_frame in text input
* Gui test app: byte input usage
* Byte input module: data drawing and selection
* Byte input: comment currently unused fns
* remove volatile qualifier
* base byte input realisation
* App gui test: remove internal fns visibility
* Byne input, final version
* test install gcc-arm-none-eabi-10-2020-q4-major
* test install gcc-arm-none-eabi-10-2020-q4-major
* App iButton: byte input view managment
* App iButton: add key manually scenes
* App iButton: rename scenes, add popup timeout
* App iButton: use new scenes, new fn for rollback to specific prevous scene.
* App iButton: remove byte input view on app exit
* App iButton: edit key scene
* Module byte input: reduce swintch value to uint8_t
* Module byte input: switch from switch-case to if, unfortunately we need compile-time constants to use with switch
* Icons: new small arrows
* Module byte input: new arrangement of elements
* OneWire slave lib: fix deattach sequence
* App iButton: pulse sequencer
* App iButton: add more keys to store
* App iButton: split key worker to separate read/write/emulate entitys
* App iButton: use new read/emulate entities
* fix callback pointer saving
* App iButton: use KeyReader error enum instead of KeyWorker error list handling
* App iButton: do not use insomnia fns in pulse sequencer
* App iButton: use KeyReader error enum in read scene
* OneWire slave lib: more READ ROM command variants, call callback only if positive result
* GPIO resources: add external gpio
* App SD/NFC: removed application
* App iButton-test: update to new light api
* App iButton: update to new light-api
* Outdated apps: add api-light-usage
* Gpio: update SD card CS pin settings
* API-power: added fns to disable/enable external 3v3 dc-dc
* API-gpio: separated SD card detect routines
* Resources: removed sd cs pin
* SD card: low level init now resets card power supply
* App SD-filesystem: use new card detect fns
* SD card: fix low level init headers
* SD card: more realilable low level init, power reset, exit from command read cycle conditionally
* App SD-filesystem: led notifiers, init cycling
* SD card: backport to F4
* Api PWM: add c++ guards
* App iButton: yellow blink in emulate scene, vibro on
* App iButton: one wire keys command set
* App iButton: successful write scene
* App iButton: key writer
* App iButton: syntax fix
* App iButton: notify write success
* App iButton: fix double scene change
* SD card: handle eject in init sequence
* SD card: api to set level on detect gpio
* SPI: api to set state on bus pins
* SD card: set low state on bus pins while power reset
* File select: init
* File select: fix input consuming
* SD Card: fixed dir open api error
* SD-card: replace strncpy by strlcpy. Fix buffer overflow error.
* API HAL OS: replace CMP based ticks with ARR based one, hard reset lptimer on reconfiguration.
* GUI: More stack size for (temporary, wee need to implement sd card api in separate thread)
* GUI: File select module.
* App iButton-test: remove obsolete app
Co-authored-by: rusdacent <rusdacentx0x08@gmail.com>
Co-authored-by: coreglitch <mail@s3f.ru>
Co-authored-by: Aleksandr Kutuzov <alleteam@gmail.com>
2021-03-12 12:45:18 +00:00
|
|
|
}
|