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 6 of 40

2D JANUS PSK for C/C++ Reference Manual, pages 51 to 60

Pages 51 to 60 of 400

The original document is the PDF (793 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 51

im_command

2

Example /******************** im_command ***************************************/ /* Also with: im_standby_wait */ #include <stdio.h> #include <string.h> #include "im20lib.h" void main (void) { /* Command string to set contrast */ char *high_trast ="$+DJ7"; /* 7 (dark) */ char *normal_trast ="$+DJ3"; char *low_trast ="$+DJ0"; /* 0 (light)*/ /* Set high contrast */ printf("Set high contrast\n"); im_command(high_trast, strlen(high_trast)); /* Wait for two seconds */ im_standby_wait(2000); /* Set low contrast */ printf("Set low contrast\n"); im_command(low_trast, strlen(low_trast)); /* Wait for two seconds */ im_standby_wait(2000); /* Set normal contrast */ printf("Set normal contrast\n"); im_command(normal_trast, strlen(normal_trast)); }

2-25

Page 52

im_cursor_to_viewport im_cursor_to_viewport Purpose:

This function moves the cursor to the center of the current viewport. Since the viewport can move around with or without the cursor, you can use this function to recenter the cursor.

Syntax:

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

IN Parameters:

None.

OUT Parameters:

None.

Return Value:

None.

Notes:

This function has no effect on the JANUS 2050.

See Also:

im_viewport_end, im_viewport_home, im_viewport_page_down, im_viewport_page_up, im_viewport_to_cursor, im_viewport_move

Example See example for im_viewport_setxy.

2-26

Page 53

im_decrease_contrast

2 im_decrease_contrast Purpose:

This function decreases the LCD display contrast by one level. The display contrast is the lightness or darkness of the characters against the reader display. The reader display has 32 levels of contrast (0 to 31), where 0 is very light, and 31 is very dark.

Syntax:

#include <im20lib.h> IM_STATUS im_decrease_contrast(void);

IN Parameters:

None.

OUT Parameters:

None.

Return Value:

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

Notes:

The 0 to 31 scale fine tunes the contrast more precisely than using the keypad to adjust the contrast. The functions im_set_contrast and im_get_contrast use a scale of 0 to 7 that is related to the scale of 0 to 31 used by im_increase_contrast and im_decrease_contrast. The following table compares the two scales. This Value on Scale 0 to 7

Equates to This Value on Scale 0 to 31

Contrast Level

0 1 2 3 4 5 6 7

10 12 14 16 18 20 22 24

Very light

Very dark

This function has no effect on the JANUS 2050. See Also:

im_increase_contrast, im_set_contrast, im_get_contrast

2-27

Page 54

im_decrease_contrast

Example /******************** im_decrease_contrast ******************************/ #include <stdio.h> #include "im20lib.h" #include "immsg.h" void main (void) { IM_STATUS status; status = im_decrease_contrast(); /* If the most significant bit is set, there is an error */ if (IM_ISERROR(status)) printf("Dec Contrast error = %x\n", status); }

2-28

Page 55

im_get_config_info

2 im_get_config_info Purpose:

This function retrieves the current reader configuration information string and its length.

Syntax:

#include "im20lib.h" IM_STATUS im_get_config_info (IM_UCHAR *config_string, IM_USHORT *length);

IN/OUT Parameters:

The config_string parameter is the configuration information string. The first two characters specify the type of configuration information returned. For example, to get the beep duration setting, set config_string to “BD.” The function returns BD and the current configuration for beep duration. The length parameter is the length of the configuration information string. For a list of the configuration commands, see your JANUS user’s manual.

Return Value:

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

Notes:

This function differs from im_command in that you only pass the twocharacter command identifier. The im_command function passes an entire command string.

See Also:

im_command

2-29

Page 56

im_get_config_info

Example /******************** im_get_config_info ******************************/ #include <stdio.h> #include <string.h> #include "im20lib.h" void main(void) { IM_STATUS status; IM_USHORT length; IM_UCHAR config_string[128]; // Use im_get_config_info to get the Beeper Volume printf("\nim_get_config_info example: \n"); // Set config request for Beeper Volume strcpy(config_string, "BV"); status = im_get_config_info(config_string, &length); // Print the results printf("\nBeeper Volume: %s", config_string); printf("\nlength: %d", length); printf("\nstatus: %d", status); }

2-30

Page 57

im_get_contrast

2 im_get_contrast Purpose:

This function gets the reader’s LCD display contrast level. There are eight levels of contrast (0 to 7) from very light to very dark, which are the most frequently used contrast settings.

Syntax:

#include "im20lib.h" IM_STATUS im_get_contrast (IM_UCHAR *display_contrast_level);

IN Parameters:

None.

OUT Parameters:

The contrast parameter is a number from 0 to 7 or is one of these constants: IM_MIN_CONTRAST IM_MAX_CONTRAST

0 Minimum contrast 1 Maximum contrast

Return Value:

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

Notes:

The functions im_set_contrast and im_get_contrast use a scale of 0 to 7 that is related to the scale of 0 to 31 used by im_increase_contrast and im_decrease_contrast. The following table compares the two scales. This Value on Scale 0 to 7

Equates to This Value on Scale 0 to 31

Contrast Level

0 1 2 3 4 5 6 7

10 12 14 16 18 20 22 24

Very light

Very dark

This function has no effect on the JANUS 2050. See Also:

im_set_contrast, im_decrease_contrast, im_increase_contrast

Example See example for im_set_contrast.

2-31

Page 58

im_get_control_key im_get_control_key Purpose:

You can enable or disable the Ctrl key. This procedure retrieves the current setting. When you disable this keycode, none of the key combinations that use the Ctrl key will work. For example, the warm boot key sequence Ctrl-Alt-Del will not work.

Syntax:

#include "im20lib.h" IM_STATUS im_get_control_key (IM_CONTROL *control_key);

IN Parameters:

None.

OUT Parameters:

The control_key parameter is one of these constants: IM_ENABLE IM_DISABLE

Ctrl key is enabled Ctrl key is disabled

Return Value:

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

See Also:

im_set_control_key

2-32

Page 59

im_get_control_key

2

Example /******************** im_get_control_key *******************************/ /* Also with: im_set_control_key */ #include <stdio.h> #include <conio.h> #include <stdlib.h> #include <ctype.h> #include "im20lib.h" void main (void) { IM_UCHAR user_option; IM_CONTROL old_controlkey; IM_CONTROL new_controlkey; clrscr(); gotoxy(1,1);

/* Clear screen */ /* Position message */

/* Get the current status of control key */ im_get_control_key(&old_controlkey); /* Display control key's status */ if (old_controlkey == IM_ENABLE) printf("<CTRL> key enabled!"); else printf("<CTRL> key disabled!"); /* Get user's input option, 'y' for enabling control key */ printf("\n\nEnabling <CTRL> key(y)?"); user_option = getche(); user_option = toupper(user_option); if (user_option == 'Y') { /* <CTRL> key enable */ im_set_control_key(IM_ENABLE); } else { /* <CTRL> key disable */ im_set_control_key(IM_DISABLE); } /* Get new <CTRL> key's status after setting */ im_get_control_key(&new_controlkey); /* Display user's input setting */ if (new_controlkey == IM_ENABLE) printf("\n<CTRL> key enabled!"); else printf("\n<CTRL> key disabled!"); printf("\nTest it>>\n"); }

