// memcpy(ack.d.asBytes, dataoutbuf, 16);\r
\r
LED_B_ON();\r
- cmd_send(CMD_ACK,isOK,0,0,0,0);\r
+ cmd_send(CMD_ACK,isOK,0,0,dataoutbuf,16);\r
// UsbSendPacket((uint8_t *)&ack, sizeof(UsbCommand));\r
LED_B_OFF();\r
\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
\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 (isOK) memcpy(ack.d.asBytes, uid, 4);\r
\r
// add trace trailer\r
- memset(uid, 0x44, 4);\r
- LogTrace(uid, 4, 0, 0, TRUE);\r
+ /**\r
+ * Removed by Martin, the uid is overwritten with 0x44, \r
+ * which can 't be intended. \r
+ *\r
+ * memset(uid, 0x44, 4);\r
+ * LogTrace(uid, 4, 0, 0, TRUE);\r
+ **/\r
+ \r
\r
LED_B_ON();\r
cmd_send(CMD_ACK,isOK,0,0,uid,4);\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 (isOK) memcpy(ack.d.asBytes, data, 18);\r
\r
// add trace trailer\r
- memset(data, 0x44, 4);\r
- LogTrace(data, 4, 0, 0, TRUE);\r
-\r
+ /*\r
+ * Removed by Martin, this piece of overwrites the 'data' variable \r
+ * which is sent two lines down, and is obviously not correct. \r
+ * \r
+ * memset(data, 0x44, 4);\r
+ * LogTrace(data, 4, 0, 0, TRUE);\r
+ */\r
LED_B_ON();\r
cmd_send(CMD_ACK,isOK,0,0,data,18);\r
// UsbSendPacket((uint8_t *)&ack, sizeof(UsbCommand));\r