OziExplorerCE API

The OziExplorerCE API provides an interface which can be used to control the OziExplorerCE software.

All functions in the API only work with OziExplorerCE version 1.11.0 or later.

The API uses a combination of Windows Messaging and Files to send commands and data to OziExplorerCE.

At this stage the API is mostly for displaying positions with a specified symbol, very useful for displaying the positions of other vehicles (AVL).

An example program for the PocketPC 2002 written in Embedded Visual Basic is available for download.

Download the Example Program

The method to use the API is as follows.

  1. Check that OziExplorerCE is running
  2. Write the data to a file with the correct name
  3. Send a message to OziExplorer with the correct command number to do the Command

The documentation below is not yet complete, it is expected that you will refer to the example program

Command Number Command


AVL Vehicles

Allows the creation of many "vehicles" (just symbols really) using specified symbols and display them on the map.

The symbol must be located in the Symbols folder of OziExplorerCE
 


101


Create a New AVL Vehicle and display it on the map.

The maximum number of vehicles that can be created is 250.

Write the data to a file called avldata.$$$ and send a message to OziExplorerCE

Example code

vName = "Vehicle 1"
vLat = 41.056
vLon = -124.14
vDesc = "Vehicle 1 Description"
vSymbol = "avl1.bmp"

' write the data to this file
' folder must be folder where OziCE is installed
File1.Open "\OziExplorer\avldata.$$$", fsModeOutput
File1.LinePrint vName
File1.LinePrint vLat
File1.LinePrint vLon
File1.LinePrint vDesc
File1.LinePrint vSymbol
File1.Close

' this sends the message to OziCE
Result = SendMessage(OziWindow, WM_USER + 5, Me.hwnd, 101)
 

102

Delete an AVL Vehicle

Example code

 vName = "Vehicle 2"

' write the data to this file
' folder must be folder where OziCE is installed
File1.Open "\OziExplorer\avldata.$$$", fsModeOutput
File1.LinePrint vName
File1.Close

' this sends the message to OziCE
Result = SendMessage(OziWindow, WM_USER + 5, Me.hwnd, 102)
 

103

Clear all AVL Vehicles

Example code

 ' this sends the message to OziCE
Result = SendMessage(OziWindow, WM_USER + 5, Me.hwnd, 103)
 


Other
 
110

Center the map on this position - useful for having the map center on an AVL vehicle

Write the data to a file called apidata1.$$$ and send a message to OziExplorerCE

Example code

' now track it on screen
' write the data to this file
' NOTE different file name
' folder must be folder where OziCE is installed
File1.Open "\OziExplorer\apidata1.$$$", fsModeOutput
File1.LinePrint lat 'from globals
File1.LinePrint lon 'from globals
File1.Close

Result = SendMessage(OziWindow, WM_USER + 5, Me.hwnd, 110)
 

136

Find best map and center the map on this position - useful for having the map center on an AVL vehicle

If tracking the gps you will also need to call the "Disable GPS Tracking" command otherwise the map will return to the GPS location.

Write the data to a file called apidata1.$$$ and send a message to OziExplorerCE

Example code

' now track it on screen
' write the data to this file
' NOTE different file name
' folder must be folder where OziCE is installed
File1.Open "\OziExplorer\apidata1.$$$", fsModeOutput
File1.LinePrint lat 'from globals
File1.LinePrint lon 'from globals
File1.Close

Result = SendMessage(OziWindow, WM_USER + 5, Me.hwnd, 136)

 

120

Have OziExplorerCE return its GPS position when processing moving map.

The position is returned in a file called apidata2.$$$

Example code

 ' OziCE found
' this sends the message to OziCE
Result = SendMessage(OziWindow, WM_USER + 5, Me.hwnd, 120)

' read the data from this file
' folder must be folder where OziCE is installed
File1.Open "\OziExplorer\apidata2.$$$", fsModeInput
slat = File1.LineInputString
slon = File1.LineInputString
File1.Close

Text1.Text = slat
Text2.Text = slon

