[Bluez-devel] Little Hexdump-Patch for hcidump
flat view
From: Till Harbaum <hidden>
Date: 2004-08-26 16:44:20
Hi all,
in every new release of hcidump i have been replacing the built-in
hexdump routine with my own one (giving the address and ascii as well).
Perhaps you want to use this replacement in hcidump/parser/parser.c
The hex output is very useful for me and e.g. just being able to see ascii
strings inside rfcomm payload is something i really often need.
Feel free to include it into the public version if you like to ...
Regards,
Till
void hex_dump(int level, struct frame *frm, int num)
{
unsigned char *buf = frm->ptr;
register int i,n,b2c;
if ((num < 0) || (num > frm->len))
num = frm->len;
n = 0;
while(num>0) {
p_indent(level, frm);
printf("%04x: ", n);
b2c = (num>16)?16:num;
for(i=0;i<b2c;i++) printf("%02x ", buf[i]);
for(i=0;i<(16-b2c);i++) printf(" ");
printf(" ");
for(i=0;i<b2c;i++) printf("%c", isprint(buf[i])?buf[i]:'.');
printf("\n");
buf += b2c;
num -= b2c;
n += b2c;
}
}
--
Dr.-Ing. Till Harbaum Tel.: +49 721 4998963
BeeCon GmbH Fax: +49 721 4998962
Haid-und-Neu Strasse 7, 76131 Karlsruhe Mobil: +49 179 9087904
harbaum@beecon.de http://www.beecon.de
-------------------------------------------------------
SF.Net email is sponsored by Shop4tech.com-Lowest price on Blank Media
100pk Sonic DVD-R 4x for only $29 -100pk Sonic DVD+R for only $33
Save 50% off Retail on Ink & Toner - Free Shipping and Free Gift.
http://www.shop4tech.com/z/Inkjet_Cartridges/9_108_r285
_______________________________________________
Bluez-devel mailing list
Bluez-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bluez-devel