2022-01-05 16:10:18 +00:00
|
|
|
#include "key_info.h"
|
2021-06-30 12:02:46 +00:00
|
|
|
#include <string.h>
|
2021-06-10 11:53:59 +00:00
|
|
|
|
|
|
|
const char* lfrfid_key_get_type_string(LfrfidKeyType type) {
|
|
|
|
switch(type) {
|
|
|
|
case LfrfidKeyType::KeyEM4100:
|
|
|
|
return "EM4100";
|
|
|
|
break;
|
|
|
|
case LfrfidKeyType::KeyH10301:
|
|
|
|
return "H10301";
|
|
|
|
break;
|
|
|
|
case LfrfidKeyType::KeyI40134:
|
|
|
|
return "I40134";
|
|
|
|
break;
|
2022-05-23 13:21:34 +00:00
|
|
|
case LfrfidKeyType::KeyIoProxXSF:
|
|
|
|
return "IoProxXSF";
|
|
|
|
break;
|
2021-06-10 11:53:59 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
return "Unknown";
|
|
|
|
}
|
|
|
|
|
2021-07-13 09:06:54 +00:00
|
|
|
const char* lfrfid_key_get_manufacturer_string(LfrfidKeyType type) {
|
|
|
|
switch(type) {
|
|
|
|
case LfrfidKeyType::KeyEM4100:
|
2021-08-10 23:09:51 +00:00
|
|
|
return "EM-Marin";
|
2021-07-13 09:06:54 +00:00
|
|
|
break;
|
|
|
|
case LfrfidKeyType::KeyH10301:
|
|
|
|
return "HID";
|
|
|
|
break;
|
|
|
|
case LfrfidKeyType::KeyI40134:
|
|
|
|
return "Indala";
|
|
|
|
break;
|
2022-05-23 13:21:34 +00:00
|
|
|
case LfrfidKeyType::KeyIoProxXSF:
|
|
|
|
return "Kantech";
|
2021-07-13 09:06:54 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
return "Unknown";
|
|
|
|
}
|
|
|
|
|
2021-06-30 12:02:46 +00:00
|
|
|
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;
|
2022-05-23 13:21:34 +00:00
|
|
|
} else if(strcmp("IoProxXSF", string) == 0) {
|
|
|
|
*type = LfrfidKeyType::KeyIoProxXSF;
|
2021-06-30 12:02:46 +00:00
|
|
|
} else {
|
|
|
|
result = false;
|
|
|
|
}
|
|
|
|
|
|
|
|
return result;
|
|
|
|
}
|
|
|
|
|
2021-06-10 11:53:59 +00:00
|
|
|
uint8_t lfrfid_key_get_type_data_count(LfrfidKeyType type) {
|
|
|
|
switch(type) {
|
|
|
|
case LfrfidKeyType::KeyEM4100:
|
|
|
|
return 5;
|
|
|
|
break;
|
|
|
|
case LfrfidKeyType::KeyH10301:
|
|
|
|
return 3;
|
|
|
|
break;
|
|
|
|
case LfrfidKeyType::KeyI40134:
|
|
|
|
return 3;
|
|
|
|
break;
|
2022-05-23 13:21:34 +00:00
|
|
|
case LfrfidKeyType::KeyIoProxXSF:
|
|
|
|
return 4;
|
|
|
|
break;
|
2021-06-10 11:53:59 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
return 0;
|
2022-05-06 13:37:10 +00:00
|
|
|
}
|