Garmin Mass Storage Mode devices such as the nüvi 350/360, nüvi 660, StreetPilot c550, and the zumo no longer communicate with a computer with the Garmin Protocol but instead present themselves as a USB mass storage device. When a USB cable is connected between a Garmin Mass Storage Mode GPS device and a computer, the GPS device enters mass storage mode. Every Garmin Mass Storage Mode device contains a GarminDevice.xml in the Garmin subdirectory of the device. The GarminDevice.xml file describes the device’s identity and capabilities as well as information about currently installed software components and compatible software components. The device volume is usually named GARMIN but may be named after the device; i.e. GARMIN:\Garmin\GarminDevice.xml or nuvi:\Garmin\GarminDevice.xml.
The GarminDevice.xml File
The GarminDevicev2 schema describes the contents of the GarminDevice.xml file. A sample document from a Garmin Device is listed below. Third-party applications which read and write user data should always parse the GarminDevice.xml file to determine the correct location for reading and writing GPS data. New models of a device may use a future version of the xml Schema; if that is that case the value of the xsi:schemaLocation field of the document will indicate URL of the new xml namespace and schema, and the new schema will be published on the Garmin website.
GPX file format for waypoints, tracks, and routes
Garmin mass storage devices send and receive data in the form of files. For user data the file format is GPS Exchange (.gpx), which is a de-facto standard for the exchange of waypoints, routes, and tracks used by many applications. Documentation of the .gpx file format can be obtained from Topografix. (Topografix maintains the GPS Exchange (.gpx) standard as a public service.)
The GPS Exchange (.gpx) format allows the use of proprietary extensions. The schema for Garmin’s proprietary extensions describes the information it can contain.
One interesting Garmin-proprietary extension which should be preserved when reading data from and writing data to Garmin Mass Storage devices such as the zumo is the detailed route point extension. The route point extension fits into the extensions field of a gpx rtept element and contains the very detailed path, to the next waypoint. The intent of the detailed routepoints is to ensure that a route generated with a Garmin application or with a Garmin Mass Storage Device can be shared with another Garmin Mass Storage device and still represent the exact same desired path. As an example, a group of bikers traveling from Flagstaff, Arizona to Kingman, Arizona might want to take historic Route 66 from Seligman, Arizona through Radiator Springs. Recalculating the route from just the routepoints on a gps device might instead route a person on the faster interstate. A set of intermediate detailed route points ensures that the path followed will actually be Route66 and not Interstate 40.
...xmlns:gpxx="http://www.garmin.com/xmlschemas/GpxExtensions/v3"... <rte> <rtept ... > <extensions> <gpxx:RtePtExtension> <gpxx:rpt lat="38.840104" lon="-94.661981"> ... </gpxx:rpt> </gpxx:RtePtExtension> </extensions> </rtept ...> <rtept ...> </rtept> </rte>
Reading from the GPS Device
The current working set of waypoints, tracks, and routes is available to the application as a GPS Exchange (.gpx) file. The GarminDevice.xml file contains a DataType element in the MassStorageMode file with the name GPSData which details the file or location from which the working set of user data should be read. The GPS device regenerates this file from it’s memory upon entry into mass storage mode. An application can determine the location of this file by looking for a DataType element with a name Element of GPSData. This DataType element will contain a File element with TransferDirection of OutputFromUnit with directory path, file name, and transfer direction specified. Applications should always parse the GarminDevice.xml to determine the location from which to retrieve data. The document fragment below is a sample DataType element from a GarminDevice.xml file. Because different models of GPS devices may change the path and file name, and possibly even the file specification and extension, applications should always read these values from the GarminDevice.xml file.
... <DataType> <Name>GPSData</Name> <File> <Specification> <Identifier>http://www.topografix.com/GPX/1/1</Identifier> <Documentation>http://www.topografix.com/GPX/1/1/gpx.xsd</Documentation> </Specification> <Location> <Path>Garmin/gpx</Path> <FileExtension>GPX</FileExtension> </Location> <TransferDirection>InputToUnit</TransferDirection> </File> <File> <Specification> <Identifier>http://www.topografix.com/GPX/1/1</Identifier> <Documentation>http://www.topografix.com/GPX/1/1/gpx.xsd</Documentation> </Specification> <Location> <Path>Garmin/gpx</Path> <BaseName>current</BaseName> <FileExtension>GPX</FileExtension> </Location> <TransferDirection>OutputFromUnit</TransferDirection> </File> </DataType> ...
Writing to the GPS Device
The GpsData DataType element also contains a File element with TransferDirection=InputToUnit which specifies a file type, extension and file path. The application places a GPS Exchange (.gpx) file containing routes, tracks and waypoints in the directory path specified. This file will be processed by the GPS device upon exit from mass storage mode.
Because the BaseName of the file is not specified, the file can have any arbitrary name. Applications should let the user choose a meaningful file name such as SedonaTrip.gpx or Route66Kingman.gpx because meaningful file names will help the user to manage their data on the GPS Device.