I have attached a patch file that adds support for the first generation of 
yellow eTrex units.  

The modifications were localized to the EtrexLegend directory since the eTrex, 
eTrex Legend, and eTrex Vista are all very similar.  Testing, however, was 
only done with my eTrex.

One caveat: the eTrex does not support maps (like the Vista and Legend).  I 
added a flag to abort _queryMap and _uploadMap on the eTrex (but not Vista 
and Legend).  While this does skip attempts to query/upload maps the the 
eTrex, it does confuse the upper layers of QLandKarte.  Are there any ideas 
on how to solve this?

All work was done off this SVN tag:
https://qlandkarte.svn.sourceforge.net/svnroot/qlandkarte/tag/QLandkarte.2008.07.04
It should patch to the trunk just fine.

Daniel
-- 
Daniel Schudel
[EMAIL PROTECTED]
Index: src/device/EtrexLegend/CDevice.cpp
===================================================================
--- src/device/EtrexLegend/CDevice.cpp	(revision 514)
+++ src/device/EtrexLegend/CDevice.cpp	(working copy)
@@ -49,7 +49,7 @@
 CDevice::CDevice()
 : serial(0)
 {
-
+	supportsMaps = true;
 }
 
 
@@ -108,6 +108,10 @@
 
 void CDevice::_uploadMap(const uint8_t * mapdata, uint32_t size, const char * key)
 {
+    if(supportsMaps == false) 
+    {
+	    return;
+    }
     if(serial == 0) return;
     int ready= 0;
     int cancel = 0;
@@ -216,6 +220,10 @@
 void CDevice::_queryMap(std::list<Map_t>& maps)
 {
     maps.clear();
+    if(supportsMaps == false) 
+    {
+	    return;
+    }
     if(serial == 0) return;
 
     Packet_t command;
Index: src/device/EtrexLegend/EtrexLegend.pro
===================================================================
--- src/device/EtrexLegend/EtrexLegend.pro	(revision 514)
+++ src/device/EtrexLegend/EtrexLegend.pro	(working copy)
@@ -22,6 +22,18 @@
 SOURCES += CDevice.cpp \
            loader.cpp
 
-QMAKE_POST_LINK   = cd ${DESTDIR} && ln -sf ${TARGET} libEtrexVista.so
-target2.path      = $${QLANDKARTE_LIBDIR}
-target2.commands  = cd ${INSTALL_ROOT}$${QLANDKARTE_LIBDIR} && ln -sf ${TARGET} libEtrexVista.so
+ALIASES = libEtrexVista \
+	  libEtrexClassic
+
+unix {
+    QMAKE_POST_LINK   = cd ${DESTDIR} && \
+		for n in $${ALIASES} ; do \
+			ln -sf ${TARGET} \$\$n$${SH_LIB_EXT}; \
+		done
+
+    target2.path      = $${QLANDKARTE_LIBDIR}
+    target2.commands  = cd $(INSTALL_ROOT)$${QLANDKARTE_LIBDIR} && \
+		for n in $${ALIASES} ; do \
+			ln -sf ${TARGET} \$\$n$${SH_LIB_EXT}; \
+		done
+}
Index: src/device/EtrexLegend/loader.cpp
===================================================================
--- src/device/EtrexLegend/loader.cpp	(revision 514)
+++ src/device/EtrexLegend/loader.cpp	(working copy)
@@ -54,3 +54,23 @@
     EtrexLegend::device->devid = 169;
     return EtrexLegend::device;
 }
+
+// I went back-and-forth on where to put the eTrex Classic
+// (https://buy.garmin.com/shop/shop.do?cID=167&pID=6403).  Visually,
+// and feature capabilities, it is probably close to the eTrex H.  However,
+// the eTrex Classic is of the same vintage as the eTrex Legend and eTrex Vista.
+// So, as far as firmware (and serial communications go), it is closer to those.
+// Therefore, I put it here.
+extern "C" Garmin::IDevice * const initEtrexClassic(const char * version)
+{
+    if(strncmp(version,INTERFACE_VERSION,5) != 0) {
+        return 0;
+    }
+    if(EtrexLegend::device == 0) {
+        EtrexLegend::device = new EtrexLegend::CDevice();
+    }
+    EtrexLegend::device->devname = "eTrex";
+    EtrexLegend::device->devid = 130;
+    EtrexLegend::device->supportsMaps = false;
+    return EtrexLegend::device;
+}
Index: src/device/EtrexLegend/CDevice.h
===================================================================
--- src/device/EtrexLegend/CDevice.h	(revision 514)
+++ src/device/EtrexLegend/CDevice.h	(working copy)
@@ -36,6 +36,7 @@
 
             std::string devname;
             uint32_t devid;
+            bool supportsMaps;  // Does this device support map upload/download
 
             const std::string& getCopyright();
 
-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
QLandkarte-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/qlandkarte-users

Reply via email to