]> git.zerfleddert.de Git - proxmark3-svn/commitdiff
removed another redundant function to compose reader short frame
authorroel@libnfc.org <roel@libnfc.org@ef4ab9da-24cd-11de-8aaa-f3a34680c41f>
Wed, 3 Apr 2013 11:18:01 +0000 (11:18 +0000)
committerroel@libnfc.org <roel@libnfc.org@ef4ab9da-24cd-11de-8aaa-f3a34680c41f>
Wed, 3 Apr 2013 11:18:01 +0000 (11:18 +0000)
armsrc/iso14443a.c
armsrc/iso14443a.h
armsrc/mifarecmd.c

index 5a01178d334aa78eadc9f3469b83722b0a93e7a6..6c80c02d020e0bb460c5551c8be2ede53adcac67 100644 (file)
@@ -1547,44 +1547,33 @@ static int GetIso14443aAnswerFromTag(uint8_t *receivedResponse, int maxLen, int
        }
 }
 
        }
 }
 
-void ReaderTransmitShort(const uint8_t* bt)
+void ReaderTransmitBitsPar(uint8_t* frame, int bits, uint32_t par)
 {
   int wait = 0;
   int samples = 0;
 {
   int wait = 0;
   int samples = 0;
-
-//  ShortFrameFromReader(*bt);
-  CodeIso14443aBitsAsReaderPar(bt,7,0);
-
-  // Select the card
-  TransmitFor14443a(ToSend, ToSendMax, &samples, &wait);
-
-  // Store reader command in buffer
-  if (tracing) LogTrace(bt,1,0,GetParity(bt,1),TRUE);
-}
-
-void ReaderTransmitPar(uint8_t* frame, int len, uint32_t par)
-{
-  int wait = 0;
-  int samples = 0;
-
+  
   // This is tied to other size changes
   //   uint8_t* frame_addr = ((uint8_t*)BigBuf) + 2024;
   // This is tied to other size changes
   //   uint8_t* frame_addr = ((uint8_t*)BigBuf) + 2024;
-  CodeIso14443aAsReaderPar(frame,len,par);
-
+  CodeIso14443aBitsAsReaderPar(frame,bits,par);
+  
   // Select the card
   TransmitFor14443a(ToSend, ToSendMax, &samples, &wait);
   if(trigger)
        LED_A_ON();
   // Select the card
   TransmitFor14443a(ToSend, ToSendMax, &samples, &wait);
   if(trigger)
        LED_A_ON();
-
+  
   // Store reader command in buffer
   // Store reader command in buffer
-  if (tracing) LogTrace(frame,len,0,par,TRUE);
+  if (tracing) LogTrace(frame,nbytes(bits),0,par,TRUE);
 }
 
 }
 
+void ReaderTransmitPar(uint8_t* frame, int len, uint32_t par)
+{
+  ReaderTransmitBitsPar(frame,len*8,par);
+}
 
 void ReaderTransmit(uint8_t* frame, int len)
 {
   // Generate parity and redirect
 
 void ReaderTransmit(uint8_t* frame, int len)
 {
   // Generate parity and redirect
-  ReaderTransmitPar(frame,len,GetParity(frame,len));
+  ReaderTransmitBitsPar(frame,len*8,GetParity(frame,len));
 }
 
 int ReaderReceive(uint8_t* receivedAnswer)
 }
 
 int ReaderReceive(uint8_t* receivedAnswer)