2-33

Page 60

im_get_display_mode im_get_display_mode Purpose:

This function gets the size mode, video mode, scroll mode, and character height of the display.

Syntax:

#include "im20lib.h" IM_STATUS im_get_display_mode (IM_STD_SIZE_MODE *size_mode, IM_STD_VIDEO_MODE *video_mode, IM_SCROLL_MODE *scroll_mode, IM_CHARACTER_HEIGHT *char_ht);

IN Parameters:

None.

OUT Parameters:

The size_mode parameter is required and is one of these constants: IM_SIZE_MODE_80X25 IM_SIZE_MODE_20X16 IM_SIZE_MODE_20X8 IM_SIZE_MODE_10X16 IM_SIZE_MODE_10X8

80 x 25 text mode 20 x 16 text mode (2010 and 2020) 20 x 8 text mode (2010 and 2020) 10 x 16 text mode (2010 and 2020) 10 x 8 text mode (2010 and 2020)

If the size_mode parameter is set to IM_SIZE_MODE_80X25, the video mode, scroll mode, and character height values may have been customized. If any other size_mode is set, the video mode, scroll mode, and character height use the default values. The video_mode parameter requires IM_SIZE_MODE_80X25. The standard PC BIOS supports up to video mode 13H. The reader only supports up to video mode 6. You can also set video modes 0 through 3 with IC.EXE. The video_mode parameter is one of these constants: IM_STD_VIDEO_MODE_0 IM_STD_VIDEO_MODE_1 IM_STD_VIDEO_MODE_2 IM_STD_VIDEO_MODE_3 IM_STD_VIDEO_MODE_4 IM_STD_VIDEO_MODE_5 IM_STD_VIDEO_MODE_6

2-34

40 x 25 (use for double-wide character) 40 x 25 (use for double-wide character) 80 x 25 80 x 25 300 x 200 2-color 300 x 200 monochrome 640 x 200 2-color (2050)