X-Git-Url: http://cvs.zerfleddert.de/cgi-bin/gitweb.cgi/proxmark3-svn/blobdiff_plain/13a79da4e974239d72bb0b132c02c67fb2600ad8..5a956258d3d8416f1cd2259319eae784d008a46b:/armsrc/appmain.c diff --git a/armsrc/appmain.c b/armsrc/appmain.c index 674c8917..b231cae1 100644 --- a/armsrc/appmain.c +++ b/armsrc/appmain.c @@ -76,6 +76,9 @@ void DbpString(char *str) UsbCommand c; c.cmd = CMD_DEBUG_PRINT_STRING; c.arg[0] = strlen(str); + if(c.arg[0] > sizeof(c.d.asBytes)) { + c.arg[0] = sizeof(c.d.asBytes); + } memcpy(c.d.asBytes, str, c.arg[0]); UsbSendPacket((BYTE *)&c, sizeof(c)); @@ -565,11 +568,14 @@ void ListenReaderField(int limit) void UsbPacketReceived(BYTE *packet, int len) { UsbCommand *c = (UsbCommand *)packet; + UsbCommand ack; + ack.cmd = CMD_ACK; switch(c->cmd) { #ifdef WITH_LF case CMD_ACQUIRE_RAW_ADC_SAMPLES_125K: AcquireRawAdcSamples125k(c->arg[0]); + UsbSendPacket((BYTE*)&ack, sizeof(ack)); break; #endif @@ -596,8 +602,8 @@ void UsbPacketReceived(BYTE *packet, int len) #endif case CMD_READER_LEGIC_RF: - LegicRfReader(); - break; + LegicRfReader(c->arg[0], c->arg[1]); + break; #ifdef WITH_ISO15693 case CMD_SIMTAG_ISO_15693: @@ -719,6 +725,7 @@ void UsbPacketReceived(BYTE *packet, int len) BYTE *b = (BYTE *)BigBuf; memcpy(b+c->arg[0], c->d.asBytes, 48); //Dbprintf("copied 48 bytes to %i",b+c->arg[0]); + UsbSendPacket((BYTE*)&ack, sizeof(ack)); break; }