#little endian 16-bit length
self.serialport.write(chr(count&0xFF));
self.serialport.write(chr(count>>8));
#print "count=%02x, len(data)=%04x" % (count,len(data));
#little endian 16-bit length
self.serialport.write(chr(count&0xFF));
self.serialport.write(chr(count>>8));
#print "count=%02x, len(data)=%04x" % (count,len(data));