Browse
(440) 299-7778
Menu
(440) 299-7778
One-year parts and labor warranty30-day money-back guaranteeEnglishEspañolContact

The text of a manual · part 13 of 17

Apex III / Apex IV Technical Reference Manual, Second Edition, pages 121 to 130

Pages 121 to 130 of 168

The original document is the PDF (1.2 MB). This is its text as extracted, unedited; tables and drawings read best in the PDF, and each page heading opens it at that page.

For the Compsee Apex III and Compsee Apex IV

Page 121

Apex PDT Technical Reference Manual

7 Apex Programming Resource

ScrnSave Syntax:

int ScrnSave(int *destin)

Input: Returns: Notes:

Pointer to buffer. 0 on error, non-zero on success. Copies the viewable area of the text mode screen to memory. The memory space required to save the screen is: bytes = (h rows ) × (w columns) × 2 where h and w are the number of rows and columns of the current screen mode.

ScrnRecall Syntax:

int ScrnRecall(int *source)

Input: Returns: Notes:

Pointer to buffer. 0 on error, non-zero on success. Copies text from memory to the viewable area of the text mode screen.

GetText Syntax:

int GetText(int left, int top, int right, int bottom, int *destin)

Input: Returns:

Screen coordinates and pointer to buffer. 1 on success, 0 on error. Stores the contents of an onscreen rectangle defined by (left, top) and (right, bottom) into the area of memory *destin. GetText() reads the rectangle's contents into memory from left to right and top to bottom. All coordinates are absolute coordinates, not window relative. The upper left corner is (1, 1). Each position onscreen takes 2 bytes of memory. The space required for a rectangle w columns wide by h rows high is: bytes = (h rows) × (w columns) × 2.

Notes:

COAM30002

Rev. 2.00

8/13/02

7-13

Page 122

Apex PDT Technical Reference Manual

7 Apex Programming Resource

PutText Syntax:

int PutText(int left, int top, int right, int bottom, int *source)

Input: Returns: Notes:

Screen coordinates and pointer to buffer 1 on success, 0 on error. Writes the contents of the memory area *source to the onscreen rectangle defined by (left, top) and (right ,bottom). PutText() is a text-mode function performing direct video output. All coordinates are absolute screen coordinates, not window relative. The upper left corner coordinate is (1, 1).

GetVideoConfig Syntax:

void GetVideoConfig(struct video_info *vc)

Input: Returns: Notes:

Pointer to structure. None Retrieves information about the current video setup. Active video mode, number of screen columns, active page, and offset to next page placed in supplied structure. The video_info structure, declared in [a3lib.h], contains the following elements: int mode; // active video mode int cols; // number of screen columns int page; // active video page int pageoff; // offset to next video page

7-14

COAM30002

Rev. 2.00

8/13/02

Page 123

Apex PDT Technical Reference Manual

7 Apex Programming Resource

Power Management Functions ApmGetPwrStatus Syntax: Input: Returns: Notes:

int ApmGetPwrStatus(struct power *powerstatus) Pointer to structure. 0 on success, non-zero on error. Retrieves information about the current power status. Parameters returned in the power structure are as follows: unsigned char acline = AC Line Status = 00 off-line = 01 on-line = FFh unknown unsigned char battery = Battery status = 00 high = 01 low = 02 critical = 03 charging = FFh unknown unsigned char charge = remaining Battery Pack capacity = 0 to 100 (percentage of full charge) = FFh unknown unsigned char flags = Battery flag bit 0 = high bit 1 = low bit 2 = critical bit 3 = charging bit 4 = battery not present bit 7 = no system battery = FFh unknown

PowerOff Syntax:

void PowerOff(void)

Input: Returns: Notes:

None None Powers down the Apex PDT. Performs the equivalent of <FN> + <Power>. Upon subsequent depression of the <Power> key the Apex PDT will cold boot.

COAM30002

Rev. 2.00

8/13/02

7-15

Page 124

Apex PDT Technical Reference Manual

7 Apex Programming Resource

PowerLow Syntax:

void PowerLow(void)

Input: Returns: Notes:

None None Places the Apex PDT into a low power state.

Data Input Functions GetStringE Syntax: Input:

Returns

Notes:

