}
}
-void ReaderTransmitShort(const uint8_t* bt)
+void ReaderTransmitBitsPar(uint8_t* frame, int bits, uint32_t par)
{
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;
- CodeIso14443aAsReaderPar(frame,len,par);
-
+ CodeIso14443aBitsAsReaderPar(frame,bits,par);
+
// Select the card
TransmitFor14443a(ToSend, ToSendMax, &samples, &wait);
if(trigger)
LED_A_ON();
-
+
// 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
- ReaderTransmitPar(frame,len,GetParity(frame,len));
+ ReaderTransmitBitsPar(frame,len*8,GetParity(frame,len));
}
int ReaderReceive(uint8_t* receivedAnswer)
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]);
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 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);
\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
\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
\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