Reading data from your Garmin GPSMap 62

I need to read data from a GPSMap 62 device using the Javascript library to control the device. The problem is that unlike older devices, this device stores its waypoints in separate .GPX files every day. The javascript library expects all tracks and waypoints to be in the current.gpx file, but 62 stores them, for example. Waypoints_06-MAY-14.gpx etc. Everyday.

To prevent users from manually downloading the corresponding file, did anyone get a DeviceControl library to actually support new devices with separate GPX files?

As an added bonus, the Garmin Device Control library is out of date, so no updates are expected.

Some code

startReadFromGps: function(deviceNumber) { this.plugin.StartReadFromGps( deviceNumber ); //invokes the external plugin }, 
+6
source share
1 answer

I checked the plugin in version 2.3-RC1 (I do not know which version you are using).

Indeed, there is a startReadFromGps method:

 /** Initiates the read from the gps device conneted. Use finishReadFromGps and getGpsProgressXml to * determine when the plugin is done with this operation. Also, use getGpsXml to extract the * actual data from the device. <br/> * <br/> * Minimum plugin version 2.0.0.4 * * @param deviceNumber {Number} assigned by the plugin, see getDevicesXml for * assignment of that number. * @see #finishReadFromGps * @see #cancelReadFromGps * @see #getDevicesXml */ startReadFromGps: function(deviceNumber) { this.plugin.StartReadFromGps( deviceNumber ); }, 

Therefore, it uses getGpsXml . I assume that it uses the specified file name that is being read, and the method returns the contents of the file. My first thought is to change the file name - this is possible with

 /** This the filename that wil contain the gps xml once the transfer is complete. Use with * setWriteGpsXml to set what the file contents will be. Also, use startWriteToGps to * actually make the write happen. * * @private * @param filename {String} the actual filename that will end up on the device. Should only be the * name and not the extension. The plugin will append the extension portion to the file name--typically .gpx. * @see #setWriteGpsXml, #startWriteToGps, #startWriteFitnessData */ _setWriteFilename: function(filename) { this.plugin.FileName = filename; }, 

But _setWriteFilename is a private method. However caused

 startWriteToGps: function(gpsXml, filename, deviceNumber) 

and

 startWriteFitnessData: function(tcdXml, deviceNumber, filename, dataTypeName) 

Since now I will check whether a call to these methods with the specified filename override the file name value, and a further call to startReadFromGps will use the new filename .

I cannot verify this, I have not used this library, but you can take a picture.

+1
source

All Articles