From c528eacf24dd14c5258d8b995582515cdf06c547 Mon Sep 17 00:00:00 2001 From: iceman1001 Date: Sun, 4 Oct 2020 17:41:27 +0200 Subject: [PATCH] wiegand cmds now use cliparse --- client/src/cmdwiegand.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/client/src/cmdwiegand.c b/client/src/cmdwiegand.c index 0cd694103..f81d7c177 100644 --- a/client/src/cmdwiegand.c +++ b/client/src/cmdwiegand.c @@ -72,10 +72,10 @@ int CmdWiegandEncode(const char *Cmd) { void *argtable[] = { arg_param_begin, - arg_int0(NULL, "fc", "", "facility number"), - arg_int1(NULL, "cn", "", "card number"), - arg_int0(NULL, "issue", "", "issue level"), - arg_int0(NULL, "oem", "", "OEM code"), + arg_u64_0(NULL, "fc", "", "facility number"), + arg_u64_1(NULL, "cn", "", "card number"), + arg_u64_0(NULL, "issue", "", "issue level"), + arg_u64_0(NULL, "oem", "", "OEM code"), arg_strx1("w", "wiegand", "", "see `wiegand list` for available formats"), arg_param_end }; @@ -84,11 +84,11 @@ int CmdWiegandEncode(const char *Cmd) { wiegand_card_t data; memset(&data, 0, sizeof(wiegand_card_t)); - data.FacilityCode = (uint32_t)arg_get_int_def(ctx, 1, 0); - data.CardNumber = (uint64_t)arg_get_int_def(ctx, 2, 0); - data.IssueLevel = (uint32_t)arg_get_int_def(ctx, 3, 0); - data.OEM = (uint32_t)arg_get_int_def(ctx, 4, 0); - + data.FacilityCode = arg_get_u32_def(ctx, 1, 0); + data.CardNumber = arg_get_u64_def(ctx, 2, 0); + data.IssueLevel = arg_get_u32_def(ctx, 3, 0); + data.OEM = arg_get_u32_def(ctx, 4, 0); + int len = 0; char format[16] = {0}; CLIParamStrToBuf(arg_get_str(ctx, 5), (uint8_t*)format, sizeof(format), &len);