From 677d54cb6fc057e6fbf4516c7607b6ff387dfbdd Mon Sep 17 00:00:00 2001 From: Glyn Date: Sun, 19 Jun 2022 08:39:59 +0200 Subject: [PATCH] Numerical option for battery, lock and charging status --- include/phevargs.h | 2 ++ src/phevargs.c | 4 ++++ 2 files changed, 6 insertions(+) mode change 100644 => 100755 include/phevargs.h mode change 100644 => 100755 src/phevargs.c diff --git a/include/phevargs.h b/include/phevargs.h old mode 100644 new mode 100755 index d5e08b2..b20e5d4 --- a/include/phevargs.h +++ b/include/phevargs.h @@ -62,6 +62,7 @@ typedef struct phev_args_opts_t { char * topic; char * command_topic; bool verbose; + bool numerical; int carModel; bool operand_on; uint8_t operand_mode; @@ -85,6 +86,7 @@ static struct argp_option phev_args_options[] = { { "host", 'h', "",OPTION_HIDDEN, "IP address of car - defaults to 192.168.8.46."}, { "port", 'p', "",OPTION_HIDDEN, "Port to use - defaults to 8080"}, { "verbose",'v',0,0,"Verbose output"}, + { "numerical",'n',0,0,"Numerical output"}, { 0 } }; phev_args_opts_t * phev_args_parse(int argc, char *argv[]); diff --git a/src/phevargs.c b/src/phevargs.c old mode 100644 new mode 100755 index d3a0227..adddcd3 --- a/src/phevargs.c +++ b/src/phevargs.c @@ -313,6 +313,10 @@ static error_t phev_args_parse_opt(int key, char *arg, struct argp_state *state) opts->verbose = true; break; } + case 'n': { + opts->numerical = true; + break; + } case 'c': { opts->carModel = atoi(arg); break;