- self.app=ord(self.serialport.read(1));
- self.verb=ord(self.serialport.read(1));
- self.count=ord(self.serialport.read(1));
- self.data=self.serialport.read(self.count*blocks);
- #print "READ %02x %02x %02x " % (self.app, self.verb, self.count);
- return self.data;
-
+ while 1:
+ #print "Reading...";
+ self.app=ord(self.serialport.read(1));
+ #print "APP=%2x" % self.app;
+ self.verb=ord(self.serialport.read(1));
+ #print "VERB=%02x" % self.verb;
+ self.count=(
+ ord(self.serialport.read(1))
+ +(ord(self.serialport.read(1))<<8)
+ );
+
+ #Debugging string; print, but wait.
+ if self.app==0xFF and self.verb==0xFF:
+ print "DEBUG %s" % self.serialport.read(self.count);
+ else:
+ self.data=self.serialport.read(self.count);
+ return self.data;
+