/[RFID]/3m-810.pl
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Diff of /3m-810.pl

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 5 by dpavlin, Sun Sep 28 18:13:21 2008 UTC revision 6 by dpavlin, Sun Sep 28 18:19:37 2008 UTC
# Line 153  sub writechunk Line 153  sub writechunk
153  {  {
154          my $str=shift;          my $str=shift;
155          my $count = $port->write($str);          my $count = $port->write($str);
156          print ">> ", as_hex( $str ), "\t[$count]\n";          print "#> ", as_hex( $str ), "\t[$count]\n";
157  }  }
158    
159  sub as_hex {  sub as_hex {
# Line 206  sub dispatch { Line 206  sub dispatch {
206          my $patt = substr( str2bytes($pattern), 3 ); # just payload          my $patt = substr( str2bytes($pattern), 3 ); # just payload
207          my $l = length($patt);          my $l = length($patt);
208          my $p = substr( $assert->{payload}, 0, $l );          my $p = substr( $assert->{payload}, 0, $l );
209          warn "## dispatch pattern $pattern [$l] ",dump( $patt, $p );          warn "## dispatch pattern $pattern [$l] ",dump( $patt, $p ) if $debug;
210    
211          if ( $assert->{payload} eq $assert->{expect} ) {          if ( $assert->{payload} eq $assert->{expect} ) {
212                  warn "## no dispatch, payload expected\n";                  warn "## no dispatch, payload expected" if $debug;
213          } elsif ( $p eq $patt ) {          } elsif ( $p eq $patt ) {
214                  # if matched call with rest of payload                  # if matched call with rest of payload
215                  $coderef->( substr( $assert->{payload}, $l ) );                  $coderef->( substr( $assert->{payload}, $l ) );
216          } else {          } else {
217                  warn "## dispatch ignored\n";                  warn "## dispatch ignored" if $debug;
218          }          }
219  }  }
220    

Legend:
Removed from v.5  
changed lines
  Added in v.6

  ViewVC Help
Powered by ViewVC 1.1.26