sim buffer max settings tests
This commit is contained in:
@@ -685,11 +685,14 @@ int CmdLFfskSim(const char *Cmd)
|
|||||||
uint16_t arg1, arg2;
|
uint16_t arg1, arg2;
|
||||||
arg1 = fcHigh << 8 | fcLow;
|
arg1 = fcHigh << 8 | fcLow;
|
||||||
arg2 = invert << 8 | clk;
|
arg2 = invert << 8 | clk;
|
||||||
UsbCommand c = {CMD_FSK_SIM_TAG, {arg1, arg2, DemodBufferLen}};
|
size_t size = DemodBufferLen;
|
||||||
if (DemodBufferLen > USB_CMD_DATA_SIZE) {
|
if (size > USB_CMD_DATA_SIZE) {
|
||||||
PrintAndLog("DemodBuffer too long for current implementation - length: %d - max: %d", DemodBufferLen, USB_CMD_DATA_SIZE);
|
PrintAndLog("DemodBuffer too long for current implementation - length: %d - max: %d", size, USB_CMD_DATA_SIZE);
|
||||||
}
|
size = USB_CMD_DATA_SIZE;
|
||||||
memcpy(c.d.asBytes, DemodBuffer, DemodBufferLen);
|
}
|
||||||
|
UsbCommand c = {CMD_FSK_SIM_TAG, {arg1, arg2, size}};
|
||||||
|
|
||||||
|
memcpy(c.d.asBytes, DemodBuffer, size);
|
||||||
SendCommand(&c);
|
SendCommand(&c);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@@ -778,7 +781,6 @@ int CmdLFaskSim(const char *Cmd)
|
|||||||
size = USB_CMD_DATA_SIZE;
|
size = USB_CMD_DATA_SIZE;
|
||||||
}
|
}
|
||||||
UsbCommand c = {CMD_ASK_SIM_TAG, {arg1, arg2, size}};
|
UsbCommand c = {CMD_ASK_SIM_TAG, {arg1, arg2, size}};
|
||||||
|
|
||||||
PrintAndLog("preparing to sim ask data: %d bits", size);
|
PrintAndLog("preparing to sim ask data: %d bits", size);
|
||||||
memcpy(c.d.asBytes, DemodBuffer, size);
|
memcpy(c.d.asBytes, DemodBuffer, size);
|
||||||
SendCommand(&c);
|
SendCommand(&c);
|
||||||
@@ -880,13 +882,14 @@ int CmdLFpskSim(const char *Cmd)
|
|||||||
uint16_t arg1, arg2;
|
uint16_t arg1, arg2;
|
||||||
arg1 = clk << 8 | carrier;
|
arg1 = clk << 8 | carrier;
|
||||||
arg2 = invert;
|
arg2 = invert;
|
||||||
|
size_t size=DemodBufferLen;
|
||||||
UsbCommand c = {CMD_PSK_SIM_TAG, {arg1, arg2, DemodBufferLen}};
|
if (size > USB_CMD_DATA_SIZE) {
|
||||||
if (DemodBufferLen > USB_CMD_DATA_SIZE) {
|
PrintAndLog("DemodBuffer too long for current implementation - length: %d - max: %d", size, USB_CMD_DATA_SIZE);
|
||||||
PrintAndLog("DemodBuffer too long for current implementation - length: %d - max: %d", DemodBufferLen, USB_CMD_DATA_SIZE);
|
size=USB_CMD_DATA_SIZE;
|
||||||
}
|
}
|
||||||
PrintAndLog("DEBUG: Sending DemodBuffer Length: %d", DemodBufferLen);
|
UsbCommand c = {CMD_PSK_SIM_TAG, {arg1, arg2, size}};
|
||||||
memcpy(c.d.asBytes, DemodBuffer, DemodBufferLen);
|
PrintAndLog("DEBUG: Sending DemodBuffer Length: %d", size);
|
||||||
|
memcpy(c.d.asBytes, DemodBuffer, size);
|
||||||
SendCommand(&c);
|
SendCommand(&c);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
|||||||
Reference in New Issue
Block a user