GSAK (Geocaching Swiss Army Knife) | ||
Contents
- Index
Mtp(sAction,[sData1],[sData3],[sData3) : string Macro function to communicate with MTP devices (Garmin Monterra, for example) sAction is the required action to perform and may need up to 3 data parameters GetDevices - Returns a CSV list of USB connected devices that support MTP commands. No data parameters are required. You can use the macro function Csv() to read this data and pull out individual entries. For example here is a list of my attached devices which include a HTC phone (mtp device), Nexus 7 (mtp device), Garmin Oregon 650 (mass storage), SanDisk thumb drive (mass storage) Macro code to produce this list:
Dir - Returns a csv List of files on the device (Currently just FileName,ObjectId,Type). sData1 must be the device ID to list and sData2 must be the folder to list. From what I can gather, on all MTP devices the root folder for internal memory is "S10001" and for any attached SD card it is "S20001", For example the code to list the contents of the root folder (Internal memory) of my HTC phone:
Which produces this list: FileExists - sData1 must be the device ID and sData2 must be the fully qualified path to the file (For example "s10001\Movies\Airplane.mp4"). The return value is "True" or "False" FolderExists - sData1 must be the device ID and sData2 must be the fully qualified path to the folder, without the trailing backslash (For example"s10001\Movies"). The return value is "True" or "False" DeleteFile - sData1 must be the device ID and sData2 must be the fully qualified path to the file (For example"s10001\Garmin\gpx\test.gpx"). GetFile - Fetch a file from the device. sData1 must be the device ID. sData2 must be the fully qualified path to the file (For example"s10001\Garmin\Geocache_Visits.txt"). PutFile - Save a file to the device. sData1 must be the device ID. sData2 must be the fully qualified path to the file (For example"c:\temp\test.gpx"). sData3 must be the fully qualified path where the file will be saved (example "s10001\Garmin\gpx\test.gpx") CreateFolder - Create a folder on the device. sData1 must be the device ID. sData2 must be the fully qualified path to the folder (for example "s10001\NewFolder" If there is an error performing the action then the first 7 characters of the return string will contain "*Error*" |
Copyright 2004-2019 CWE Computer Services Privacy Policy Contact |