[FL-1371] New LF-RFID app. Second encounter. (#547)
* File worker: file operations helper. * Notification app: removed yield * File worker: write operations, calls to system file widgets * App ibutton: use file worker * Lfrfid: generic key loading, add path helper and hex conversion to lib * FileWorker: plain C verison * FileWorker: add to lib.mk * FileWorker: add to C sources, instead of CPP * Lfrfid: save scene * App lfrfid: add key scene, saved key menu * App lfrfid: saved key info scene * App lfrfid: delete key scene
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
#include "key-info.h"
|
||||
#include <string.h>
|
||||
|
||||
const char* lfrfid_key_get_type_string(LfrfidKeyType type) {
|
||||
switch(type) {
|
||||
@@ -16,6 +17,22 @@ const char* lfrfid_key_get_type_string(LfrfidKeyType type) {
|
||||
return "Unknown";
|
||||
}
|
||||
|
||||
bool lfrfid_key_get_string_type(const char* string, LfrfidKeyType* type) {
|
||||
bool result = true;
|
||||
|
||||
if(strcmp("EM4100", string) == 0) {
|
||||
*type = LfrfidKeyType::KeyEM4100;
|
||||
} else if(strcmp("H10301", string) == 0) {
|
||||
*type = LfrfidKeyType::KeyH10301;
|
||||
} else if(strcmp("I40134", string) == 0) {
|
||||
*type = LfrfidKeyType::KeyI40134;
|
||||
} else {
|
||||
result = false;
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
uint8_t lfrfid_key_get_type_data_count(LfrfidKeyType type) {
|
||||
switch(type) {
|
||||
case LfrfidKeyType::KeyEM4100:
|
||||
|
Reference in New Issue
Block a user