ADD: sample buffer size variable, to keep track of possible download lengths which is reserved on client.

This commit is contained in:
iceman1001
2018-04-27 10:09:14 +02:00
parent a11162a9fe
commit cd93f3a134
4 changed files with 11 additions and 1 deletions

View File

@@ -15,12 +15,14 @@
#include "proxmark3.h"
#include "cmdmain.h"
uint32_t sample_buf_size;
uint8_t* sample_buf;
// this triggers a download sequence from device, its received inside cmdmain.c UsbCommandReceived()
void GetFromBigBuf(uint8_t *dest, uint32_t len, uint32_t start_index) {
// global
sample_buf = dest;
sample_buf_size = len;
UsbCommand c = {CMD_DOWNLOAD_RAW_ADC_SAMPLES_125K, {start_index, len, 0}};
clearCommandBuffer();
SendCommand(&c);
@@ -29,6 +31,7 @@ void GetFromBigBuf(uint8_t *dest, uint32_t len, uint32_t start_index) {
// inside the BigBuf EML zon.
bool GetEMLFromBigBuf(uint8_t *dest, uint32_t len, uint32_t start_index) {
sample_buf = dest;
sample_buf_size = len;
UsbCommand c = {CMD_DOWNLOAD_EML_BIGBUF, {start_index, len, 0}};
clearCommandBuffer();
SendCommand(&c);
@@ -45,6 +48,7 @@ bool GetEMLFromBigBuf(uint8_t *dest, uint32_t len, uint32_t start_index) {
// Download data from flashmem, rdv40
void GetFromFlashMen(uint8_t *dest, uint32_t len, uint32_t start_index) {
sample_buf = dest;
sample_buf_size = len;
UsbCommand c = {CMD_DOWNLOAND_FLASH_MEM, {start_index, len, 0}};
clearCommandBuffer();
SendCommand(&c);