diff --git a/armsrc/cmd.c b/armsrc/cmd.c index 0f68719d4..961be39b1 100644 --- a/armsrc/cmd.c +++ b/armsrc/cmd.c @@ -138,7 +138,7 @@ static int reply_ng_internal(uint16_t cmd, int8_t status, uint8_t reason, const } int reply_ng(uint16_t cmd, int8_t status, const uint8_t *data, size_t len) { - return reply_ng_internal(cmd, status, -1, data, len, true); + return reply_ng_internal(cmd, status, PM3_REASON_UNKNOWN, data, len, true); } int reply_mix(uint64_t cmd, uint64_t arg0, uint64_t arg1, uint64_t arg2, const void *data, size_t len) { @@ -154,7 +154,7 @@ int reply_mix(uint64_t cmd, uint64_t arg0, uint64_t arg1, uint64_t arg2, const v memcpy(cmddata + sizeof(arg), data, (int)len); } - return reply_ng_internal((cmd & 0xFFFF), status, -1, cmddata, len + sizeof(arg), false); + return reply_ng_internal((cmd & 0xFFFF), status, PM3_REASON_UNKNOWN, cmddata, len + sizeof(arg), false); } int reply_reason(uint16_t cmd, int8_t status, int8_t reason, const uint8_t *data, size_t len) { diff --git a/client/src/cmdlfhitaghts.c b/client/src/cmdlfhitaghts.c index 3be9d6739..c4f31a230 100644 --- a/client/src/cmdlfhitaghts.c +++ b/client/src/cmdlfhitaghts.c @@ -210,7 +210,8 @@ static void print_error(int8_t reason) { PrintAndLogEx(FAILED, "Write to page failed!"); break; default: - PrintAndLogEx(DEBUG, "DEBUG: Error - Hitag S failed"); + // PM3_REASON_UNKNOWN + PrintAndLogEx(DEBUG, "DEBUG: Error - Hitag S failed"); } } @@ -237,7 +238,7 @@ static int CmdLFHitagSRead(const char *Cmd) { arg_lit0(NULL, "crypto", "crypto mode"), arg_str0("k", "key", "", "pwd or key, 4 or 6 hex bytes"), arg_int0("p", "page", "", "page address to read from"), - arg_int0("c", "count", "", "how many pages to read. '0' reads all pages up to the s page (default: 1)"), + arg_int0("c", "count", "", "how many pages to read. '0' reads all pages up to the end page (default: 1)"), arg_param_end }; CLIExecWithReturn(ctx, Cmd, argtable, true); diff --git a/include/pm3_cmd.h b/include/pm3_cmd.h index 7d5111327..9ab3bc993 100644 --- a/include/pm3_cmd.h +++ b/include/pm3_cmd.h @@ -874,6 +874,8 @@ typedef struct { // reserved for future protocol change #define PM3_RESERVED -128 +#define PM3_REASON_UNKNOWN -1 + // LF #define LF_FREQ2DIV(f) ((int)(((12000.0 + (f)/2.0)/(f))-1)) #define LF_DIVISOR_125 LF_FREQ2DIV(125)