Pitmairen / bryton-gps-linux

An attempt to read Bryton GPS devices on Linux
GNU General Public License v3.0
29 stars 14 forks source link

IOError/Traceback when device empty of data #13

Closed jwm-art-net closed 11 years ago

jwm-art-net commented 11 years ago

Traceback (most recent call last): File "/home/sirrom/SRC/bryton-gps-linux/code/brytongps.py", line 395, in sys.exit(main()) File "/home/sirrom/SRC/bryton-gps-linux/code/brytongps.py", line 322, in main history = list(reversed(module.read_history(device))) File "/home/sirrom/SRC/bryton-gps-linux/code/rider20.py", line 146, in read_history t._offset_trackpoints = buf.uint32_from(0x88) File "/home/sirrom/SRC/bryton-gps-linux/code/common.py", line 120, in uint32_from return struct.unpack('I', self.read_from(offset, 4))[0] File "/home/sirrom/SRC/bryton-gps-linux/code/common.py", line 110, in read_from self.data.extend(self.device.read_block(block_addr)) File "/home/sirrom/SRC/bryton-gps-linux/code/rider40.py", line 58, in read_block raise IOError('Reading past end of device.') IOError: Reading past end of device.

Expected "No data on device" or similar message.

Pitmairen commented 11 years ago

Can you send me a dump of the device when it's empty?

jwm-art-net commented 11 years ago

Yes, sending now...

Pitmairen commented 11 years ago

It should be working now. The track count was stored as 0xffff instead of 0 so the code was trying to read 65535 tracks from the device :)

jwm-art-net commented 11 years ago

Yes. Thank you :-)