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 5 of 42

JANUS PSK for C/C++ Reference Manual, Version 2.1, pages 41 to 50

Pages 41 to 50 of 414

The original document is the PDF (690 KB). 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 Intermec J2020, Intermec J2010 and Intermec J2050

Page 41

C Language Support

2

Tested C Functions (continued) highvideo qsort va_start inport read vsprintf inportb realloc wherex inpw remove wherey int86 scanf window intdosx setcursortype write isalpha setdate isascii settime iscntrl setvect isdigit sleep isprint sprintf isspace sscanf itoa strcat kbhit strchr keep strcmp lseek strcmpi malloc strcpy memccpy strcspn memcmp strlen memcpy strncmp memmove strncmpi memset strncpy min strnset

MK_FP strpbrk open strrchr outp strstr outportb tell outpw textbackground printf textcolor putch time puts toupper puttext va_end

2-13

Page 42

JANUS PSK for C/C++ Reference Manual

Intermec C Library Functions The following pages list the C library functions available in the Programmer’s Software Kit (PSK), along with notes on syntax and examples of how the functions can be used. Each function is fully compatible with currently available Microsoft C/C++ and Borland C/C++ compilers. Note: Do not run programs that use PSK library functions on your PC, unless you have the JANUS Application Simulator installed. If you attempt to run these programs without the Simulator, you will receive an error message and the program will not run.

CAUTION

Caution Do not run programs that use Intermec-specific interrupt extensions on your PC, unless you have the JANUS Application Simulator installed. If you attempt to run these programs without the Simulator, they will cause your PC to lock up and possibly corrupt your system BIOS. Conseil N’exécutez pas de programmes utilisant des extensions d’interruption spécifiques à Intermec sur votre PC, à moins que JANUS Application Simulator soit installé. Si vous tentez de les exécuter sans le Simulator, ces programmes risquent de verrouiller votre PC et d’altérer le BIOS de votre système.

2-14

Page 43

C Language Support

2

C Library Functions Listed by Category Communications im_cancel_rx_buffer, 2-22 im_cancel_tx_buffer, 2-23 im_get_reboot_flag, 2-50 im_link_comm, 2-85 im_protocol_extended_status, 2-96 im_ready_for_reboot, 2-99 im_receive_buffer, 2-100 im_receive_buffer_no_wait, 2-103 im_receive_buffer_noprot, 2-106 im_receive_byte, 2-109 im_receive_input, 2-111 im_rx_check_status, 2-116 im_serial_protocol_control, 2-117 im_transmit_buffer, 2-145 im_transmit_buffer_no_wait, 2-147 im_transmit_buffer_noprot, 2-150 im_transmit_byte, 2-153 im_unlink_comm, 2-155

DCM im_parse_host_response, 2-91 im_setup_trx, 2-136 im_standard_trx, 2-141

Display im_backlight_off, 2-19 im_backlight_on, 2-20 im_backlight_toggle, 2-21 im_decrease_contrast, 2-28 im_get_contrast, 2-32 im_get_display_mode, 2-36 im_get_display_type, 2-38 im_get_follow_cursor, 2-39 im_increase_contrast, 2-57 im_set_contrast, 2-124 im_set_display_mode, 2-127 im_set_follow_cursor, 2-130

Input im_get_input_mode, 2-41 im_get_label_symbology, 2-45 im_get_length, 2-47 im_input_status, 2-59 im_receive_byte, 2-109 im_receive_input, 2-111 im_set_input_mode, 2-131

IRL im_irl_a, 2-61 im_irl_k, 2-65 im_irl_n, 2-68 im_irl_v, 2-71 im_irl_y, 2-76

Keypad im_get_control_key, 2-34 im_get_keyclick, 2-43 im_get_warm_boot, 2-55 im_number_pad_off, 2-88 im_number_pad_on, 2-89 im_set_control_key, 2-126 im_set_keyclick, 2-133 im_set_warm_boot, 2-135

Macros IM_ISERROR, 2-81 IM_ISGOOD, 2-82 IM_ISSUCCESS, 2-83 IM_ISWARN, 2-84

Program Control im_appl_break_status, 2-17 im_clear_abort_callback, 2-24 im_set_abort_callback, 2-120

2-15

Page 44

JANUS PSK for C/C++ Reference Manual

Sound im_sound, 2-139

System im_command, 2-25 im_get_postamble, 2-48 im_get_preamble, 2-49 im_message, 2-87 im_power_status, 2-93 im_rs_installed, 2-115 im_standby_wait, 2-144

Viewport im_cursor_to_viewport, 2-27 im_get_config_info, 2-30 im_get_viewport_lock, 2-53 im_set_follow_cursor, 2-130 im_set_viewport_lock, 2-134 im_viewport_end, 2-156 im_viewport_getxy, 2-157 im_viewport_home, 2-158 im_viewport_move, 2-159 im_viewport_page_down, 2-161 im_viewport_page_up, 2-162 im_viewport_setxy, 2-163 im_viewport_to_cursor, 2-167

Note: The following syntax descriptions refer to many named constant variables, such as IM_COM1. These variables always appear in uppercase and are described in IM20LIB.H.

2-16

Page 45

im_appl_break_status

2 im_appl_break_status Purpose:

