Extended hexadecimal mode.

While in hex mode (ctrl-t h) you can output hexadecimal values.
E.g.: to send 0x0A you have to type 0A (always 2 characters).

Added option -x, --hex to start in hexadecimal mode.

Added option --newline-in-hex to interpret newline characters in hex mode.
This is disabled by default, because, in my opinion, hex stream is
fundamentally different from text, so a "new line" is meaningless in this
context.
This commit is contained in:
g0mb4 2021-07-19 11:32:00 +02:00 committed by Martin Lund
parent 7d3b687eb4
commit 0b55981e52
5 changed files with 128 additions and 20 deletions

View file

@ -37,6 +37,8 @@ enum timestamp_t
const char* timestamp_token(enum timestamp_t timestamp);
enum timestamp_t timestamp_option_parse(const char *arg);
#define OPT_NEWLINE_IN_HEX 1000 // "short" option for --newline-in-hex
/* Options */
struct option_t
{
@ -56,6 +58,8 @@ struct option_t
const char *map;
const char *socket;
int color;
bool hex_mode;
bool newline_in_hex;
};
extern struct option_t option;