return PM3_SUCCESS on usart_writebuffer_sync, usb_write
This commit is contained in:
@@ -1201,8 +1201,8 @@ static void PacketReceived(PacketCommandNG *packet) {
|
||||
|
||||
for (size_t i = 0; i < numofbytes; i += USB_CMD_DATA_SIZE) {
|
||||
size_t len = MIN((numofbytes - i), USB_CMD_DATA_SIZE);
|
||||
int16_t result = reply_old(CMD_DOWNLOADED_RAW_ADC_SAMPLES_125K, i, len, BigBuf_get_traceLen(), mem + startidx + i, len);
|
||||
if (result <= 0)
|
||||
int result = reply_old(CMD_DOWNLOADED_RAW_ADC_SAMPLES_125K, i, len, BigBuf_get_traceLen(), mem + startidx + i, len);
|
||||
if (result != PM3_SUCCESS)
|
||||
Dbprintf("transfer to client failed :: | bytes between %d - %d (%d) | result: %d", i, i + len, len, result);
|
||||
}
|
||||
// Trigger a finish downloading signal with an ACK frame
|
||||
@@ -1245,8 +1245,8 @@ static void PacketReceived(PacketCommandNG *packet) {
|
||||
|
||||
for (size_t i = 0; i < numofbytes; i += USB_CMD_DATA_SIZE) {
|
||||
len = MIN((numofbytes - i), USB_CMD_DATA_SIZE);
|
||||
int16_t result = reply_old(CMD_DOWNLOADED_EML_BIGBUF, i, len, 0, mem + startidx + i, len);
|
||||
if (result <= 0)
|
||||
int result = reply_old(CMD_DOWNLOADED_EML_BIGBUF, i, len, 0, mem + startidx + i, len);
|
||||
if (result != PM3_SUCCESS)
|
||||
Dbprintf("transfer to client failed :: | bytes between %d - %d (%d) | result: %d", i, i + len, len, result);
|
||||
}
|
||||
// Trigger a finish downloading signal with an ACK frame
|
||||
@@ -1570,7 +1570,7 @@ void __attribute__((noreturn)) AppMain(void) {
|
||||
|
||||
// Check if there is a packet available
|
||||
PacketCommandNG rx;
|
||||
int16_t ret = receive_ng(&rx);
|
||||
int ret = receive_ng(&rx);
|
||||
if (ret == PM3_SUCCESS) {
|
||||
PacketReceived(&rx);
|
||||
} else if (ret != PM3_ENODATA) {
|
||||
|
||||
@@ -222,10 +222,10 @@ void iClass_Clone(uint8_t startblock, uint8_t endblock, uint8_t *data);
|
||||
void iClass_ReadCheck(uint8_t blockno, uint8_t keytype);
|
||||
|
||||
// cmd.h
|
||||
int32_t reply_old(uint64_t cmd, uint64_t arg0, uint64_t arg1, uint64_t arg2, void *data, size_t len);
|
||||
int32_t reply_mix(uint64_t cmd, uint64_t arg0, uint64_t arg1, uint64_t arg2, void *data, size_t len);
|
||||
int32_t reply_ng(uint16_t cmd, int16_t status, uint8_t *data, size_t len);
|
||||
int16_t receive_ng(PacketCommandNG *rx);
|
||||
int reply_old(uint64_t cmd, uint64_t arg0, uint64_t arg1, uint64_t arg2, void *data, size_t len);
|
||||
int reply_mix(uint64_t cmd, uint64_t arg0, uint64_t arg1, uint64_t arg2, void *data, size_t len);
|
||||
int reply_ng(uint16_t cmd, int16_t status, uint8_t *data, size_t len);
|
||||
int receive_ng(PacketCommandNG *rx);
|
||||
|
||||
// util.h
|
||||
void HfSniff(int, int);
|
||||
|
||||
Reference in New Issue
Block a user