This function checks whether the application break sequence has been pressed. All PSK functions are terminated when the application break sequence is keyed in. Place calls to this function at strategic locations in your program to detect when a user wants to break out of a loop. Your program can determine what action to take when the break sequence is detected.

Syntax:

#include <im20lib.h> IM_STATUS im_appl_break_status (IM_APPBREAK_STATUS *brk);

IN Parameters:

None.

OUT Parameters:

The brk parameter returns a nonzero value if the break status bit is set and zero if it is not set.

Return Value:

This function returns one of the standard status codes defined in Appendix A, “Status Codes.”

Notes:

The brk flag is reset each time the routine is called. Because this function is also called during the input routines provided in the library, you should check the return code from input functions for the hex value 8515H. This value indicates that the input function has terminated because the application break sequence was entered. In this case, brk is cleared by the input function’s call to im_appl_break_status. For more information on the application break sequence, refer to your JANUS user’s manual. To enter an application break sequence 1. Press 2. Press 3. Press 4. Press

L IB

L to turn off the reader. -

- at the same time.

. This sets the reader’s application break bit.

to turn on the reader.

2-17

Page 46

im_appl_break_status

Example /******************** im_appl_break_status *****************************/ #include <stdio.h> #include <stdlib.h> #include <conio.h> #include "im20lib.h" void main (void) { IM_STATUS status; IM_APPBREAK_STATUS brk; /* Pause for key stroke */ while ( !kbhit() ) ; /* Press the following sequence at this pause: */ /* I/O key (Turn OFF the reader) */ /* F3+2+Left Arrow (Press F3, 2, and left arrow at the same time) */ /* 1 (Press the 1 (one) key to set application break bit) */ /* I/O key (Turn the reader ON) */ /* Set brk to known value */ brk = 99; /* Call Intermec function. Everytime the break bit is checked, it is cleared*/ status = im_appl_break_status ( &brk); if (brk) { /* brk should return a -1 if bit is set */ printf ("Break status ON\n"); printf ("return status: %4X\n", status); printf ("break status: %d\n", brk); } else { /* brk should return a 0 if bit is not set */ printf ("Break status OFF\n"); printf ("return status: %4X\n", status); printf ("break status: %d\n", brk); } }

2-18

Page 47

im_backlight_off

2 im_backlight_off Purpose:

This function turns the display backlight off. Turn off the backlight to prolong the reader’s battery life.

Syntax:

#include <im20lib.h> void im_backlight_off(void);

IN Parameters:

None.

OUT Parameters:

None.

Return Value:

None.

Notes:

You can program the backlight to automatically turn off after a specified time to save battery power. The length of time depends on the backlight timeout configuration parameter. The configuration parameter is set in 1-second increments. The default is 10 seconds. This function has no effect on the JANUS 2050.

See Also:

im_backlight_on, im_backlight_toggle

Example /******************** im_backlight_off *****************************/ #include <stdio.h> #include "im20lib.h" void main (void) { im_backlight_off(); printf("Backlight off\n"); }

2-19

Page 48

im_backlight_on im_backlight_on Purpose:

This function turns the display backlight on to illuminate the reader display in dimly lit environments.

Syntax:

#include <im20lib.h> void im_backlight_on(void);

IN Parameters:

None.

OUT Parameters:

None.

Return Value:

None.

Notes:

You can program the backlight to automatically turn off after a specified time to save battery power. The length of time depends on the backlight timeout configuration parameter. The configuration parameter is set in 1-second increments. The default is 10 seconds. This function has no effect on the JANUS 2050.

See Also:

im_backlight_off, im_backlight_toggle

Example /******************** im_backlight_on *****************************/ #include <stdio.h> #include "im20lib.h" void main (void) { im_backlight_on(); printf("Backlight on\n"); }

2-20

Page 49

im_backlight_toggle

2 im_backlight_toggle Purpose:

This function toggles the display backlight ON and OFF.

Syntax:

#include <im20lib.h> void im_backlight_toggle(void);

IN Parameters:

None.

OUT Parameters:

None.

Return Value:

None.

Notes:

You can program the backlight to automatically turn off after a specified time to save battery power. The length of time depends on the backlight timeout configuration parameter. The configuration parameter is set in 1-second increments. The default is 10 seconds. This function has no effect on the JANUS 2050.

See Also:

im_backlight_on, im_backlight_off

Example /******************** im_backlight_toggle *****************************/ #include <stdio.h> #include "im20lib.h" void main (void) { im_backlight_toggle(); printf("Backlight switched on/off\n"); }

2-21

Page 50

im_cancel_rx_buffer im_cancel_rx_buffer Purpose:

This function clears the receive buffer of the designated communications port.

Syntax:

#include <im20lib.h> IM_STATUS im_cancel_rx_buffer (IM_COM_PORT port_id);

IN Parameters:

The port_id parameter identifies the communications port as follows: IM_COM1 IM_COM2 IM_COM4

COM1 COM2, scanner port (2010 and 2050) COM4 (RF only)

OUT Parameters:

None.

Return Value:

This function returns one of the standard status codes defined in Appendix A, “Status Codes.” If there is no input pending to receive, this function returns 4602H (no client).

Notes:

You must install a protocol handler to use this function.

See Also:

im_receive_buffer_no_wait, im_receive_buffer_noprot

Example See example for im_receive_buffer_no_wait.

2-22