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 42

JANUS PSK for C/C++ Reference Manual, Version 2.1, pages 51 to 60

Pages 51 to 60 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 51

im_cancel_tx_buffer

2 im_cancel_tx_buffer Purpose:

This function clears the contents of the transmit buffer for a designated communications port, stops transmission in progress, and resets the communications port. Use this function with Polling Mode D to clear out the buffer. Other protocols clear the buffer automatically. You can also use this function to clear a busy port.

Syntax:

#include <im20lib.h> IM_STATUS im_cancel_tx_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.”

Notes:

You must install a protocol handler to use this function.

See Also:

im_transmit_buffer_no_wait, im_transmit_buffer_noprot, im_transmit_buffer

Example See example for im_transmit_buffer_no_wait.

2-23

Page 52

im_clear_abort_callback im_clear_abort_callback Purpose:

This function clears the notification (callback) mode of the Virtual Wedge.

Syntax:

#include <im20lib.h> IM_STATUS im_clear_abort_callback(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:

You must install the Reader Wedge to use this function. For information on loading RWTSR.EXE, see “Runtime Requirements” earlier in this chapter.

See Also:

im_set_abort_callback

Example See example for im_set_abort_callback.

2-24

Page 53

im_command

2 im_command Purpose:

This function modifies the reader’s configuration. For example, you can use this function to set a specific communications port’s baud rate.

Syntax:

#include <im20lib.h> IM_STATUS im_command (IM_UCHAR *command, IM_USHORT command_length);

IN Parameters:

The command parameter is a reader command string. The command string may include more than one reader command. For example, the command string %.1$+BV9 turns on the backlight and raises the beep volume. Reader commands are listed in your JANUS user’s manual. The command_length parameter is the length of the reader command string.

OUT Parameters:

None.

Return Value:

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

Notes:

For more information on using im_command, see your JANUS user’s manual. You must install the Reader Wedge to use this function. For information on loading RWTSR.EXE, see “Runtime Requirements” earlier in this chapter.

2-25

Page 54

im_command

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-26

Page 55

im_cursor_to_viewport

2 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-27

Page 56

im_decrease_contrast 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

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

2-28 im_increase_contrast, im_set_contrast, im_get_contrast

Very dark

Page 57

im_decrease_contrast

2

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-29

Page 58

im_get_config_info 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-30

Page 59

im_get_config_info

2

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-31

Page 60

im_get_contrast 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:

2-32 im_set_contrast, im_decrease_contrast, im_increase_contrast