7-16 int GetStringE(char far *s, int maxlen, int fieldlen, struct bcdparms *bcd, char options); s = a character buffer (array) for storing the data string and terminating NULL. maxlen = size of buffer including terminating NULL. fieldlen = the size of the data field. If maxlen is greater than fieldlen, the data will scroll within the display field. bcd = pointer to a structure containing the registered Bar Code Driver parameters. See [a3lib.h] for the bcdparms structure declaration. Options = the OR combination of the following bits (defined in [a3lib.h]). STR_SCANNER Enables data entry via the scanner STR_KEYBRD Enables data entry via the keyboard STR_TERMSCN Automatically terminates data entry following a scan. STR_CAPS Converts keyboard data to all caps. On error, returns: -1 if parameter error (fieldlen and maxlen must be > 0). -2 if Bar Code Driver NOT loaded. -3 if not enough memory to perform function. On success, returns the key that caused input to terminate. This return value is the same as the return value for Getkey() found in the Bar Code Driver library. Gets a string from the keyboard or scanner and echoes it to the screen. The string is echoed at the current cursor position using the current background and foreground colors.

COAM30002

Rev. 2.00

8/13/02

Page 125

Apex PDT Technical Reference Manual

7 Apex Programming Resource

GetStringE continued Notes cont.:

With the keyboard enabled (via STR_KEYBRD), any extended key, a carriage return, or a linefeed terminates data entry. An <ESCape> nulls the string and returns. Regardless of the options, this function always accepts <ENT> as a terminator. Data entry is terminated upon reaching maxlen. A NULL byte is appended to s to mark the end of the string. This function should not be used when scanning symbols with an embedded NULL character. The Bar Code Driver must be loaded and the application program must link into the Bar Code Driver library. The calling program must register an external buffer with the Bar Code Driver using BcApiRegisterBuffer() prior to using GetStringE(). See p. 6-14. This function always returns with the <SCAN> key disabled.

ShowField Syntax: Input:

Returns: Notes:

void ShowField(int len, short row, short col) len = number of spaces row, col = The display point. The text position given by the coordinates (1, 1) is defined as the upper-left corner of the text window. None Prints len number of spaces using the current foreground and background colors at the specified cursor location. On completion, the cursor is positioned at row, col.

GetchLP Syntax:

int GetchLP(void)

Input: Returns: Notes:

None The character read from the keyboard. Gets a single character from the keyboard without echoing to the screen. Places the Apex PDT in a low power state while waiting on input. This function is a low power version of the standard function getch().

COAM30002

Rev. 2.00

8/13/02

7-17

Page 126

Apex PDT Technical Reference Manual

7 Apex Programming Resource

Post Scan Processing Functions ToEan13 Syntax: Input: Returns: Notes:

int ToEan13(char far *string, unsigned far *decodedCount, int far *codetype) Pointers to NULL terminated UPC-A string, decoded count and code type. 0 on success, non-zero on failure. Converts a UPC-A string to an EAN-13 string by adding the leading zero, changing the decoded count, and updating the code type. No overflow checking is performed.

ToGtin Syntax: Input: Returns: Notes:

int ToGtin(char far *string, unsigned far *decodedCount, int far *codetype) Pointers to NULL terminated UPC-A, EAN-8, EAN-13, or ITF-14 string, decoded count, and code type. 0 on success, non-zero on failure. Converts a UPC-A, EAN-8, EAN-13, or ITF-14 string to the Global Trade Identification Number (GTIN) format by right-justifying and zero filling, changing the decoded count, and updating the code type. No overflow checking is performed.

ToIsbn Syntax: Input: Returns: Notes:

7-18 int ToIsbn(char far *string, unsigned far *decodedCount, int far *codetype) Pointers to NULL terminated EAN-13 string, decoded count and code type. 0 on success, non-zero on failure. Converts a Bookland EAN-13 string to an ISBN string. Updates the decoded count.

COAM30002

Rev. 2.00

8/13/02

Page 127

Apex PDT Technical Reference Manual

7 Apex Programming Resource

ToUpca Syntax: Input: Returns: Notes:

int ToUpca(char far *string, unsigned far *decodedCount, int far *codetype) Pointers to NULL terminated UPC-E string, decoded count, code type. 0 on success, non-zero on failure. Converts a UPC-E string in the form NXXXXXXC, where N is the number system character, X is a data character, and C is the checksum character, to a UPC-A string in the form NXXXXXXXXXXC by expanding per the UCC rules, changing the decoded count, and updating the code type. No overflow checking is performed.

Serial Port Functions GetComPortMode Syntax: Input: Returns: Notes:

unsigned char GetComPortMode(void) None 0 = RS-232, 1 = Infrared. The symbolic names RS232 and IR are defined in [a3lib.h]. Retrieves the active serial communication mode, infrared (IR) or RS-232.

