textual - hw status on device side

This commit is contained in:
iceman1001 2021-05-11 16:11:33 +02:00
commit a6712295c7
6 changed files with 80 additions and 69 deletions

View file

@ -169,9 +169,25 @@ void BigBuf_print_status(void) {
Dbprintf(" tracing ................ %d", tracing);
Dbprintf(" traceLen ............... %d", trace_len);
Dbprintf(" dma8 memory.............%d", dma_8.buf - BigBuf_get_addr());
Dbprintf(" dma16 memory............%d", (uint8_t *)dma_16.buf - BigBuf_get_addr());
Dbprintf(" toSend memory...........%d", toSend.buf - BigBuf_get_addr());
if (DBGLEVEL >= DBG_DEBUG) {
DbpString(_CYAN_("Sending buffers"));
uint16_t d8 = 0;
if (dma_8.buf)
d8 = dma_8.buf - BigBuf_get_addr();
uint16_t d16 = 0;
if (dma_16.buf)
d16 = (uint8_t *)dma_16.buf - BigBuf_get_addr();
uint16_t ts = 0;
if (toSend.buf)
ts = toSend.buf - BigBuf_get_addr();
Dbprintf(" dma8 memory............. %u", d8);
Dbprintf(" dma16 memory............ %u", d16);
Dbprintf(" toSend memory........... %u", ts);
}
}
// return the maximum trace length (i.e. the unallocated size of BigBuf)

View file

