chg: downloading of flashmemory to client.

This commit is contained in:
iceman1001 2018-04-20 15:26:34 +02:00
parent a746699f5f
commit cc181c3f91
3 changed files with 17 additions and 6 deletions

View file

@ -217,6 +217,7 @@ void UsbCommandReceived(UsbCommand *c) {
PrintAndLogEx(NORMAL, "#db# %08x, %08x, %08x", c->arg[0], c->arg[1], c->arg[2]);
break;
}
case CMD_DOWNLOADED_FLASHMEM:
case CMD_DOWNLOADED_RAW_ADC_SAMPLES_125K:
case CMD_DOWNLOADED_EML_BIGBUF: {
// sample_buf is a array pointer, located in data.c

View file

@ -17,17 +17,19 @@
uint8_t* sample_buf;
void GetFromBigBuf(uint8_t *dest, int bytes, int start_index) {
// 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;
UsbCommand c = {CMD_DOWNLOAD_RAW_ADC_SAMPLES_125K, {start_index, bytes, 0}};
UsbCommand c = {CMD_DOWNLOAD_RAW_ADC_SAMPLES_125K, {start_index, len, 0}};
clearCommandBuffer();
SendCommand(&c);
}
// this will download the EMULATOR memory part from device,
// inside the BigBuf EML zon.
bool GetEMLFromBigBuf(uint8_t *dest, uint32_t bytes, uint32_t start_index) {
bool GetEMLFromBigBuf(uint8_t *dest, uint32_t len, uint32_t start_index) {
sample_buf = dest;
UsbCommand c = {CMD_DOWNLOAD_EML_BIGBUF, {start_index, bytes, 0}};
UsbCommand c = {CMD_DOWNLOAD_EML_BIGBUF, {start_index, len, 0}};
clearCommandBuffer();
SendCommand(&c);
@ -40,3 +42,10 @@ bool GetEMLFromBigBuf(uint8_t *dest, uint32_t bytes, uint32_t start_index) {
return true;
}
// Download data from flashmem, rdv40
void GetFromFlashMen(uint8_t *dest, uint32_t len, uint32_t start_index) {
sample_buf = dest;
UsbCommand c = {CMD_DOWNLOAND_FLASH_MEM, {start_index, len, 0}};
clearCommandBuffer();
SendCommand(&c);
}

View file

@ -17,6 +17,7 @@
#define FILE_PATH_SIZE 1000
extern uint8_t* sample_buf;
extern void GetFromBigBuf(uint8_t *dest, int bytes, int start_index);
extern bool GetEMLFromBigBuf(uint8_t *dest, uint32_t bytes, uint32_t start_index);
extern void GetFromBigBuf(uint8_t *dest, uint32_t len, uint32_t start_index);
extern bool GetEMLFromBigBuf(uint8_t *dest, uint32_t len, uint32_t start_index);
extern void GetFromFlashMen(uint8_t *dest, uint32_t len, uint32_t start_index);
#endif