SetComPortMode Syntax:

unsigned char SetComPortMode(unsigned char mode)

Input: Returns:

0 for RS-232, 1 for Infrared. Previous setting. The symbolic names RS232 and IR are defined in [a3lib.h]. Enables either the infrared (IR) port or the RS-232 port for serial communications.

Notes:

COAM30002

Rev. 2.00

8/13/02

7-19

Page 128

Apex PDT Technical Reference Manual

7 Apex Programming Resource

Miscellaneous Functions A3libVer Syntax: Input: Returns:

Notes:

unsigned int A3libVer(void) None 0 on error, Non-zero on success. AH = major release and AL = minor release. Returns the Apex PDT Library version.

BiosVersion Syntax: Input: Returns:

Notes:

unsigned int BiosVer(void) None 0 on error (all BIOS's prior to v1.34), Non-zero on success. AH = major release and AL = minor release. Returns the Apex PDT BIOS version.

Backlight Syntax: Input:

char Backlight(char state) 0 = Off, non-zero = On

Returns: Notes:

Previous setting. Turns the Apex PDT backlight on or off. This is an Apex PDT specific function. The symbolic names BKLTOFF and BKLTON are defined in [a3lib.h].

BootCold Syntax:

void BootCold(void)

Input: Returns: Notes:

None None Cold boots the Apex PDT. The Apex PDT will perform the memory tests when cold booted.

7-20

COAM30002

Rev. 2.00

8/13/02

Page 129

Apex PDT Technical Reference Manual

7 Apex Programming Resource

BootWarm Syntax:

void BootWarm(void)

Input: Returns: Notes:

None None Warm boots the Apex PDT. The Apex PDT will NOT perform the memory tests when warm booted.

CapsLock Syntax:

char CapsLock(char state)

Input: Returns: Notes:

0 = Off, non-zero = On Previous setting. Sets the Caps Lock ON or OFF.

GetDiskSerialNo Syntax: Input: Returns:

Notes:

int GetDiskSerialNo(struct diskinfo_sn *userdisk) Pointer to structure. 0 if no error and places disk drive serial number information in structure. Extended error number on error. Retrieves Drive C disk serial number info level, disk serial number, volume label, and file system type. The diskinfo_sn structure declared in the include file [a3lib.h] contains the following elements: unsigned int infolevel; // info level long int serialno; // disk serial number (binary) char volumelabel[12]; // volume label or "NO NAME" // if none present // (NULL terminated) char systemtype[9]; // file system type-string // (NULL terminated)

KeyClick Syntax: Input: Returns: Notes:

char KeyClick(char state) 0 = Off, non-zero = On 0 on success, non-zero on error Sets the Apex PDT keyclick. This function returns an error if attempted on BIOS's prior to v1.34. COAM30002

Rev. 2.00

8/13/02

7-21

Page 130

Apex PDT Technical Reference Manual

7 Apex Programming Resource

Wait Syntax: Input: Returns: Notes:

void Wait(unsigned int milliseconds) Number of milliseconds to delay. None Delays the current program from execution for the number of specified milliseconds. Analogous to the Borland C function delay().

Examples To assist developers in using the available APR functions discussed within this section, examples of each of the APR functions are located on the Compsee Product Support CD. The fully commented examples are located within the SAMPLES sub-folder of the APR directory (folder).

Additional Programming Resources In the event that you require a custom Apex PDT application, but do not wish to write your own program code for the Apex PDT, another valuable resource is available. The Apex PDT Program Generator is a Windows based application specifically designed for use with the Apex PDT. Compsee’s Apex PDT Program Generator application generates well structured, modular, and fully commented source code to produce customized Apex PDT program applications. With a built-in communications module (to handles data transfers between the PC and the Apex PDT) and a fully commented Help file, you should be able to produce fully functional Apex PDT programs within a short period of time. System Requirements Windows® 95/98/NT operating system 100 MHz Pentium® or better 16 MB RAM for Windows® 95/98, 32 Mb RAM for Windows® NT 10 MB of free Hard Disk space A CD-ROM drive

The Compsee, Inc. part number for the Apex PDT Program Generator is located in the Parts Section of the Apex PDT User’s Manual. You can order the Apex PDT Program Generator application directly from Compsee, Inc. or through your Value Added Reseller (VAR). Product information and product brochures can be obtained by calling (321) 724-4321 or (800) 628-3888. Or visit our website at: www.compsee.com . 7-22

COAM30002

Rev. 2.00

8/13/02