+int CmdT55xxSetConfig(const char *Cmd){\r
+\r
+ uint8_t data[] = {0x78,0x00,0x00,0x00,0x00,0x00,0x00};\r
+ uint8_t cmd[] = {0x00,0x00};\r
+ ComputeCrc14443(CRC_14443_B, data, 7 , &cmd[0], &cmd[1]);\r
+ PrintAndLog("%02X %02X",cmd[0], cmd[1]);\r
+ int len = 0;\r
+ int foundModulation = 2;\r
+ uint8_t offset = 0;\r
+ bool inverse = FALSE;\r
+ bool errors = FALSE;\r
+ uint8_t cmdp = 0;\r
+ char modulation[4] = {0x00};\r
+ \r
+ while(param_getchar(Cmd, cmdp) != 0x00 && !errors)\r
+ {\r
+ switch(param_getchar(Cmd, cmdp))\r
+ {\r
+ case 'h':\r
+ case 'H':\r
+ return usage_t55xx_config();\r
+ case 'd':\r
+ len = param_getstr(Cmd, cmdp+1, modulation);\r
+ cmdp+= len+1;\r
+ //FSK|ASK|PSK|NZ|BI\r
+ if ( strcmp(modulation, "FSK" ) == 0)\r
+ foundModulation = 1;\r
+ else if ( strcmp(modulation, "ASK" ) == 0)\r
+ foundModulation = 2;\r
+ else if ( strcmp(modulation, "PSK" ) == 0)\r
+ foundModulation = 3;\r
+ else if ( strcmp(modulation, "NZ" ) == 0)\r
+ foundModulation = 4;\r
+ else if ( strcmp(modulation, "BI" ) == 0)\r
+ foundModulation = 5;\r
+ else {\r
+ PrintAndLog("Unknown modulation '%s'", modulation);\r
+ errors = TRUE;\r
+ }\r
+ break;\r
+ case 'i':\r
+ inverse = param_getchar(Cmd,cmdp+1) == '1';\r
+ cmdp+=2;\r
+ break;\r
+ case 'o':\r
+ errors |= param_getdec(Cmd, cmdp+1,&offset);\r
+ if ( offset >= 32 ){\r
+ PrintAndLog("Offset must be smaller than 32");\r
+ errors = TRUE;\r
+ }\r
+ cmdp+=2;\r
+ break;\r
+ default:\r
+ PrintAndLog("Unknown parameter '%c'", param_getchar(Cmd, cmdp));\r
+ errors = TRUE;\r
+ break;\r
+ }\r
+ }\r
+ // No args\r
+ if (cmdp == 0) {\r
+ printConfiguration( config );\r
+ return 0;\r
+ }\r
+ //Validations\r
+ if (errors)\r
+ return usage_t55xx_config();\r
+ \r
+ config.modulation = foundModulation;\r
+ config.inversed = inverse;\r
+ config.offset = offset;\r
+ config.block0 = 0;\r
+ return 0;\r
+}\r
+\r
+int CmdT55xxReadBlock(const char *Cmd)\r