Package: mtkbabel
Version: 0.8-1
Severity: important
Tags: patch

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Holux has released a new firmware for the Holux M-241, which is interesting
because the new log format includes the speed.
Unfortunately, for some reason I can't fathom they changed the track and
waypoint separators from "HOLUXGR241LOGGER" and "HOLUXGR241WAYPNT" to
"HOLUXGR241LOGGER    " and "HOLUXGR241WAYPNT    " (so they are now longer
than the standard ones).
Moreover they changed to model_id, the new one needs to be added to deal
with the different record size for latitude and longitude the M-241 has.
All this prevents from saving the log.
The attached patch fixes both the problems.
Cheers,

Luca

- -- System Information:
Debian Release: squeeze/sid
  APT prefers unstable
  APT policy: (995, 'unstable'), (991, 'experimental')
Architecture: amd64 (x86_64)

Kernel: Linux 2.6.33 (SMP w/2 CPU cores)
Locale: LANG=it_IT.UTF-8, LC_CTYPE=it_IT.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/bash

Versions of packages mtkbabel depends on:
ii  libdevice-serialport-perl     1.04-2+b1  emulation of Win32::SerialPort for
ii  libtimedate-perl              1.2000-1   collection of modules to manipulat

mtkbabel recommends no packages.

mtkbabel suggests no packages.

- -- no debconf information

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (GNU/Linux)

iEYEARECAAYFAkuT/RcACgkQ+AQB36CPPloi4gCggnMRCkZzB0Hy96ZnhAKyGboK
ExwAnRoPcYMmQFLBLkCvBBRFPnl4lw8p
=tg18
-----END PGP SIGNATURE-----
--- a/mtkbabel	2009-01-20 22:27:52.000000000 +0100
+++ b/mtkbabel	2010-03-07 19:55:56.272364662 +0100
@@ -312,6 +315,7 @@
 # i-Blue 747            PMTK705,M-core_1.94,001B
 # Holux M-241           PMTK705,B-core_1.1,0021,01017-00C,1.0
 # Holux M-241           PMTK705,B-core_1.20,0023,01017-00D,1.0
+# Holux M-241           PMTK705,B-core_1.20,0043,01017-00F,1.0
 #
 packet_send('PMTK605');
 $ret = packet_wait('PMTK705,');
@@ -818,11 +822,12 @@
         # - non written space:       FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
         # - Holux M-241 separators : HOLUXGR241LOGGER
         #                            HOLUXGR241WAYPNT
+        # - Holux M-241 fw 1.13 separators: "HOLUXGR241LOGGER    "
+        #                                   "HOLUXGR241WAYPNT    "
         #------------------------------------------------------------------
         if (($log_len - tell($fp)) >= $SIZEOF_SEPARATOR) {
 
             $buffer = my_read($fp, $SIZEOF_SEPARATOR);
-
             if ((substr($buffer, 0, 7) eq (chr(0xaa) x 7)) and (substr($buffer, -4) eq (chr(0xbb) x 4))) {
                 #----------------------------------------------------------
                 # Found a record separator.
@@ -848,6 +853,8 @@
                 printf("Separator: %s\n", $buffer) if ($debug >= $LOG_INFO);
                 $model_id = '0021';
                 set_data_types($model_id);
+                $buffer = my_read($fp, 4);
+                ($buffer eq '    ') ? $model_id = '0043' : seek($fp,-4,1);
                 next;
 
             } elsif ($buffer eq 'HOLUXGR241WAYPNT') {
@@ -858,6 +865,8 @@
                 $model_id = '0021';
                 set_data_types($model_id);
                 $next_data_force_waypoint = 1;
+                $buffer = my_read($fp, 4);
+                ($buffer eq '    ') ? $model_id = '0043' : seek($fp,-4,1);
                 next;
 
             } elsif ($buffer eq (chr(0xff) x $SIZEOF_SEPARATOR)) {
@@ -1721,7 +1730,8 @@
 
     if ($model_id eq '0005' or
         $model_id eq '0021' or
-        $model_id eq '0023')
+        $model_id eq '0023' or
+        $model_id eq '0043')
     {
         printf("Setting log format and data types for Holum M-241, model ID %s\n", $model_id) if ($debug >= $LOG_INFO);
         $LOG_HAS_CHECKSUM_SEPARATOR = 0;

Reply via email to