[minicom-Patches][313754] Add hex output format
minicom-patches at alioth.debian.org
minicom-patches at alioth.debian.org
Tue Aug 28 17:33:40 UTC 2012
minicom-Patches item #313754, was changed at 2012-08-28 19:33 by Adam Lackorzynski
You can respond by visiting:
https://alioth.debian.org/tracker/?func=detail&atid=300031&aid=313754&group_id=30018
Status: Open
Priority: 3
Submitted By: Jiao ShuYing (kicer-guest)
Assigned to: Nobody (None)
Summary: Add hex output format
Category: None
Group: None
Resolution: Works For Me
Initial Comment:
Sometimes output data with hex format is useful for debug. I am try to add this function to minicom(2.6.1) as follows:
1. "-H/--hex" option for output with hex format when program start.
2. add a item in [Screen and keyboard] for set output format.
diff -urN minicom-2.6.1/src/main.c minicom-2.6.1-add_hex_output/src/main.c
--- minicom-2.6.1/src/main.c 2012-02-11 21:24:25.000000000 +0800
+++ minicom-2.6.1-add_hex_output/src/main.c 2012-08-28 14:48:53.000000000 +0800
@@ -807,6 +807,17 @@
}
if (P_PARITY[0] == 'M' || P_PARITY[0] == 'S')
*ptr &= 0x7f;
+#ifdef ENABLE_OUTPUT_HEX
+ if (doputhex) {
+ char hexstr[4];
+ snprintf(hexstr, sizeof(hexstr), "%02X ", (unsigned char)*ptr);
+ ptr++;
+ vt_out(hexstr[0]);
+ vt_out(hexstr[1]);
+ vt_out(hexstr[2]);
+ }
+ else
+#endif /* ENABLE_OUTPUT_HEX */
vt_out(*ptr++);
if (zauto && zsig[zpos] == 0) {
dirflush = 1;
Thanks for checking it.
----------------------------------------------------------------------
>Comment By: Adam Lackorzynski (al-guest)
Date: 2012-08-28 19:33
Message:
Hi,
I like the feature, but I have some comments on the patch.
Do not use a config macro, there's no need to disable that option at build time.
You should work against the hg repository, making our lifes easier.
The hex output format could also be more formatted (such as known from hex editors), however, can be done later.
Could you send an updated patch without the #ifdef's?
Thanks, Adam
----------------------------------------------------------------------
You can respond by visiting:
https://alioth.debian.org/tracker/?func=detail&atid=300031&aid=313754&group_id=30018
More information about the minicom-devel
mailing list