' lat, lon is returned in WGS 84 datum
' -777 is returned if OziCE is not tracking
 

130

Start Serial Communications (normal moving map with GPS connected to the serial port).

Example code

 ' this sends the message to OziCE
Result = SendMessage(OziWindow, WM_USER + 5, Me.hwnd, 130)

If a start command (130 or 131) has already been called always use the stop command before calling another start command.
 

131

Start NMEA API (nmea sentences send to OziCE using the OziCE API).

Example code

 ' this sends the message to OziCE
Result = SendMessage(OziWindow, WM_USER + 5, Me.hwnd, 131)

If a start command (130 or 131) has already been called always use the stop command before calling another start command.
 

132

Stop Serial Communication or API nmea

The same command is used to stop both Serial moving map and API moving map

Example code

 ' this sends the message to OziCE
Result = SendMessage(OziWindow, WM_USER + 5, Me.hwnd, 132)
 

133

Send NMEA sentence to OziCE using the OziCE API.

The NMEA string is sent in the apidata1.$$$ file

Any type of NMEA string can be sent - example you could send the GPRMC sentence for position, speed and bearing and also the GPGGA string for OziCE to get the altitude.

Only 1 string can be sent in the file at a time.

 ' This is the procedure fro using the API to send NMEA strings to OziCE
' Start the NMEA API (API command 131)
' Send the NMEA string (API command 133)
' . send another string
' . send another string
' . send another string
' Stop the NMEA API when finished tracking (API command 132)

' =======================================
' you would be reading this string from the gps or creating it dynamically
' from positions obtained from other sources and sending it to OziCE

Nmea1 = "$GPRMC,111111,A,4103.305,N,12409.015,W,0.0000,0.0,111111,16.5,E*6C"

' send NMEA string
' write the data to this file
' folder must be folder where OziCE is installed
File1.Open "\OziExplorer\apidata1.$$$", fsModeOutput
File1.LinePrint Nmea1
File1.Close

Result = SendMessage(OziWindow, WM_USER + 5, Me.hwnd, 133)
 

134

Enable GPS Tracking

Example code

 ' this sends the message to OziCE
Result = SendMessage(OziWindow, WM_USER + 5, Me.hwnd, 134)
 

135

Disable GPS Tracking

Example code

 ' this sends the message to OziCE
Result = SendMessage(OziWindow, WM_USER + 5, Me.hwnd, 135)

 

150

Start Route Navigation Forward

Example code

 ' this sends the message to OziCE
Result = SendMessage(OziWindow, WM_USER + 5, Me.hwnd, 150)

 

151

Start Route Navigation Reverse

Example code

 ' this sends the message to OziCE
Result = SendMessage(OziWindow, WM_USER + 5, Me.hwnd, 151)

 

152

Stop Route Navigation

Example code

 ' this sends the message to OziCE
Result = SendMessage(OziWindow, WM_USER + 5, Me.hwnd, 152)

 

153

Load Route File

Write the route file name (with full path) into a file called apidata1.$$$ and send a message to OziExplorerCE

Example code

' now track it on screen
' write the data to this file
' NOTE different file name
' folder must be folder where OziCE is installed
File1.Open "\OziExplorer\apidata1.$$$", fsModeOutput
File1.LinePrint RouteFileName    'from globals
File1.Close

Result = SendMessage(OziWindow, WM_USER + 5, Me.hwnd, 153)

 

Extras

If you place a file called  wpl2avl.dat    (WPL2AVL.DAT)  in the folder where the OziExplorerCE.exe file is installed the OziExplorerCE will automatically process any $GPWPL nmea messages and create an AVL Vehicle at the position using the "avl1.bmp" symbol.

To use this feature there is no need to use the API, OziExplorerCE automatically processes the $GPWPL messages itself.


[ Home ] [ OziExplorer ] [ OziExplorerCE ] [ OziExplorer3D ] [ Maps ] [ Utilities ] [ Support ] [ Links ] [ Future Changes ] [ Information ] [ Australian Page ] [ Site Map ]