Camera and SerialGPS objects
For the Camera object, the ConfigParams property is intended to be used to customize the behavior of the object. It is currently undefined.
For the SerialGPS object, the ConfigParams property consists of four comma-separated keyword value pairs. The following table describes these keyword value pairs:
Keyword value pair |
Description |
---|---|
BufferSize=nnnn |
Number of bytes in the read buffer. A buffer size of 1500 to 2500 bytes is recommended. |
Refresh=nnnn |
Number of milliseconds before forcing a new read request. A 2000 byte buffer might contain 25 or more GPS sentences. If the user issues GetFix or GetHeading requests inside a loop, the parser works with the current data buffer until the refresh interval has expired, or until the end of the buffer is reached . When either of these conditions are met, a new data buffer is read from the serial port. |
Timeout=nnnn |
PocketBuilder terminates a read request when the timeout limit is exceeded, preventing your program from hanging indefinitely. Currently, this technique has only been tested on Windows XP and CE 2003 operating systems. As an additional precaution, the user can also set Multithread=1 to run the read request on a secondary thread. The timeout interval is specified in milliseconds and a -14 Read Timeout error is generated if it is exceeded. |
Multithread=n (where n = 0 or 1) |
The default behavior (Multithread=0) is to use SetCommTimeouts to set a timeout interval for the serial port. A less efficient, but reliable alternate technique is to run each read request on a secondary thread and terminate the thread when the timeout interval is exceeded (Multithread=1). This should be considered only if the user’s operating system does not reliably support SetCommTimeouts. |
For the GPS base class, the ConfigParams property is used to specify a string literal containing NMEA raw data sentences. You can store this data in a database, in the Registry, or in an ANSI text file.
Type the value in the ConfigParams box on the General page of the object’s Properties view.
The ConfigParams property takes a string value.
The following is an example for the serialGPS object:
Integer li_rc
GPSFix myFix
gps_1.SerialPort = "COM5:" //override default com8 port
gps_1.ConfigParams = "buffersize=2000,refresh=2000,"& + "timeout=5000,multithread=0"
li_rc = gps_1.Open()
IF li_rc = 1 THEN
li_rc = gps_1.GetFix(myFix)
//process data
ELSE //process error msg
END IF
The following is an example for the GPS base class object:
string lsBillaricay
GPS myGps
GPSFix myFix
Integer rc
lsBillaricay="$GPGGA,162443.559,5138.3437,”+ &
“N,00025.3591,E,1,05,2.3,127.5,M,,,,0000*00~r~n"
myGps = create GPS
myGps.ConfigParams = lsBillaricay
rc = myGps.Open()
rc = myGps.GetFix(myFix)
rc = myGps.Close()
Copyright © 2004. Sybase Inc. All rights reserved. |
![]() |