@ -337,22 +337,22 @@ static void print_debug_level(void) {
char dbglvlstr[20] = {0};
switch (DBGLEVEL) {
case DBG_NONE:
sprintf(dbglvlstr, "NONE");
sprintf(dbglvlstr, "none");
break;
case DBG_ERROR:
sprintf(dbglvlstr, "ERROR");
sprintf(dbglvlstr, "error");
break;
case DBG_INFO:
sprintf(dbglvlstr, "INFO");
sprintf(dbglvlstr, "info");
break;
case DBG_DEBUG:
sprintf(dbglvlstr, "DEBUG");
sprintf(dbglvlstr, "debug");
break;
case DBG_EXTENDED:
sprintf(dbglvlstr, "EXTENDED");
sprintf(dbglvlstr, "extended");
break;
}
Dbprintf(" DBGLEVEL................%d ( " _YELLOW_("%s")" )", DBGLEVEL, dbglvlstr);
Dbprintf(" Debug log level......... %d ( " _YELLOW_("%s")" )", DBGLEVEL, dbglvlstr);
}
// measure the Connection Speed by sending SpeedTestBufferSize bytes to client and measuring the elapsed time.
@ -376,9 +376,9 @@ static void printConnSpeed(void) {
}
LED_B_OFF();
Dbprintf(" Time elapsed............%dms", delta_time);
Dbprintf(" Bytes transferred.......%d", bytes_transferred);
Dbprintf(" Transfer Speed PM3 -> Client = " _YELLOW_("%d") " bytes/s", 1000 * bytes_transferred / delta_time);
Dbprintf(" Time elapsed................... %dms", delta_time);
Dbprintf(" Bytes transferred.............. %d", bytes_transferred);
Dbprintf(" Transfer Speed PM3 -> Client... " _YELLOW_("%d") " bytes/s", 1000 * bytes_transferred / delta_time);
}
/**
@ -429,7 +429,7 @@ static void SendStatus(void) {
#ifdef WITH_FLASH
Flashmem_print_info();
#endif
DbpString("");
reply_ng(CMD_STATUS, PM3_SUCCESS, NULL, 0);
}
@ -1573,11 +1573,6 @@ static void PacketReceived(PacketCommandNG *packet) {
MifareGen3Freez();
break;
}
// mifare sniffer
// case CMD_HF_MIFARE_SNIFF: {
// SniffMifare(packet->oldarg[0]);
// break;
// }
case CMD_HF_MIFARE_PERSONALIZE_UID: {
struct p {
uint8_t keytype;
@ -2294,7 +2289,7 @@ static void PacketReceived(PacketCommandNG *packet) {
// arg1 = length bytes to transfer
// arg2 = RFU
if (!FlashInit()) {
if (FlashInit() == false) {
break;
}
@ -2302,7 +2297,7 @@ static void PacketReceived(PacketCommandNG *packet) {
size_t len = MIN((numofbytes - i), PM3_CMD_DATA_SIZE);
Flash_CheckBusy(BUSY_TIMEOUT);
bool isok = Flash_ReadDataCont(startidx + i, mem, len);
if (!isok)
if (isok == false)
Dbprintf("reading flash memory failed :: | bytes between %d - %d", i, len);
isok = reply_old(CMD_FLASHMEM_DOWNLOADED, i, len, 0, mem, len);

View file

@ -136,29 +136,29 @@ static hf14a_config hf14aconfig = { 0, 0, 0, 0, 0 } ;
void printHf14aConfig(void) {
DbpString(_CYAN_("HF 14a config"));
Dbprintf(" [a] Anticol override.... %s%s%s",
(hf14aconfig.forceanticol == 0) ? _GREEN_("std") " : follow standard " : "",
(hf14aconfig.forceanticol == 1) ? _RED_("force") " : always do anticol" : "",
(hf14aconfig.forceanticol == 2) ? _RED_("skip") " : always skip anticol" : ""
(hf14aconfig.forceanticol == 0) ? _GREEN_("std") " ( follow standard )" : "",
(hf14aconfig.forceanticol == 1) ? _RED_("force") " ( always do anticol )" : "",
(hf14aconfig.forceanticol == 2) ? _RED_("skip") " ( always skip anticol )" : ""
);
Dbprintf(" [b] BCC override........ %s%s%s",
(hf14aconfig.forcebcc == 0) ? _GREEN_("std") " : follow standard" : "",
(hf14aconfig.forcebcc == 1) ? _RED_("fix") " : fix bad BCC" : "",
(hf14aconfig.forcebcc == 2) ? _RED_("ignore") " : ignore bad BCC, always use card BCC" : ""
(hf14aconfig.forcebcc == 0) ? _GREEN_("std") " ( follow standard )" : "",
(hf14aconfig.forcebcc == 1) ? _RED_("fix") " ( fix bad BCC )" : "",
(hf14aconfig.forcebcc == 2) ? _RED_("ignore") " ( ignore bad BCC, always use card BCC )" : ""
);
Dbprintf(" [2] CL2 override........ %s%s%s",
(hf14aconfig.forcecl2 == 0) ? _GREEN_("std") " : follow standard" : "",
(hf14aconfig.forcecl2 == 1) ? _RED_("force") " : always do CL2" : "",
(hf14aconfig.forcecl2 == 2) ? _RED_("skip") " : always skip CL2" : ""
(hf14aconfig.forcecl2 == 0) ? _GREEN_("std") " ( follow standard )" : "",
(hf14aconfig.forcecl2 == 1) ? _RED_("force") " ( always do CL2 )" : "",
(hf14aconfig.forcecl2 == 2) ? _RED_("skip") " ( always skip CL2 )" : ""
);
Dbprintf(" [3] CL3 override........ %s%s%s",
(hf14aconfig.forcecl3 == 0) ? _GREEN_("std") " : follow standard" : "",
(hf14aconfig.forcecl3 == 1) ? _RED_("force") " : always do CL3" : "",
(hf14aconfig.forcecl3 == 2) ? _RED_("skip") " : always skip CL3" : ""
(hf14aconfig.forcecl3 == 0) ? _GREEN_("std") " ( follow standard )" : "",
(hf14aconfig.forcecl3 == 1) ? _RED_("force") " ( always do CL3 )" : "",
(hf14aconfig.forcecl3 == 2) ? _RED_("skip") " ( always skip CL3 )" : ""
);
Dbprintf(" [r] RATS override....... %s%s%s",
(hf14aconfig.forcerats == 0) ? _GREEN_("std") " : follow standard " : "",
(hf14aconfig.forcerats == 1) ? _RED_("force") " : always do RATS" : "",
(hf14aconfig.forcerats == 2) ? _RED_("skip") " : always skip RATS" : ""
(hf14aconfig.forcerats == 0) ? _GREEN_("std") " ( follow standard )" : "",
(hf14aconfig.forcerats == 1) ? _RED_("force") " ( always do RATS )" : "",
(hf14aconfig.forcerats == 2) ? _RED_("skip") " () always skip RATS )" : ""
);
}

View file

@ -42,7 +42,7 @@ void printLFConfig(void) {
Dbprintf(" [q] divisor............. %d ( "_GREEN_("%d.%02d kHz")" )", d, 12000 / (d + 1), ((1200000 + (d + 1) / 2) / (d + 1)) - ((12000 / (d + 1)) * 100));
Dbprintf(" [b] bits per sample..... %d", config.bits_per_sample);
Dbprintf(" [d] decimation.......... %d", config.decimation);
Dbprintf(" [a] averaging...........%s", (config.averaging) ? "Yes" : "No");
Dbprintf(" [a] averaging........... %s", (config.averaging) ? "yes" : "no");
Dbprintf(" [t] trigger threshold... %d", config.trigger_threshold);
Dbprintf(" [s] samples to skip..... %d ", config.samples_to_skip);