set debug log level
This commit is contained in:
1 parent
af0e25b519
commit
ebe9d72cc2
4 files changed
+49
-11
No files matched your search
@@ -762,6 +762,44 @@ static int setCmdDeviceDebug (const char *Cmd)
|
||||
}
|
||||
*/
|
||||
|
||||
int getDeviceDebugLevel (uint8_t *debug_level) {
|
||||
if (!g_session.pm3_present)
|
||||
return PM3_EFAILED;
|
||||
|
||||
clearCommandBuffer();
|
||||
SendCommandNG(CMD_GET_DBGMODE, NULL, 0);
|
||||
PacketResponseNG resp;
|
||||
if (WaitForResponseTimeout(CMD_GET_DBGMODE, &resp, 2000) == false) {
|
||||
PrintAndLogEx(WARNING, "Failed to get current device debug level");
|
||||
return PM3_ETIMEOUT;
|
||||
}
|
||||
|
||||
if (debug_level)
|
||||
*debug_level = resp.data.asBytes[0];
|
||||
|
||||
return PM3_SUCCESS;
|
||||
}
|
||||
|
||||
int setDeviceDebugLevel (uint8_t debug_level, bool verbose) {
|
||||
if (!g_session.pm3_present)
|
||||
return PM3_EFAILED;
|
||||
|
||||
if (verbose)
|
||||
PrintAndLogEx (INFO,"setting device debug loglevel to %u", debug_level);
|
||||
|
||||
uint8_t cdata[] = {debug_level, verbose};
|
||||
clearCommandBuffer();
|
||||
SendCommandNG(CMD_SET_DBGMODE, cdata, sizeof(cdata));
|
||||
PacketResponseNG resp;
|
||||
if (WaitForResponseTimeout(CMD_SET_DBGMODE, &resp, 2000) == false) {
|
||||
PrintAndLogEx (WARNING,"failed to set device debug loglevel");
|
||||
return PM3_EFAILED;
|
||||
}
|
||||
|
||||
return PM3_SUCCESS;
|
||||
}
|
||||
|
||||
|
||||
static int setCmdOutput(const char *Cmd) {
|
||||
CLIParserContext *ctx;
|
||||
CLIParserInit(&ctx, "prefs set output",
|
||||
|
||||
Reference in new issue
Block a user