@@ -1623,7 +1612,7 @@ int iso14443a_select_card(byte_t* uid_ptr, iso14a_card_select_t* p_hi14a_card, u
        int len;
         
        // Broadcast for a card, WUPA (0x52) will force response from all cards in the field
        int len;
         
        // Broadcast for a card, WUPA (0x52) will force response from all cards in the field
-       ReaderTransmitShort(wupa);
+  ReaderTransmitBitsPar(wupa,7,0);
        // Receive the ATQA
        if(!ReaderReceive(resp)) return 0;
 //  Dbprintf("atqa: %02x %02x",resp[0],resp[1]);
        // Receive the ATQA
        if(!ReaderReceive(resp)) return 0;
 //  Dbprintf("atqa: %02x %02x",resp[0],resp[1]);
index 8422f6cb1c84e3521261550bc023634c3308a48e..c3051d4888f714f5b586da29242606103ebf28e3 100644 (file)
@@ -82,8 +82,8 @@ extern byte_t oddparity (const byte_t bt);
 extern uint32_t GetParity(const uint8_t * pbtCmd, int iLen);
 extern void AppendCrc14443a(uint8_t* data, int len);
 
 extern uint32_t GetParity(const uint8_t * pbtCmd, int iLen);
 extern void AppendCrc14443a(uint8_t* data, int len);
 
-extern void ReaderTransmitShort(const uint8_t* bt);
 extern void ReaderTransmit(uint8_t* frame, int len);
 extern void ReaderTransmit(uint8_t* frame, int len);
+extern void ReaderTransmitBitsPar(uint8_t* frame, int bits, uint32_t par);
 extern void ReaderTransmitPar(uint8_t* frame, int len, uint32_t par);
 extern int ReaderReceive(uint8_t* receivedAnswer);
 extern int ReaderReceivePar(uint8_t* receivedAnswer, uint32_t * parptr);
 extern void ReaderTransmitPar(uint8_t* frame, int len, uint32_t par);
 extern int ReaderReceive(uint8_t* receivedAnswer);
 extern int ReaderReceivePar(uint8_t* receivedAnswer, uint32_t * parptr);
index e7850b3f2c316bd07d4380cd6152518da935467c..6ca9e4e953fa407a00b0177282cdd60a30ef0b4f 100644 (file)
@@ -801,7 +801,7 @@ void MifareCSetBlock(uint32_t arg0, uint32_t arg1, uint32_t arg2, uint8_t *datai
        \r
                // reset chip\r
                if (needWipe){\r
        \r
                // reset chip\r
                if (needWipe){\r
-                       ReaderTransmitShort(wupC1);\r
+      ReaderTransmitBitsPar(wupC1,7,0);\r
                        if(!ReaderReceive(receivedAnswer) || (receivedAnswer[0] != 0x0a)) {\r
                                if (MF_DBGLEVEL >= 1)   Dbprintf("wupC1 error");\r
                                break;\r
                        if(!ReaderReceive(receivedAnswer) || (receivedAnswer[0] != 0x0a)) {\r
                                if (MF_DBGLEVEL >= 1)   Dbprintf("wupC1 error");\r
                                break;\r
@@ -821,7 +821,7 @@ void MifareCSetBlock(uint32_t arg0, uint32_t arg1, uint32_t arg2, uint8_t *datai
 \r
                // write block\r
                if (workFlags & 0x02) {\r
 \r
                // write block\r
                if (workFlags & 0x02) {\r
-                       ReaderTransmitShort(wupC1);\r
+      ReaderTransmitBitsPar(wupC1,7,0);\r
                        if(!ReaderReceive(receivedAnswer) || (receivedAnswer[0] != 0x0a)) {\r
                                if (MF_DBGLEVEL >= 1)   Dbprintf("wupC1 error");\r
                                break;\r
                        if(!ReaderReceive(receivedAnswer) || (receivedAnswer[0] != 0x0a)) {\r
                                if (MF_DBGLEVEL >= 1)   Dbprintf("wupC1 error");\r
                                break;\r
@@ -919,7 +919,7 @@ void MifareCGetBlock(uint32_t arg0, uint32_t arg1, uint32_t arg2, uint8_t *datai
 \r
        while (true) {\r
                if (workFlags & 0x02) {\r
 \r
        while (true) {\r
                if (workFlags & 0x02) {\r
-                       ReaderTransmitShort(wupC1);\r
+      ReaderTransmitBitsPar(wupC1,7,0);\r
                        if(!ReaderReceive(receivedAnswer) || (receivedAnswer[0] != 0x0a)) {\r
                                if (MF_DBGLEVEL >= 1)   Dbprintf("wupC1 error");\r
                                break;\r
                        if(!ReaderReceive(receivedAnswer) || (receivedAnswer[0] != 0x0a)) {\r
                                if (MF_DBGLEVEL >= 1)   Dbprintf("wupC1 error");\r
                                break;\r
Impressum, Datenschutz