/[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 38 by dpavlin, Mon Jun 1 18:36:42 2009 UTC revision 39 by dpavlin, Mon Jun 1 21:07:11 2009 UTC
# Line 398  print "Port closed\n"; Line 398  print "Port closed\n";
398  sub writechunk  sub writechunk
399  {  {
400          my $str=shift;          my $str=shift;
 warn "DEBUG: ", as_hex($str);  
401          my $count = $port->write($str);          my $count = $port->write($str);
402          my $len = length($str);          my $len = length($str);
403          die "wrong write length $count != $len in ",as_hex( $str ) if $count != $len;          die "wrong write length $count != $len in ",as_hex( $str ) if $count != $len;
# Line 440  sub skip_assert { Line 439  sub skip_assert {
439  sub assert {  sub assert {
440          my ( $from, $to ) = @_;          my ( $from, $to ) = @_;
441    
442            return unless $assert->{expect};
443    
444          $from ||= 0;          $from ||= 0;
445          $to = length( $assert->{expect} ) if ! defined $to;          $to = length( $assert->{expect} ) if ! defined $to;
446    
# Line 517  sub readchunk { Line 518  sub readchunk {
518          } sort { length($a) <=> length($b) } keys %$dispatch;          } sort { length($a) <=> length($b) } keys %$dispatch;
519          warn "?? payload dispatch to ",dump( $payload, $dispatch, $to ) if $debug;          warn "?? payload dispatch to ",dump( $payload, $dispatch, $to ) if $debug;
520    
521          if ( defined $to ) {          if ( defined $to && $payload ) {
522                  my $rest = substr( $payload, length($to) );                  my $rest = substr( $payload, length($to) );
523                  warn "## DISPATCH payload to with rest", dump( $payload, $to, $rest ) if $debug;                  warn "## DISPATCH payload to with rest", dump( $payload, $to, $rest ) if $debug;
524                  $dispatch->{ $to }->( $rest );                  $dispatch->{ $to }->( $rest );

Legend:
Removed from v.38  
changed lines
  Added in v.39

  ViewVC Help
Powered by ViewVC 1.1.26