GPS4Palm

Source Code Documentation


GPS.c File Reference

#include <PalmOS.h>
#include <PalmCompatibility.h>
#include <Extensions/ExpansionMgr/VFSMgr.h>
#include <SerialMgrOld.h>
#include "GPS.h"
#include "Data.h"
#include "ResourceDefines.h"
#include "MathLib.h"
#include "gpslib.h"
#include "HandleMessage.h"
#include "MainForm.h"
#include "PortForm.h"
#include "SkyviewForm.h"
#include "NavigationForm.h"
#include "FileselForm.h"
#include "MiscOptsForm.h"
#include "MapOptsForm.h"
#include "WaypointForm.h"
#include "WayptEditForm.h"
#include "RouteForm.h"
#include "RouteEditForm.h"
#include "TrackForm.h"
#include "AboutForm.h"
#include "ApproachForm.h"
#include "DebugForm.h"
#include "MapForm.h"
#include "Utils.h"
#include "Serial.h"
#include "geo.h"
#include "utm.h"
#include "common.h"

Include dependency graph for GPS.c:

Go to the source code of this file.

Defines

#define kOS20MinVersion   0x02003000
 Minimum Version for 2.0 Capabilities.
#define kMinimumVersion   0x03000000
 Minimum PalmOS Version.
#define kOS35MinVersion   0x03503000
 Minimum Version for 3.5 New Feature Set.
#define GpsLibName   "gpslib"

Functions

Boolean ReadFromGPS (void)
 Reads data from GPS receiver.
UInt32 PilotMain (UInt16 cmd, MemPtr cmdPBP, UInt16 launchFlags)
 Application Entry Function.

Variables

UInt32 gLastSuccessfulReception = 0
 tickCount of last time we read data from GPS
UInt32 gLastTimeDisplay = 0
 tickCount of last time we displayed GPS data on the Palm device
UInt32 gNextReadTime = 0
 tickCount of the next scheduled read
Boolean gFormOpened = false
 Global flag.
Boolean gVfsManagerFtr
 VFS Feature Set available.
Boolean gFtrSet35
 OS 3.5 Feature Set available.
Boolean gHdFtrSet
 High-Density Display Feature Set available.
Boolean gFiveWayAvail
 FiveWay Controller available.
GPSType gGPSData
PrefsType gPrefs
 Preferences data structure.
UInt32 gSerialPort
 four-character port name or logical port number (New Serial Manager)
Char ** gProfiles
 List of Connection Manager Profiles.
UInt16 gNumProfiles
 Number of Connection Manager Profiles.
UInt16 gTicksPerSecond
 Ticks per second (OS/Hardware specific).
UInt32 gMaxTicksWithoutTime
 if we go this long without updating the time then update as soon as we get a valid time (without waiting for an even 5-second time)
UInt32 gTicksToLoseGPS
 if we go this long without communicating with GPS, we've lost it and need to notify the user


Define Documentation

#define GpsLibName   "gpslib"
 

Definition at line 224 of file GPS.c.

#define kMinimumVersion   0x03000000
 

Minimum PalmOS Version.

Definition at line 219 of file GPS.c.

Referenced by PilotMain().

#define kOS20MinVersion   0x02003000
 

Minimum Version for 2.0 Capabilities.

Definition at line 216 of file GPS.c.

#define kOS35MinVersion   0x03503000
 

Minimum Version for 3.5 New Feature Set.

Definition at line 222 of file GPS.c.


Function Documentation

UInt32 PilotMain UInt16  cmd,
MemPtr  cmdPBP,
UInt16  launchFlags
 

Application Entry Function.

Parameters:
cmd Launch Code
cmdPBP Command Parameter Block Pointer
launchFlags Launch Flags (set by OS)
Returns:
always 0

Definition at line 1135 of file GPS.c.

References kMinimumVersion, and RomVersionCompatible().

Boolean ReadFromGPS void   ) 
 

Reads data from GPS receiver.

If no messages are received for a certain time, a warning is generated. A large block of data is read from the serial buffer in one go. Then the data is parsed. Only complete messages (starting with $GP and ending with checksum) and valid checksum are passed to the message handler function.

Returns:
Flag which shows if message has been handled successfully. (TBD: all msgs, first msg, ???)

Definition at line 855 of file GPS.c.

References exp(), HandleMessage(), and nibble2hex().

Referenced by ApproachFormHandleEvent(), DebugFormHandleEvent(), MainFormHandleEvent(), MapFormHandleEvent(), NavigationFormHandleEvent(), SkyviewFormHandleEvent(), and WayptEditFormHandleEvent().


Variable Documentation

Boolean gFiveWayAvail
 

FiveWay Controller available.

Definition at line 272 of file GPS.c.

Referenced by MapFormHandleEvent().

Boolean gFormOpened = false
 

Global flag.

Definition at line 260 of file GPS.c.

Boolean gFtrSet35
 

OS 3.5 Feature Set available.

Definition at line 266 of file GPS.c.

GPSType gGPSData
 

Definition at line 129 of file HandleMessage.c.

Boolean gHdFtrSet
 

High-Density Display Feature Set available.

Definition at line 269 of file GPS.c.

UInt32 gLastSuccessfulReception = 0
 

tickCount of last time we read data from GPS

Definition at line 235 of file GPS.c.

Referenced by HandleMessage().

UInt32 gLastTimeDisplay = 0
 

tickCount of last time we displayed GPS data on the Palm device

Definition at line 238 of file GPS.c.

Referenced by HandleMessage().

UInt32 gMaxTicksWithoutTime
 

if we go this long without updating the time then update as soon as we get a valid time (without waiting for an even 5-second time)

Definition at line 301 of file GPS.c.

Referenced by HandleMessage().

UInt32 gNextReadTime = 0
 

tickCount of the next scheduled read

Definition at line 241 of file GPS.c.

Referenced by HandleMessage().

UInt16 gNumProfiles
 

Number of Connection Manager Profiles.

Definition at line 63 of file Serial.c.

Referenced by FreeCncProfileList(), and PortFormHandleEvent().

PrefsType gPrefs
 

Preferences data structure.

Definition at line 279 of file GPS.c.

Char** gProfiles
 

List of Connection Manager Profiles.

Definition at line 60 of file Serial.c.

Referenced by FreeCncProfileList(), and PortFormHandleEvent().

UInt32 gSerialPort
 

four-character port name or logical port number (New Serial Manager)

Definition at line 57 of file Serial.c.

Referenced by PortFormHandleEvent().

UInt16 gTicksPerSecond
 

Ticks per second (OS/Hardware specific).

Definition at line 294 of file GPS.c.

Referenced by HandleMessage().

UInt32 gTicksToLoseGPS
 

if we go this long without communicating with GPS, we've lost it and need to notify the user

Definition at line 307 of file GPS.c.

Boolean gVfsManagerFtr
 

VFS Feature Set available.

Definition at line 263 of file GPS.c.


Created: Mon, 08 Oct 2007 22:33:16 +0200
Copyright ©2004 M. Prinke