From a3ceaa1e46e75bf3c3809039df76db786ac1a44d Mon Sep 17 00:00:00 2001 From: Stefan `Sec` Zehl Date: Wed, 28 Dec 2011 12:50:31 +0100 Subject: [PATCH] Hexdump mode. Also add presets for mesh/openbecon --- tools/mesh/dbg.pl | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/tools/mesh/dbg.pl b/tools/mesh/dbg.pl index bf9ba01..323a651 100755 --- a/tools/mesh/dbg.pl +++ b/tools/mesh/dbg.pl @@ -43,6 +43,7 @@ if($cmd =~ /^r/){ my $rr=""; if (@fh = $sel->can_read(100)) { sysread($fh[0],$rr,1024); + $rr=~s/\\\\/\\/g; $read.=$rr; } }; @@ -65,6 +66,8 @@ if($cmd =~ /^r/){ print "HOP=",unpack("n",substr($str,11,4))," "; }; # print "\n"; + }elsif($fmt eq "x"){ + print "<",unpack("H*",$str),">"; }else{ print "Read: <"; sprint $str; print ">\n"; }; @@ -74,6 +77,16 @@ if($cmd =~ /^r/){ }; print "rest: <"; sprint $read; print ">\n"; exit; +}elsif ($cmd eq "pM"){ + syswrite(SER, '\3ORBIT\0'); + syswrite(SER, '\4ORBIT\0'); + syswrite(SER, '\5S\0'); + syswrite(SER, '\6'.pack("H*","20").'\0'); +}elsif ($cmd eq "pB"){ + syswrite(SER, '\3'.pack("H*","0102030201").'\0'); + syswrite(SER, '\4'.pack("H*","0102030201").'\0'); + syswrite(SER, '\5Q\0'); + syswrite(SER, '\6'.pack("H*","10").'\0'); }elsif ($cmd eq "mt"){ my $par=pack("H*",shift); print "Write: <"; sprint $par; print ">\n";