Commit 4f0274d9 by developer33

ReaderOpenEx added, lib submodule and binaries updated

parent e6097604
This source diff could not be displayed because it is too large. You can view the blob instead.
lib @ f15ba92a
Subproject commit e26eef7640a6283ab9369074fc1652e68640dcdb
Subproject commit f15ba92accf0a4055130e1e88f01777840787aad
......@@ -54,24 +54,63 @@ int main(void)
uint8_t sak, uid_size, uid[10];
UFR_STATUS status;
usage();
printf(" --------------------------------------------------\n");
printf(" Please wait while opening uFR NFC reader.\n");
printf(" --------------------------------------------------\n");
#ifdef __DEBUG
status = ReaderOpenEx(1, PORT_NAME, 1, NULL);
#else
status = ReaderOpen();
#endif
if (status != UFR_OK)
{
printf("Error while opening device, status is: 0x%08X\n", status);
getchar();
return EXIT_FAILURE;
}
int mode = 0;
printf("Select reader opening mode:\n");
printf(" (1) - Simple Reader Open\n");
printf(" (2) - Advanced Reader Open\n");
scanf("%d", &mode);
fflush(stdin);
if (mode == 1){
status = ReaderOpen();
}
else if (mode == 2)
{
uint32_t reader_type = 1;
char port_name[1024] = "";
uint32_t port_interface = 2;
char open_args[1024] = "";
const char str_interface[2] = "";
printf("Enter reader type:\n");
scanf("%d", &reader_type);
fflush(stdin);
printf("Enter port name:\n");
scanf("%s", port_name);
fflush(stdin);
printf("Enter port interface:\n");
scanf("%s", str_interface);
if (str_interface[0] == 'U'){
port_interface = 85;
} else if (str_interface[0] == 'T'){
port_interface = 84;
} else{
port_interface = atoi(str_interface);
}
fflush(stdin);
printf("Enter additional argument:\n");
scanf("%s", open_args);
fflush(stdin);
status = ReaderOpenEx(reader_type, port_name, port_interface, open_args);
}
else
{
printf("Invalid input. Press any key to quit the application...");
getchar();
return EXIT_FAILURE;
}
status = ReaderReset();
if (status != UFR_OK)
{
printf("Error while opening device, status is: 0x%08X\n", status);
......@@ -79,6 +118,8 @@ int main(void)
return EXIT_FAILURE;
}
#if __WIN32 || __WIN64
Sleep(500);
#else // if linux || __linux__ || __APPLE__
......@@ -96,6 +137,10 @@ int main(void)
printf(" uFR NFC reader successfully opened.\n");
printf(" --------------------------------------------------\n");
usage();
#if linux || __linux__ || __APPLE__
_initTermios(0);
#endif
......
......@@ -107,14 +107,14 @@ sz_ptr GetDlTypeName(uint8_t dl_type_code) {
return "DL_MIFARE_CLASSIC_1K";
case DL_MIFARE_CLASSIC_4K:
return "DL_MIFARE_CLASSIC_4K";
case DL_MIFARE_PLUS_S_2K:
return "DL_MIFARE_PLUS_S_2K";
case DL_MIFARE_PLUS_S_4K:
return "DL_MIFARE_PLUS_S_4K";
case DL_MIFARE_PLUS_X_2K:
return "DL_MIFARE_PLUS_X_2K";
case DL_MIFARE_PLUS_X_4K:
return "DL_MIFARE_PLUS_X_4K";
case DL_MIFARE_PLUS_S_2K_SL0:
return "DL_MIFARE_PLUS_S_2K_SL0";
case DL_MIFARE_PLUS_S_4K_SL0:
return "DL_MIFARE_PLUS_S_4K_SL0";
case DL_MIFARE_PLUS_X_2K_SL0:
return "DL_MIFARE_PLUS_X_2K_SL0";
case DL_MIFARE_PLUS_X_4K_SL0:
return "DL_MIFARE_PLUS_X_4K_SL0";
case DL_MIFARE_DESFIRE:
return "DL_MIFARE_DESFIRE";
case DL_MIFARE_DESFIRE_EV1_2K:
......@@ -130,9 +130,9 @@ sz_ptr GetDlTypeName(uint8_t dl_type_code) {
case DL_MIFARE_DESFIRE_EV2_8K:
return "DL_MIFARE_DESFIRE_EV2_8K";
case DL_GENERIC_ISO14443_4:
return "DL_GENERIC_ISO_14443_4";
case DL_GENERIC_ISO14443_TYPE_B:
return "DL_GENERIC_ISO14443_TYPE_B";
return "DL_GENERIC_ISO14443_4";
case DL_GENERIC_ISO14443_4_TYPE_B:
return "DL_GENERIC_ISO14443_4_TYPE_B";
case DL_IMEI_UID:
return "DL_IMEI_UID";
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment