- 1. Introduction
- 2. Synchronous API calls
2.1. INT GetSDKVersion(TError* aError, TVersion* aVersion)
2.2. INT GetApplicationVersion(TError* aError, TVersion* aVersion)
2.3. INT BringNavigatorToForeground(TError* aError)
2.4. INT TomTomApplicationToForeground()
2.5. INT SwitchToNavigatorView(TError* aError)
2.6. INT FlashMessage(TError* aError, char* aMessage, int aMilliSeconds)
2.7. INT GetDataSetInfo(TError* aError, TDataSetInfo* aDataSetInfo )
2.8. INT GetRouteInfo(TError* aError, TRouteInfo* aRouteInfo )
2.9. INT GetRouteCoordinates(TError* aError, TRouteCoordinates* aRouteCoordinates)
2.10. INT GetLocationInfo(TError* aError, TLocationInfo* aLocInfo, long aLongitude, long aLatitude)
2.11. INT GetLocationInfoEx(TError* aError, TLocationInfoEx* aLocInfo, long aLongitude, long aLatitude)
2.12. INT GetUniqueDeviceId(TError* aError, TDeviceId* aDeviceID)
2.13. INT NavigateToCoordinates(TError* aError, long aLongitude, long aLatitude, char* aName)
2.14. INT NavigateToFavorite(TError* aError, long aFavNum)
2.15. INT ShowCoordinatesOnMap(TError* aError, long aLongitude, long aLatitude)
2.16. INT ShowPostalCodeOnMap(TError* aError, char* aCountry, char* aPostcode, char* aHouseNr)
2.17. INT ShowRectangleOnMap(TError* aError, long aLongitudeW, long aLatitudeS, long aLongitudeE, long aLatitudeN)
2.18. INT ChangeSetting(TError* aError, ESettingAndValue aSettingAndValue)
2.19. INT SwitchMap(TError* aError, char* aMapName)
2.20. INT SetNavigatorProperty(TError* aError, EProperty aProperty, long aValue)
2.21. INT ShowAddressOnMap(TError* aError, char* aCity, char* aStreet, char* aHouseNr, char* aPostcode)
2.22. INT NavigateToAddress(TError* aError, char* aCity, char* aStreet, char* aHouseNr, char* aPostcode)
2.23. INT GetCurrentPosition(TError* aError, TCurrentPositionInfo* aCurrentPosition)
2.24. INT Geocode(TError* aError, TGeocodeResult* aGeocoderesult, char* aCity, char* aStreet, char* aHouseNr)
2.25. INT GeocodeExtended(TError* aError, TGeocodeResult* aGeocoderesult, char* aCity, char* aStreet, char* aHouseNr, char* aPostcode)
2.26. ClearFavorite(TError* aError, long aIndex)
2.27. INT SetFavorite(TError* aError, long aIndex, char* aName, char* aDescription, long aLongitude, long aLatitude)
2.28. INT GetFavorite(TError* aError, TFavoriteInfo* aFavoriteInfo, long aIndex)
2.29. INT MakePoiVisible(TError* aError, EPoiTypeCode aPoiTypeCode, long aVisibility)
2.30. INT AddPoi(TError* aError, char* aFilename , long aLongitude , long aLatitude , char* aName , char* anId )
2.31. INT DeleteClosestPoi(TError* aError, char* aFilename, long aLongitude, long aLatitude)
2.32. INT DeleteAllPoi(TError* aError, char* aFilename)
2.33. INT MakeUserPoiVisible(TError* aError, char* aFilename, long aVisibility)
2.34. INT MoveClosestPoi(TError* aError, char* aFilename, long aLongitude , long aLatitude , long aNewLongitude , long aNewLatitude )
2.35. INT GetGPSFeedFile()
2.36. INT ShowExactDestination(TError* aError, int aEnable)
2.37. INT ClearRoute(TError* aError)
2.38. INT SaveItinerary(TError* aError, char* aFilename)
2.39. INT LoadItinerary(TError* aError, char* aFilename)
2.40. INT ClearItinerary(TError* aError)
2.41. INT NavigateToNextStopover(TError* aError)
2.42. INT AbortItineraryLeg(TError* aError)
2.43. INT GetCurrentStopover(TError* aError, TItineraryIndex* aIndex)
2.44. INT UseGFFile(TError* aError, char* aFilename)
2.45. INT EnableGFRecord(TError* aError, int aUID, int aEnable)
2.46. INT OpenInternetConnection(TError* aError)
2.47. INT CloseInternetConnection(TError* aError)
2.48. INT GetInternetConnectionStatus(TError* aError, TInternetConnectionStatus* aStatus)
2.49. INT GetDeviceActivationId(TError* aError, TDeviceActivationId* aId, int aRemoveSpaces)
2.50. INT PlaySoundFile(TError* aError, char* aFilename, int aQueue)
- 3. Asynchronous API calls
- 4. Structures and enumerations from the API
- 5. Error codes
1. Introduction
This section lists all supported synchronous API calls and their structures and enumerations. Furthermore it explains how to create asynchronous API calls based on the synchronous calls.
2. Synchronous API calls
The function calls currently supported are:
2.1. INT GetSDKVersion(TError* aError, TVersion* aVersion)
Command parameters:
- TError aError - additional error information returned from application
- TVersion aVersion - version structure to fill
Returns: 0 if successful, non-zero value otherwise.
Supported Since: version 5.00
Returns the SDK version number information (version string and build number).
2.2. INT GetApplicationVersion(TError* aError, TVersion* aVersion)
Command parameters:
- TError aError - additional error information returned from application
- TVersion aVersion - version structure to fill
Returns: 0 if successful, non-zero value otherwise.
Supported Since: version 5.00
Returns the version number information of the TomTom navigation application (version string and build number).
2.3. INT BringNavigatorToForeground(TError* aError)
Command parameters:
- TError aError - additional error information returned from application
Returns: 0 if successful, non-zero value otherwise.
Supported Since: version 5.00
Brings the TomTom navigation application to the foreground. On the TomTom GO, this function is equivalent to 'TomTomApplicationToForeground()'.
The only way to bring the SDK application back to foreground is to start the application from the menu.
2.4. INT TomTomApplicationToForeground()
Returns: 0 if successful, non-zero value otherwise.
Supported Since: version 5.00
Brings the TomTom navigation application to the foreground. On the TomTom GO, this function is equivalent to 'BringNavigatorToForeground()'.
The only way to bring the SDK application back to foreground is to start the application from the menu.
2.5. INT SwitchToNavigatorView(TError* aError)
Command parameters:
- TError aError - additional error information returned from application
Returns: 0 if successful, non-zero value otherwise.
Supported Since: version 5.00
Switches to the navigation view.
2.6. INT FlashMessage(TError* aError, char* aMessage, int aMilliSeconds)
Command parameters:
- TError aError - additional error information returned from application
- char* aMessage - message to show on screen
- int aMilliSeconds - milliseconds to show this message on screen
Returns: 0 if successful, non-zero value otherwise.
Supported Since: version 5.00
Flashes a message on screen in the Navigation Application, for the specified amount of milliseconds.
2.7. INT GetDataSetInfo(TError* aError, TDataSetInfo* aDataSetInfo )
Command parameters:
- TError aError - additional error information returned from application
- TDataSetInfo aDataSetInfo - data set information
Returns: 0 if successful, non-zero value otherwise.
Supported Since: version 5.00
Gets information about the currently selected data set.
2.8. INT GetRouteInfo(TError* aError, TRouteInfo* aRouteInfo )
Command parameters:
- TError aError - additional error information returned from application
- TRouteInfo aRouteInfo - route information
Returns: 0 if successful, non-zero value otherwise.
Supported Since: version 5.00
Gets information about the current route.
2.9. INT GetRouteCoordinates(TError* aError, TRouteCoordinates* aRouteCoordinates)
Command parameters:
- TError aError - additional error information returned from application
- TRouteCoordinates aRouteCoordinates - route coordinates structure
Returns: 0 if successful, non-zero value otherwise.
Supported Since: version 5.00
Returns an array of coordinates (nodes) for the current route. The user is responsible for freeing the returned array.
2.10. INT GetLocationInfo(TError* aError, TLocationInfo* aLocInfo, long aLongitude, long aLatitude)
Command parameters:
- TError aError - additional error information returned from application
- TLocationInfo aLocInfo - record containing street address of this location
- long aLongitude - longitude specified in WGS84 format (in 100000ths of a degree)
- long aLatitude - latitude specified in WGS84 format (in 100000ths of a degree)
Returns: 0 if successful, non-zero value otherwise.
Supported Since: version 5.00
Gets information about the location closest to the given point. In other words, it performs reverse geocoding, or 'geodecoding'.
2.11. INT GetLocationInfoEx(TError* aError, TLocationInfoEx* aLocInfo, long aLongitude, long aLatitude)
Command parameters:
- TError aError - additional error information returned from application
- TLocationInfoEx aLocInfo - record containing street address of this location, including city name
- long aLongitude - longitude specified in WGS84 format (in 100000ths of a degree)
- long aLatitude - latitude specified in WGS84 format (in 100000ths of a degree)
Returns: 0 if successful, non-zero value otherwise.
Supported Since: version 5.00
Gets information about the location closest to the given point, including city name information. In other words, perform reverse geocoding, or 'geodecoding'.
2.12. INT GetUniqueDeviceId(TError* aError, TDeviceId* aDeviceID)
Command parameters:
- TError aError - additional error information returned from application
- TDeviceId aDeviceID - structure holding the ID of the current device
Returns: 0 if successful, non-zero value otherwise.
Supported Since: version 5.00
Stores the unique ID of the current device in the given structure.
2.13. INT NavigateToCoordinates(TError* aError, long aLongitude, long aLatitude, char* aName)
Command parameters:
- TError aError - additional error information returned from application
- long aLongitude - longitude specified in WGS84 format (in 100000ths of a degree)
- long aLatitude - latitude specified in WGS84 format (in 100000ths of a degree)
- char* aName - user-defined location name
Returns: 0 if successful, non-zero value otherwise.
Supported Since: version 5.00
Starts planning the route from the current point to the given coordinates.
2.14. INT NavigateToFavorite(TError* aError, long aFavNum)
Command parameters:
- TError aError - additional error information returned from application
- long aFavNum - 0-based favorite number
Returns: 0 if successful, non-zero value otherwise.
Supported Since: version 5.00
Starts planning the route from the current point to the given favourite.
2.15. INT ShowCoordinatesOnMap(TError* aError, long aLongitude, long aLatitude)
Command parameters:
- TError aError - additional error information returned from application
- long aLongitude - longitude specified in WGS84 format (in 100000ths of a degree)
- long aLatitude - latitude specified in WGS84 format (in 100000ths of a degree)
Returns: 0 if successful, non-zero value otherwise.
Supported Since: version 5.00
Centers the map at the point with given coordinates.
2.16. INT ShowPostalCodeOnMap(TError* aError, char* aCountry, char* aPostcode, char* aHouseNr)
Command parameters:
- TError aError - additional error information returned from application
- char* aCountry - country code. Currently NL (the Netherlands) and UK (United Kingdom) are supported.
- char* aPostcode - Postal code to show on map.
- char* aHouseNr - Housenumber.
Centers the map at the point indicated by the postcal code and housenumber. Returns -8 if no postal code database was found for the given country.
2.17. INT ShowRectangleOnMap(TError* aError, long aLongitudeW, long aLatitudeS, long aLongitudeE, long aLatitudeN)
Command parameters:
- TError aError - additional error information returned from application
- long aLongitudeW - top left longitude specified in WGS84 format (in 100000ths of a degree)
- long aLatitudeS - top left latitude specified in WGS84 format (in 100000ths of a degree)
- long aLongitudeE - bottom right longitude specified in WGS84 format (in 100000ths of a degree)
- long aLatitudeN - bottom right latitude specified in WGS84 format (in 100000ths of a degree)
Returns: 0 if successful, non-zero value otherwise.
Supported Since: version 5.00
Rescales the map to show the given rectangle.
2.18. INT ChangeSetting(TError* aError, ESettingAndValue aSettingAndValue)
Command parameters:
- TError aError - additional error information returned from application
- ESettingAndValue aSettingAndValue - setting and value
Returns: 0 if successful, non-zero value otherwise.
Supported Since: version 5.00
Changes one of the supported settings, like sound on, show map, etc.
2.19. INT SwitchMap(TError* aError, char* aMapName)
Command parameters:
- TError aError - additional error information returned from application
- char* aMapName - the directory name for the new map
Returns: 0 if successful, non-zero value otherwise.
Supported Since: version 5.00
Tries to open the map in the given directory. If the map needs to be activated first, then the user gets an activation dialog for the given map. Switch to the map specified by the full name and path of the .PNA file. The map name accepted will be the same as returned by GetDataSetInfo for that map. For example, if your map is stored in the Benelux-Map, the aMapName argument should be the full path to that directory: '/mnt/sdcard/Benelux-Map/'.
2.20. INT SetNavigatorProperty(TError* aError, EProperty aProperty, long aValue)
Command parameters:
- TError aError - additional error information returned from application
- EProperty aProperty - property to set
- long aValue - value to set the property to
Returns: 0 if successful, non-zero value otherwise.
Supported Since: version 5.00
Sets the value for one of the properties (user settings), like current color schemes, voice volume, etc.
2.21. INT ShowAddressOnMap(TError* aError, char* aCity, char* aStreet, char* aHouseNr, char* aPostcode)
Command parameters:
- TError aError - additional error information returned from application
- char* aCity - cityname of the address to show on map
- char* aStreet - streetname of the address to show on map
- char* aHouseNr - housenumber of the address to show on map
- char* aPostcode - postal code of the address to show on map
Returns: 0 if successful, non-zero value otherwise.
Supported Since: version 5.00
Shows a specific address on the map.
2.22. INT NavigateToAddress(TError* aError, char* aCity, char* aStreet, char* aHouseNr, char* aPostcode)
Command parameters:
- TError aError - additional error information returned from application
- char* aCity - cityname of the address to navigate to
- char* aStreet - streetname of the address to navigate to
- char* aHouseNr - housenumber of the address to navigate to
- char* aPostcode - postal code of the address to navigate to
Returns: 0 if successful, non-zero value otherwise.
Supported Since: version 5.00
Navigates to a specific address.
2.23. INT GetCurrentPosition(TError* aError, TCurrentPositionInfo* aCurrentPosition)
Command parameters:
- TError aError - additional error information returned from application
- TCurrentPositionInfo aCurrentPosition - structure containing information on current position
Returns: 0 if successful, non-zero value otherwise.
Supported Since: version 5.00
Gets current GPS position(latitude, longitude, speed in km/h and direction in degrees) and GPS status(general or receiving).
2.24. INT Geocode(TError* aError, TGeocodeResult* aGeocoderesult, char* aCity, char* aStreet, char* aHouseNr)
Command parameters:
- TError aError - additional error information returned from application
- TGeocodeResult aGeocoderesult - structure containing information on position of given address
- char* aCity - cityname of the address to get position information on
- char* aStreet - streetname of the address to get position information on
- char* aHouseNr - housenumber of the address to get position information on
Returns: 0 if successful, non-zero value otherwise.
Supported Since: version 5.00
Returns geocode (latitude and longitude) for the given address, specified by the city name, street name and house number arguments, and return the co-ordinates of the found location and its complete city and street names in the geocode information argument. If the street name argument is empty, the function will try to find the center of the city specified by the city name argument. If no location is found with city and street names exactly matching the arguments, then a city and a street will be chosen with names as similar as possible to the given ones. This will be indicated in the status field of the geocode information argument.
2.25. INT GeocodeExtended(TError* aError, TGeocodeResult* aGeocoderesult, char* aCity, char* aStreet, char* aHouseNr, char* aPostcode)
Command parameters:
- TError aError - additional error information returned from application
- TGeocodeResult aGeocoderesult - structure containing information on position of given address
- char* aCity - cityname of the address to get position information on
- char* aStreet - streetname of the address to get position information on
- char* aHouseNr - housenumber of the address to get position information on
- char* aPostcode - postal code of the address to get position information on
Returns: 0 if successful, non-zero value otherwise.
Supported Since: version 5.00
Returns geocode (latitude and longitude) for the given address, specified by the city name, street name, house number and postal code arguments, and returns the co-ordinates of the found location and its complete city and street names in the geocode information argument. If the street name argument is empty, the function will try to find the center of the city specified by the city name argument. . If no location is found with city and street names exactly matching the arguments, then a city and a street will be chosen with names as similar as possible to the given ones. This will be indicated in the status field of the geocode information argument.
2.26. ClearFavorite(TError* aError, long aIndex)
Command parameters:
- TError aError - additional error information returned from application
- long aIndex - index of the array of favourites (zero-based)
Clears given favourite or returns an error, if the index is beyond the bounds of the favourites array.
2.27. INT SetFavorite(TError* aError, long aIndex, char* aName, char* aDescription, long aLongitude, long aLatitude)
Command parameters:
- TError aError - additional error information returned from application
- long aIndex - index of the array of favourites
- char* aName - name of the favourite
- char* aDescription - description of the favourite
- long aLongitude - longitude specified in WGS84 format (in 100000ths of a degree)
- long aLatitude - latitude specified in WGS84 format (in 100000ths of a degree)
Returns: 0 if successful, non-zero value otherwise.
Supported Since: version 5.00
Assigns the data to the element from the favourites array with the given index (zero-based).
2.28. INT GetFavorite(TError* aError, TFavoriteInfo* aFavoriteInfo, long aIndex)
Command parameters:
- TError aError - additional error information returned from application
- TFavoriteInfo aFavoriteInfo - information on the favourite returned
- long aIndex - index of the array of favourites
Returns: 0 if successful, non-zero value otherwise.
Supported Since: version 5.00
Returns the element from the favourites array with the given index (zero-based).
2.29. INT MakePoiVisible(TError* aError, EPoiTypeCode aPoiTypeCode, long aVisibility)
Command parameters:
- TError aError - additional error information returned from application
- EPoiTypeCode aPoiTypeCode - code for the type of POI
- long aVisibility - 0 for hiding, other value for showing
Returns: 0 if successful, non-zero value otherwise.
Supported Since: version 5.00
Enables or disables displaying a specific POI type.
2.30. INT AddPoi(TError* aError, char* aFilename , long aLongitude , long aLatitude , char* aName , char* anId )
Command parameters:
- TError aError - additional error information returned from application
- char* aFilename - name of the POI category
- long aLongitude - longitude specified in WGS84 format (in 100000ths of a degree)
- long aLatitude - latitude specified in WGS84 format (in 100000ths of a degree)
- char* aName - name of the POI
- char* anId - optional external identifier of the POI
Returns: 0 if successful, non-zero value otherwise.
Supported Since: version 5.00
Adds a point of interest to the .OV2 file specified by the POI category argument. The point of interest will have the name and co-ordinates given by the corresponding arguments. An external identifier string can also be attached to the point of interest. When the .OV2 file does not yet exist, it is created.
To specify a phonenumber for this POI, add ">phonenumber" to the POI name. E.g. aName = "poiname>0123456789".
The maximum number of .OV2 files is 100. The maximum number of POI per file has no limit, but adding a very large number of POI can make the application significantly slower.
2.31. INT DeleteClosestPoi(TError* aError, char* aFilename, long aLongitude, long aLatitude)
Command parameters:
- TError aError - additional error information returned from application
- char* aFilename - name of the POI category
- long aLongitude - longitude specified in WGS84 format (in 100000ths of a degree)
- long aLatitude - latitude specified in WGS84 format (in 100000ths of a degree)
Returns: 0 if successful, non-zero value otherwise.
Supported Since: version 5.00
Deletes a point of interest from the .OV2 file specified by the POI category argument. The point of interest to be deleted is the closest one to the given co-ordinates among the points of interest that are within a distance of 100 meters from there.
2.32. INT DeleteAllPoi(TError* aError, char* aFilename)
Command parameters:
- TError aError - additional error information returned from application
- char* aFilename - name of the POI category
Returns: 0 if successful, non-zero value otherwise.
Supported Since: version 5.00
Deletes all points of interest from the .OV2 file specified by the POI category argument. The POI category itself is also removed after that.
2.33. INT MakeUserPoiVisible(TError* aError, char* aFilename, long aVisibility)
Command parameters:
- TError aError - additional error information returned from application
- char* aFilename - name of the POI category
- long aVisibility - whether to show or hide this POI type on the map
Returns: 0 if successful, non-zero value otherwise.
Supported Since: version 5.00
Enables or disables displaying a specific user-created POI type.
2.34. INT MoveClosestPoi(TError* aError, char* aFilename, long aLongitude , long aLatitude , long aNewLongitude , long aNewLatitude )
Command parameters:
- TError aError - additional error information returned from application
- char* aFilename - name of the POI category
- long aLongitude - old longitude specified in WGS84 format (in 100000ths of a degree)
- long aLatitude - old latitude specified in WGS84 format (in 100000ths of a degree)
- long aNewLongitude - new longitude specified in WGS84 format (in 100000ths of a degree)
- long aNewLatitude - new latitude specified in WGS84 format (in 100000ths of a degree)
Returns: 0 if successful, non-zero value otherwise.
Supported Since: version 5.00
Moves a point of interest from the .OV2 file specified by the POI category argument to a new position. The point of interest to be moved is the closest POI to the given old co-ordinates among the points of interest that are within a distance of 100 meters from there.
2.35. INT GetGPSFeedFile()
Returns: file descriptor to RAW GPS NMEA FEED
Supported Since: version 5.00
This function returns a filedescriptor for the raw GPS NMEA feed. You can use the Unix read() function to read from this filedescriptor. The feed returns raw GPS NMEA data.
2.36. INT ShowExactDestination(TError* aError, int aEnable)
Command parameters:
- TError aError - additional error information returned from application
- int aEnable - zero to disable or non-zero to enable.
Returns: 0 if successful, non-zero value otherwise.
Supported Since: version 6.00
If ShowExactDestination is enabled, the application will draw a dotted line from the end of the route, which is always on a road, to the exact destination. This is useful if the destination is not located on a road.
2.37. INT ClearRoute(TError* aError)
Command parameters:
- TError aError - additional error information returned from application
Returns: 0 if successful, non-zero value otherwise.
Supported Since: version 6.00
Clears the current route.
2.38. INT SaveItinerary(TError* aError, char* aFilename)
Command parameters:
- TError aError - additional error information returned from application
- char* aFilename - file to save to.
Returns: 0 if successful, non-zero value otherwise.
Saves the current itinerary to a file.
2.39. INT LoadItinerary(TError* aError, char* aFilename)
Command parameters:
- TError aError - additional error information returned from application
- char* aFilename - file to load from.
Returns: 0 if successful, non-zero value otherwise.
Loads the itinerary from a file.
2.40. INT ClearItinerary(TError* aError)
Command parameters:
- TError aError - additional error information returned from application
Returns: 0 if successful, non-zero value otherwise.
Clears the itinerary.
2.41. INT NavigateToNextStopover(TError* aError)
Command parameters:
- TError aError - additional error information returned from application
Returns: 0 if successful, non-zero value otherwise.
Disable current leg and navigate to stopover of next leg.
2.42. INT AbortItineraryLeg(TError* aError)
Command parameters:
- TError aError - additional error information returned from application
Returns: 0 if successful, non-zero value otherwise.
Disable the current leg and clear the route.
2.43. INT GetCurrentStopover(TError* aError, TItineraryIndex* aIndex)
Command parameters:
- TError aError - additional error information returned from application
- TItineraryIndex aIndex - itinerary index structure to fill
Returns: 0 if successful, non-zero value otherwise.
Returns the index of the first active stopover.
2.44. INT UseGFFile(TError* aError, char* aFilename)
Command parameters:
- TError aError - additional error information returned from application
- char* aFilename - GF file to start using.
Returns: 0 if successful, non-zero value otherwise.
Loads and uses the GF file. The contents of this file are overlayed on the map. See the page on GF files for more information.
2.45. INT EnableGFRecord(TError* aError, int aUID, int aEnable)
Command parameters:
- TError aError - additional error information returned from application
- int aUID - record to disable or enable.
- int aEnable - zero to disable the record and non-zero to enable.
Returns: 0 if successful, non-zero value otherwise.
Enable or disable a record from the GF file. Only enabled records are shown on the map.
2.46. INT OpenInternetConnection(TError* aError)
Command parameters:
- TError aError - additional error information returned from application
Returns: 0 if successful, non-zero value otherwise.
Open an internet connection, using a phone connected with bluetooth. Use GetInternetConnectionStatus to monitor the current status of the connection.
2.47. INT CloseInternetConnection(TError* aError)
Command parameters:
- TError aError - additional error information returned from application
Returns: 0 if successful, non-zero value otherwise.
Close the internet connection.
2.48. INT GetInternetConnectionStatus(TError* aError, TInternetConnectionStatus* aStatus)
Command parameters:
Returns: 0 if successful, non-zero value otherwise.
Gets the status of the internet connection. The member iStat of the TInternetConnectionStatus struct can have the following values:
- 0 - Closed
- 1 - Opening
- 2 - Opened
- 3 - Closing
2.49. INT GetDeviceActivationId(TError* aError, TDeviceActivationId* aId, int aRemoveSpaces)
Command parameters:
- TError aError - additional error information returned from application
- TDeviceActivationId aId - Device activation id structure to fill
- int aRemoveSpaces - non-zero values will remove spaces from the resulting string.
Returns: 0 if successful, non-zero value otherwise.
Get the device id used for activation.
2.50. INT PlaySoundFile(TError* aError, char* aFilename, int aQueue)
Command parameters:
- TError aError - additional error information returned from application
- char* aFilename - Name of the soundfile to play.
- int aQueue - Non-zero to queue the sound, zero otherwise.
Returns: 0 if successful, non-zero value otherwise.
Play an .ogg soundfile. This can be done in queued or non-queued mode. The difference is that when another sound is already playing, queued mode will place to sound in a queue to be played when the currently playing sound is finished. Non-queued mode will return an error if another sound is already playing.
The .ogg files should be encoded at 16KHz mono. Tools to create .ogg files can be found at www.vorbis.com.
3. Asynchronous API calls
Every synchronous API call of the SDK has two asynchronous calls associated with it: one for sending the command to the navigation application and one for reading out the result.
The asynchronous call for sending the command to the navigation application is the same as the synchronous call with 'Async' appended to it. It returns a session and takes as its first argument aWantResult. Currently only 'true' is supported for aWantResult. The other arguments are the same as the input parameters of the synchronous call.
The call for reading the result is also the same, but with 'AsyncRetrieve' appended to it. It returns an integer and takes as its first argument the session object. The other arguments are the same as the output parameters of the synchronous call.
NavigateToFavorite: Synchronous API call
INT NavigateToFavorite(TError* aError, long aFavNum) |
NavigateToFavoriteAsync: Asynchronous API call:
MTomTomSession* NavigateToFavoriteAsync(int aWantResult , int aFavorite); |
NavigateToFavoriteAsyncRetrieve: Asynchronous API call to read out result
INT NavigateToFavoriteAsyncRetrieve(MTomTomSession* aSession, TError aError ); |
More information on asynchronous calls can be found at:
4. Structures and enumerations from the API
4.1. TVersion structure
The structure TVersion has the following fields:
- char iVersion[16];
- int iBuildNumber;
4.2. TError structure
4.3. TDataSetInfo structure
The structure TDataSetInfo has the following fields:
- char iDataSetName[128], name of the data set
- char iDataSetPath[128], path to the data set
- int iFlags, flags property of the data set
- int iBuildNumber, buildnumber of the data set
The data set flags property can contain the following flags:
- 1 - indicates that the house numbers are written before the street name in addresses. This can be set by a user from the Name Preferences menu
- 2 - indicates left-sided driving
4.4. TLocationInfo structure
The structure TLocationInfo has the following fields:
- long iLongitude, longitude in 100000ths of a degree (WGS84 format)
- long iLatitude, latitude in 100000ths of a degree (WGS84 format)
- ELocDataType iLocType, location type
- char iStreetName[128], the street name of the given location
- int iHouseNr1, the first housenumber closest to the given location
- int iHouseNr2, the second housenumber closest to the given location
4.5. TLocationInfoEx structure
The structure TLocationInfoEx has the following fields:
- long iLongitude, longitude in 100000ths of a degree (WGS84 format)
- long iLatitude, latitude in 100000ths of a degree (WGS84 format)
- ELocDataType iLocType , location type
- char iStreetName[128], the street name of the given location
- int iHouseNr1, the first housenumber closest to the given location
- int iHouseNr2, the second housenumber closest to the given location
- char iCityName[128], the city name of the given location
4.6. ELocDataType enumeration
The enumeration ELocDataType has the following enumerators:
- KMapPosition = 0 , the location is a position on the map
- KNode = 1 , the location is a single node (e.g. city center or a position selected on a map)
- KCrossing = 2 , the location is a crossing
- KStreetPos = 3 , the location is somewhere on a street
- KStreet = 4 , the location is a street
4.7. TRouteInfo structure
The structure TRouteInfo has the following fields:
- int iStatus, validity of the rest of the fields, as explained below
- TLocation iDeparture, startpoint co-ordinates in 100000ths of a degree (WGS84 format)
- TLocation iDestination, endpoint co-ordinates in 100000ths of a degree (WGS84 format)
- long iEnclosingLongitudeW, rectangle enclosing the route (co-ordinates in 100000ths of a degree, WGS84 format)
- long iEnclosingLatitudeS;
- long iEnclosingLongitudeE;
- long iEnclosingLatitudeN;
- long iLength, length of the route in meters
- long iDuration, duration of the route in seconds
- long iDistanceToDestination, distance from current position to destination in meters
- long iTimeToDestination, time from current position to destination in seconds
The iStatus field can contain the following flags:
- KDepartureSet - the departure point has been set
- KDestinationSet - the destination point has been set
- KCalculatingRoute - in the process of calculating a route
- KRoutePlanned - there is a valid route planned
- KLeftToDestinationAvailable - time and distance to destination are available
If GetRouteInfo has never been called, RouteStatus will be 0, indicating that the rest of these properties don't contain valid information.
and where TLocation is defined is by:
4.8. TLocation structure
- long iLongitude;
- long iLatitude;
4.9. TDeviceId structure
The structure TDeviceId has the following fields:
- char iDeviceId[32], the ID of the device
- int iDeviceIdLength;
4.10. TCurrentPositionInfo structure
The structure TCurrentPositionInfo has the following fields:
- EGpsStatus iStatus, specifies if the information in this record is recent or not.
- long iLongitude, longitude in 100000ths of a degree (WGS84 format)
- long iLatitude, latitude in 100000ths of a degree (WGS84 format)
- long iSpeedKMh, current driving speed in kilometers per hour
- long iDirection, direction in degrees: zero is north, continuing in clockwise direction
4.11. TGeocodeResult structure
The structure TGeocodeResult has the following fields:
- long iLongitude, longitude in 100000ths of a degree (WGS84 format)
- long iLatitude, latitude in 100000ths of a degree (WGS84 format)
- int iReturnStatus, status field as explained below
- char iCityName[128], complete city name
- char iStreetName[128], complete street name
The iReturnStatus field can contain the following flags:
- KGeocodeFailure = 8 - no location found at all, the rest of the fields are invalid
- KGeocodeCityAmbiguous = 4 - the given city name was ambiguous, random (possibly wrong) selection made
- KGeocodeStreetAmbiguous = 2 - the given street name was ambiguous, tried to make smart selection
- KGeocodeHouseNrIgnored = 1 - the house number was ignored, either because there was no house number data available or because the given house number was not found
4.12. TFavoriteInfo structure
The structure TFavoriteInfo has the following fields:
- char iName[64], name of the favourite
- char iDescription[128], description of the favourite
- long iLongitude, longitude in 100000ths of a degree (WGS84 format)
- long iLatitude, latitude in 100000ths of a degree (WGS84 format)
4.13. TRouteCoordinates structure
The structure TRouteCoordinates has the following fields:
- int iNrCoordinates, number of coordinates of the route
- TLocation* iCoordinates, location information on the node. The user is responsible
for freeing the returned array upon a successful call to GetRouteCoordinate.
4.14. TItineraryIndex structure
The structure TItineraryIndex has the following field:
- int iIndex, index in the itinerary
4.15. TInternetConnectionStatus structure
The structure TInternetConnectionStatus has the following field:
- int iStatus, status of the internet connection
iStat can have the following values:
- 0 - Closed
- 1 - Opening
- 2 - Opened
- 3 - Closing
4.16. TDeviceActivationId structure
The structure TDeviceActivationId has the following field:
- char iId[64], Device activation id as zero terminated string.
4.17. ESettingAndValue enumeration
The enumeration ESettingAndValue has the following enumerators:
- KCommandSoundOn = 0 , turn sound on
- KCommandSoundOff = 1 , turn sound off
- KCommandNightColors = 2 , use night colours
- KCommandDayColors = 3 , use day colours
- KCommandShowMap = 4 , turn on map display
- KCommandHideMap = 5 , turn off map display
4.18. EProperty enumeration
The enumeration EProperty has the following enumerators:
- KPropertyColorStyle = 0 , the colour style used in daylight mode
- KPropertyNightColorStyle = 1 , the colour style used in night mode
- KPropertyVoiceVolume = 2 , the volume of the voice prompts
- KPropertySafetySpeed = 3 , the threshold speed above which no map is displayed
where valid values for each property are:
KPropertyVoiceVolume : 10-100;
KPropertySafetySpeed : 0-500;
KPropertyColorStyle and KPropertyNightColorStyle:
- const int KColorStyleBelgica=1027 ;
- const int KColorStyleBrittanica=1028 ;
- const int KColorStyleGermanica=1029 ;
- const int KColorStyleAustralia=1030 ;
- const int KColorStyleDeuteranopia=1031 ;
- const int KColorStyleGreys=1032 ;
- const int KColorStyleAmerica=1033 ;
- const int KColorStyleAstra=1034 ;
- const int KColorStyleAfrica=1035 ;
- const int KColorStyleAntarctica=1036 ;
- const int KColorStyleTraffic=1037 ;
- const int KColorStyleCustom=1100 ;
4.19. EGpsStatus enumeration
The enumeration EGpsStatus has the following enumerators: Status specifies if the information in this record is recent or not. Status<0 means some error occurred (-1 is general), Status>=0 means the data is valid.
Currently allowed values are:
- KGpsStatusGeneral = 0 ,
- KGpsStatusReceiving = 1 ,
4.20. EPoiTypeCode enumeration
The enumeration EPoiTypeCode has the following enumerators:
- KPoiTypeGovernmentOffice = 0 ,
- KPoiTypeMountainPeak = 1 ,
- KPoiTypeOpenParking = 2 ,
- KPoiTypeParkingGarage = 3 ,
- KPoiTypePetrolStation = 4 ,
- KPoiTypeRailwayStation = 5 ,
- KPoiTypeRestArea = 6 ,
- KPoiTypeAirport = 7 ,
- KPoiTypeCarDealer = 8 ,
- KPoiTypeCasino = 9 ,
- KPoiTypeChurch = 10 ,
- KPoiTypeCinema = 11 ,
- KPoiTypeCityCenter = 12 ,
- KPoiTypeCompany = 13 ,
- KPoiTypeConcertHall = 14 ,
- KPoiTypeCourthouse = 15 ,
- KPoiTypeCulturalCenter = 16 ,
- KPoiTypeExhibitionCenter = 17 ,
- KPoiTypeFerryTerminal = 18 ,
- KPoiTypeFrontierCrossing = 19 ,
- KPoiTypeGolfCourse = 20 ,
- KPoiTypeHospitalPolyclinic = 21 ,
- KPoiTypeHotelMotel = 22 ,
- KPoiTypeTouristAttraction = 23 ,
- KPoiTypeMountainPass = 24 ,
- KPoiTypeMuseum = 25 ,
- KPoiTypeOpera = 26 ,
- KPoiTypePlaceofWorship = 27 ,
- KPoiTypePostOffice = 28 ,
- KPoiTypeRentCarFacility = 29 ,
- KPoiTypeRentCarParking = 30 ,
- KPoiTypeRestaurant = 31 ,
- KPoiTypeShop = 32 ,
- KPoiTypeShoppingCenter = 33 ,
- KPoiTypeStadium = 34 ,
- KPoiTypeTheatre = 35 ,
- KPoiTypeTouristInformationOffice = 36 ,
- KPoiTypeZoo = 37 ,
- KPoiTypeSportsCentre = 38 ,
- KPoiTypePoliceStation = 39 ,
- KPoiTypeEmbassy = 40 ,
- KPoiTypeCollegeUniversity = 41 ,
- KPoiTypeCashDispenser = 42 ,
- KPoiTypeBeach = 43 ,
- KPoiTypeIceSkatingRing = 44 ,
- KPoiTypeTennisCourt = 45 ,
- KPoiTypeWaterSport = 46 ,
- KPoiTypeDoctor = 47 ,
- KPoiTypeDentist = 48 ,
- KPoiTypeVeterinarian = 49 ,
- KPoiTypeNightlife = 50 ,
- KPoiTypeAmusementPark = 51 ,
- KPoiTypeLibrary = 52 ,
- KPoiTypeCarRepairFacility = 53 ,
- KPoiTypePharmacy = 54 ,
- KPoiTypeScenicPanoramicView = 55 ,
- KPoiTypeSwimmingPool = 56 ,
- KPoiTypeWinery = 57 ,
- KPoiTypeCampingGround = 58 ,
- KPoiTypeParkRecreationArea = 59 ,
- KPoiTypeConventionCentre = 60 ,
- KPoiTypeLeisureCentre = 61 ,
- KPoiTypeYachtBasin = 62 ,
5. Error codes
The following error codes are currently defined in TomTom API:
- KErrSDKNone = 0
- KErrSDKNoSession = -1
- KErrSDKNoResponse = -2
- KErrSDKNoMethod = -3
- KErrSDKBadParams = -4
- KErrSDKMethodFailed = -5
- KErrSDKEngineBusy = -6
- KErrSDKNoMapOpen = -7
- KErrSDKNoPostalCodes = -8
- KErrSDKUnknownError = -100
Note that these are the error codes returned from the navigation application as stored in TError. The API calls themselves return a subset of the above:
- KErrSDKNone - if the response for a given request has been received;
- KErrSDKNoSession - if the client session could not be created;
- KErrSDKNoResponse - if the response was never received or did not have a valid format.
- KErrSDKNoResponse - if the response was never received or did not have a valid format.