-//TODO: write a help text (iceman)
-int CmdLegicRfFill(const char *Cmd) {
- UsbCommand cmd = {CMD_WRITER_LEGIC_RF, {0,0,0} };
- int res = sscanf(Cmd, " 0x%"llx" 0x%"llx" 0x%"llx, &cmd.arg[0], &cmd.arg[1], &cmd.arg[2]);
- if(res != 3) {
- PrintAndLog("Please specify the offset, length and value as two hex strings");
- return -1;
- }
-
- int i;
- UsbCommand c = {CMD_DOWNLOADED_SIM_SAMPLES_125K, {0, 0, 0}};
- memset(c.d.asBytes, cmd.arg[2], 48);
-
- for(i = 0; i < 22; i++) {
- c.arg[0] = i*48;
-
- clearCommandBuffer();
- SendCommand(&c);
- WaitForResponse(CMD_ACK, NULL);
- }
- clearCommandBuffer();
- SendCommand(&cmd);
- return 0;
- }
-
-void static calc4(uint8_t *cmd, uint8_t len){
- crc_t crc;
- //crc_init_ref(&crc, 4, 0x19 >> 1, 0x5, 0, TRUE, TRUE);
- crc_init(&crc, 4, 0x19 >> 1, 0x5, 0);
-
- crc_clear(&crc);
- crc_update(&crc, 1, 1); /* CMD_READ */
- crc_update(&crc, cmd[0], 8);
- crc_update(&crc, cmd[1], 8);
- printf("crc4 %X\n", reflect(crc_finish(&crc), 4) ) ;
-
- crc_clear(&crc);
- crc_update(&crc, 1, 1); /* CMD_READ */
- crc_update(&crc, cmd[0], 8);
- crc_update(&crc, cmd[1], 8);
- printf("crc4 %X\n", crc_finish(&crc) ) ;
-
- printf("---- old ---\n");
- crc_update2(&crc, 1, 1); /* CMD_READ */
- crc_update2(&crc, cmd[0], 8);
- crc_update2(&crc, cmd[1], 8);
- printf("crc4 %X \n", reflect(crc_finish(&crc), 4) ) ;
-
-
- crc_clear(&crc);
- crc_update2(&crc, 1, 1); /* CMD_READ */
- crc_update2(&crc, cmd[0], 8);
- crc_update2(&crc, cmd[1], 8);
- printf("crc4 %X\n", crc_finish(&crc) ) ;
-}
-
-int CmdLegicCalcCrc8(const char *Cmd){