Listing 1: Connect and read

//Detect COM8
il_hCon = CreateFile("COM8:", ll_tmp, 3, 0, 3, 0, 0);

//Read from COM8
lb_rc = ReadFile( il_hcon, lblb_read, len(lblb_read), ll_read, Long(0) )

//Convert to Unicode
is_read = FromAnsi(lblb_read)

//Close BT Connection
CloseHandle( il_hcon )

//External functions
function long CreateFile(STRING lpFileName, &
UNSIGNEDLONG dwDesiredAccess, &
LONG dwShareMode, &
LONG lpSecurityAttributes, &
LONG dwCreationDisposition, &
LONG dwFlagsAndAttributes, &
LONG hTemplateFile) &
LIBRARY "coredll.dll" &
ALIAS FOR "CreateFileW"

function Boolean ReadFile( LONG handle, &
REF BLOB Buffer, &
LONG numBytesToRead, &
REF LONG NumBytesRead, &
LONG LNull ) &
LIBRARY "coredll.dll" &
ALIAS FOR "ReadFile"

function Boolean CloseHandle( LONG handle ) &
LIBRARY "coredll.dll" &
ALIAS FOR "CloseHandle"

Listing 2: Example GGA sentence for the Sybase offices in Concord, MA

$GPGGA,135403.607,4228.0931,N,07118.2523,W,1,06,1.7,28.2,M,-
33.6,M,0.0,0000*7C

GGA Global Positioning System Fix Data
135403.607 Fix taken at 13:54:03 UTC
4228.0931,N Latitude 42 deg 28.0931' N
07118.2523,W Longitude 71 deg 18.2523' W
1 Fix quality: 0 = invalid, 1 = GPS fix (SPS)
06 Number of satellites being tracked
1.7 Horizontal dilution of position
28.2,M Altitude, Meters, above mean sea level
-33.6,M Height of geoid (mean sea level) above
WGS84 ellipsoid
(Empty field) Time in seconds since last DGPS update
(Empty field) DGPS station ID number
*7C Checksum data (always begins with *)

Listing 3

IF li_row > 0 THEN
lstr_data.altitude = ds_parse.GetItemString(li_row, 10)
lstr_data.altitude_units = ds_parse.GetItemString(li_row, 11)
lstr_data.fix = ds_parse.GetItemString(li_row, 7)
lstr_data.fix_utc_time = ds_parse.GetItemString(li_row, 2)
lstr_data.latitude = ds_parse.GetItemString(li_row, 3)
lstr_data.latitue_dir = ds_parse.GetItemString(li_row, 4)
lstr_data.longitude = ds_parse.GetItemString(li_row, 5)
lstr_data.longitude_dir = ds_parse.GetItemString
(li_row, 6)
lstr_data.satellites = ds_parse.GetItemString(li_row, 8)
END IF

Listing 4: HP SDIO Camera SDK

BOOL SDIOCamVersion(HANDLE hCom, TCHAR *DriverVersion)
BOOL SDIOCamData(HANDLE hCom, Imagecolor &imgclr,
UCHAR *ScreenBufShow, DWORD &ll)
BOOL SDIOCamInit(HANDLE hCom, HWND &Mainhwnd )
BOOL SDIOCamLastImage(HANDLE hCom, int previewmode,
UCHAR *ScreenBufInstantShow,
DWORD &dwPrivewInstantLength);
BOOL SDIOCamSnapShot(HANDLE hCom, TSNAPINFO &snapshotinfo)
BOOL SDIOCamPreviewStart(HANDLE hCom, HWND &hwVideo, int prvmode)
BOOL SDIOCamPreviewStop(HANDLE hCom)
BOOL SDIOCamPowerOff(HANDLE hCom)
BOOL SDIOCamSetting(HANDLE hCom,_PARAMETERINFO ¶info)
SDIOCamPreviewInit( void )
BOOL SDIOCamDeCode( int AviResolution, UCHAR *inBuf, UCHAR *outBuf, ULONG
dataLenLeft)

Listing 5: Pocket PowerBuilder Interface DLL

public FUNCTION int CAM_Init(string port, long hwndMain) &
LIBRARY "PKHP_CamIF.dll" ALIAS FOR "PPB_HPCam_Init"
public FUNCTION int CAM_Term() &
LIBRARY "PKHP_CamIF.dll" ALIAS FOR "PPB_HPCam_Terminate"
public FUNCTION int CAM_DeviceHandle() &
LIBRARY "PKHP_CamIF.dll" ALIAS FOR "PPB_HPCam_DeviceHandle"
public FUNCTION int CAM_Version(REF string API, REF string Driver) &
LIBRARY "PKHP_CamIF.dll" ALIAS FOR "PPB_HPCam_Version"
public FUNCTION int CAM_Settings( int iWhiteBalance, &
int iColorOfPicture, int iCompression, int iAeMetering ) &
LIBRARY "PKHP_CamIF.dll" ALIAS FOR "PPB_HPCam_Settings"
public FUNCTION int CAM_StartPreview(long hwndPreview, int iMode) &
LIBRARY "PKHP_CamIF.dll" ALIAS FOR "PPB_HPCam_StartPreview"
public FUNCTION int CAM_StopPreview() &
LIBRARY "PKHP_CamIF.dll" ALIAS FOR "PPB_HPCam_StopPreview"
public FUNCTION int CAM_PausePreview() &
LIBRARY "PKHP_CamIF.dll" ALIAS FOR "PPB_HPCam_PausePreview"
public FUNCTION int CAM_ResumePreview(int iMode) &
LIBRARY "PKHP_CamIF.dll" ALIAS FOR "PPB_HPCam_ResumePreview"
public FUNCTION int CAM_SnapPicture(string FileName, int Resolution, int
Compression) &
LIBRARY "PKHP_CamIF.dll" ALIAS FOR "PPB_HPCam_TakePictureToFile"