]> git.zerfleddert.de Git - proxmark3-svn/blobdiff - client/cmdlfawid.c
FIX: had to make it clientside only
[proxmark3-svn] / client / cmdlfawid.c
index 8b04a3d6b109ace53e016a6a8ad530f57367916a..9883437a759c93824656172c685fc86611e51a7f 100644 (file)
@@ -116,10 +116,9 @@ static bool sendTry(uint8_t fmtlen, uint32_t fc, uint32_t cn, uint32_t delay, ui
 }
 
 int CmdAWIDDemodFSK(const char *Cmd) {
-       int findone = 0;
-       if (Cmd[0] == 'h' || Cmd[0] == 'H') return usage_lf_awid_fskdemod();
-       if (Cmd[0] == '1') findone = 1;
 
+       if (Cmd[0] == 'h' || Cmd[0] == 'H') return usage_lf_awid_fskdemod();
+       uint8_t findone = (Cmd[0] == '1') ? 1 : 0;
        UsbCommand c = {CMD_AWID_DEMOD_FSK, {findone, 0, 0}};
        clearCommandBuffer();
        SendCommand(&c);
@@ -282,9 +281,9 @@ int CmdAWIDClone(const char *Cmd) {
 
        if ( !fc || !cn) return usage_lf_awid_clone();
        
-       if (param_getchar(Cmd, 4) == 'Q' || param_getchar(Cmd, 4) == 'q')
+       if (param_getchar(Cmd, 3) == 'Q' || param_getchar(Cmd, 3) == 'q')
                //t5555 (Q5) BITRATE = (RF-2)/2 (iceman)
-               blocks[0] = T5555_MODULATION_FSK2 | T5555_INVERT_OUTPUT | 50<<T5555_BITRATE_SHIFT | 3<<T5555_MAXBLOCK_SHIFT;
+               blocks[0] = T5555_MODULATION_FSK2 | T5555_INVERT_OUTPUT | ((50-2)>>1) << T5555_BITRATE_SHIFT | 3<<T5555_MAXBLOCK_SHIFT;
 
        verify_values(&fmtlen, &fc, &cn);
                
@@ -313,7 +312,7 @@ int CmdAWIDClone(const char *Cmd) {
                c.arg[1] = i;
                clearCommandBuffer();
                SendCommand(&c);
-               if (!WaitForResponseTimeout(CMD_ACK, &resp, 1500)){
+               if (!WaitForResponseTimeout(CMD_ACK, &resp, T55XX_WRITE_TIMEOUT)){
                        PrintAndLog("Error occurred, device did not respond during write operation.");
                        return -1;
                }
Impressum, Datenschutz