The text of a manual · part 7 of 40
2D JANUS PSK for C/C++ Reference Manual, pages 61 to 70
Pages 61 to 70 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 61
im_get_display_mode
2
The scroll_mode requires IM_SIZE_MODE_80X25 and is one of these constants: IM_LCD_SCROLL_AT_25 IM_LCD_SCROLL_AT_16 IM_LCD_SCROLL_AT_13 IM_LCD_SCROLL_AT_8
Scroll at line 25 Scroll at line 16 (2010 and 2020) Scroll at line 13 (2050 and double height) Scroll at line 8 (2010 and 2020)
The char_ht parameter requires IM_SIZE_MODE_80X25 and is one of these constants: IM_STANDARD_CHAR_HEIGHT
Standard height characters. On a JANUS 2050, up to 25 lines of these characters fit on the screen. On other JANUS readers, up to 16 lines fit on the screen.
IM_DOUBLE_CHAR_HEIGHT
Double height characters. On a JANUS 2050, up to 13 lines of these characters fit on the screen. On other JANUS readers, up to 8 lines fit on the screen.
Return Value:
This function returns one of the standard status codes defined in Appendix A, “Status Codes.”
See Also:
im_set_display_mode
Example See example for im_viewport_setxy.
2-35
Page 62
im_get_display_type im_get_display_type Purpose:
This function gets the hardware display type, either standard JANUS reader or JANUS 2050 (VMU).
Syntax:
#include "im20lib.h" IM_STATUS im_get_display_type (IM_DISPLAY_TYPE *type);
IN Parameters:
None.
OUT Parameters:
The type parameter is one of these constants: IM_LCD_20X16 IM_CRT_80X25
Standard JANUS display JANUS VMU display
Return Value:
This function returns one of the standard status codes defined in Appendix A, “Status Codes.”
See Also:
im_get_display_mode, im_set_display_mode
Example /******************** im_get_display_type *******************************/ #include <stdio.h> #include <string.h> #include "im20lib.h" void main(void) { IM_DISPLAY_TYPE type; IM_STATUS status; // Use im_get_display_type to get the Display Type printf("\nim_get_display_type example: \n"); status = im_get_display_type(&type); // Print the results if(type == IM_LCD_20X16) // Standard JANUS Display printf("\nDisplay type is Standard JANUS display"); else if(type == IM_CRT_80X25) // JANUS VMU Display printf("\nDisplay type is JANUS VMU display"); }
2-36
Page 63
im_get_follow_cursor
2 im_get_follow_cursor Purpose:
When the display is in 80 x 25 mode, the viewport follows the cursor as it moves. The follow-the-cursor feature can be enabled or disabled. This function retrieves the current setting.
Syntax:
#include "im20lib.h" IM_STATUS im_get_follow_cursor (IM_CONTROL *follow_cursor);
IN Parameters:
None.
OUT Parameters:
The follow_cursor parameter is one of these constants: IM_ENABLE IM_DISABLE
Follow-the-cursor mode is enabled Follow-the-cursor mode is disabled
Return Value:
This function returns one of the standard status codes defined in Appendix A, “Status Codes.”
Notes:
This function has no effect on the JANUS 2050.
See Also:
im_set_follow_cursor, im_cursor_to_viewport, im_viewport_to_cursor
2-37
Page 64
im_get_follow_cursor
Example /******************** im_get_follow_cursor *******************************/ /* Also with: im_set_follow_cursor */ #include <stdio.h> #include <conio.h> #include <stdlib.h> #include <ctype.h> #include "im20lib.h" #define
ESC_CHAR
0x1B void main (void) { IM_UCHAR ch, user_option; IM_CONTROL old_lock_cursor; IM_CONTROL new_lock_cursor; clrscr(); gotoxy(1,1);
/* Clear screen */ /* Position message */
/* Get the current status of viewport follow cursor for restore later */ im_get_follow_cursor(&old_lock_cursor); /* Get user's input option, 'y' for disable viewport follow cursor */ printf("Enable viewport\nfollows cursor(y)?"); user_option = getche(); user_option = toupper(user_option); if (user_option == 'Y') { /* Enable viewport follow cursor */ im_set_follow_cursor(IM_ENABLE); } else { /* Disable viewport follow cursor */ im_set_follow_cursor(IM_DISABLE); } /* Get new viewport follow cursor status after setting */ im_get_follow_cursor(&new_lock_cursor); /* Display user's input message */ printf("\n\n'ESC' to quit!\nType keys to check\n"); printf("viewport follow\n"); if (new_lock_cursor == IM_ENABLE) printf("cursor ON !!!!!"); else printf("cursor OFF !!!!"); /* Enter any characters to check viewport follow cursor until 'ESC' key. */ while ( (ch = getche()) != ESC_CHAR ) ; /* Restore original follow cursor setting */ im_set_follow_cursor(old_lock_cursor); }
2-38
Page 65
im_get_input_mode
2 im_get_input_mode Purpose:
This function reports the current mode of the input manager. The different modes affect how the reader interprets and stores input.
Syntax:
#include <im20lib.h> IM_MODE im_get_input_mode (void);
IN Parameters:
None.
OUT Parameters:
None.
Return Value:
The IM_MODE returned is one of these constants: IM_WEDGE IM_PROGRAMMER IM_DESKTOP
Notes:
Wedge mode Programmer mode Desktop mode
There are three different reader input modes: Wedge, Programmer, and Desktop. These different modes affect how the reader interprets and stores input. Wedge Mode Keypad and label inputs go into the keyboard buffer with minimal filtering. Wedge mode is the default mode at the DOS prompt after reader services (RSERVICE.EXE) is loaded. Use Wedge mode when the reader is running an application that uses the Virtual Wedge. When in this mode, use standard input functions to retrieve keypad or label input. Wedge mode does not take full advantage of the reader’s power management capabilities. You will probably notice reduced battery life when the reader is in this mode compared to either Programmer or Desktop mode. For more information on power management, see Chapter 4, “Advanced Programming.” Programmer Mode Inputs are echoed to the screen. Reader commands are executed and saved. Use Programmer mode when the reader is executing IRL commands. In general, when you are running an application that uses the function libraries or software interrupts, the reader should be in Programmer mode.
2-39
Page 66
im_get_input_mode
Desktop Mode The application is responsible for retrieving and displaying input. Use Desktop mode when you need detailed information about a pressed key. Each character returned consists of four bytes: the ASCII code, scan code, and two bytes for the keyboard flags (Shift, Ctrl, Alt). See the structure IM_KEYCODE in IM20LIB.H for further details. For more information about reader input modes, see Chapter 4, “Advanced Programming.” 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_input_mode
Example See example for im_receive_input.
2-40
Page 67
im_get_keyclick
2 im_get_keyclick Purpose:
You can configure the reader to emit a click each time a key is pressed. This function returns the current setting (enabled or disabled) of the keyclick.
Syntax:
#include "im20lib.h" IM_STATUS im_get_keyclick (IM_CONTROL *keyclick);
IN Parameters:
None.
OUT Parameters:
The keyclick parameter is one of these constants: IM_ENABLE IM_DISABLE
Keyclick is enabled Keyclick is disabled
Return Value:
This function returns one of the standard status codes defined in Appendix A, “Status Codes.”
See Also:
im_set_keyclick
2-41
Page 68
im_get_keyclick
Example /******************** im_get_keyclick *******************************/ /* Also with: im_set_keyclick */ #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_keyclick; IM_CONTROL new_keyclick; clrscr(); gotoxy(1,1);
/* Clear screen */ /* Position message */
/* Get the current status of keypad clicker */ im_get_keyclick(&old_keyclick); /* Display keypad clicker's status */ if (old_keyclick == IM_ENABLE) printf("Keypad clicker ON!"); else printf("Keypad clicker OFF!"); /* Get user's input option, 'y' for enabling keypad clicker */ printf("\n\nEnabling keyclick(y)?"); user_option = getche(); user_option = toupper(user_option); if (user_option == 'Y') { /* Keypad clicker enable */ im_set_keyclick(IM_ENABLE); } else { /* Keypad clicker disable */ im_set_keyclick(IM_DISABLE); } /* Get new keypad clicker's status after setting */ im_get_keyclick(&new_keyclick); /* Display user's input setting */ if (new_keyclick == IM_ENABLE) printf("\nKeypad clicker ON!"); else printf("\nKeypad clicker OFF!"); printf("\nTest it>>\n"); }
2-42
Page 69
im_get_label_symbology
2 im_get_label_symbology Purpose:
This function gets the symbology, such as Code 39, from the most recently scanned label. Call this function after receiving the data using im_receive_input.
Syntax:
#include "im20lib.h" IM_STATUS im_get_label_symbology (IM_DECTYPE *symbology);
IN Parameters:
None.
OUT Parameters:
The symbology parameter is one of these constants: IM_UNKNOWN_DECODE IM_CODABAR IM_CODE_11 IM_CODE_16K IM_CODE_39 IM_CODE_49 IM_CODE_93 IM_CODE_128 IM_I_2_OF_5 IM_MSI IM_PDF_417 IM_PLESSEY IM_UPC
Unknown bar code Codebar bar code Code 11 bar code Code 16K bar code Code 39 bar code Code 93 bar code Code 49 bar code Code 128 bar code Interleaved 2 of 5 MSI bar code PDF417 bar code Plessey bar code Universal Product Code
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_receive_input
2-43
Page 70
im_get_label_symbology
Example /******************** im_get_label_symbology ************************/ /* im_receive_input */ /* im_set_input_mode */ #include <stdio.h> #include <conio.h> #include "im20lib.h" #include "immsg.h" static char *bar_code[] = { "unknown", "Code 39", /* See typedef enum { ...} IM_DECTYPE in im20lib.h*/ "Code 93", "Code 49", "I 2 of 5", "Codabar", "UPC and EAN", "Code 128", "Code 16K", "Plessey/Anker", "Code 11", "MSI", "PDF417" }; void main (void) { IM_UCHAR input[256]; IM_ORIGIN source; IM_DECTYPE symbol; window(1, 1, 20, 16); clrscr();
/* Set the application text window */ /* Clear the screen */ printf("Demo im_get_label_symbology\n'q' to quit\n"); /* Set Reader Wedge into PROGRAMMER mode im_set_input_mode(IM_PROGRAMMER);
*/
/* Input loop */ do { source = IM_LABEL_SELECT | IM_KEYBOARD_SELECT; /* Request input from Reader Wedge */ im_receive_input(source, IM_INFINITE_TIMEOUT, &source, input); /* Get most recently read label input */ /* im_get_label_symbology only works with im_receive_input */ im_get_label_symbology( &symbol); printf("\n%s\n", input);
/* Display input data */
/* Display symbology */ printf("\nSYMBOLOGY: %d\n%s\n", symbol, bar_code[symbol]); } while (input[0] != 'q' && input[0] != 'Q');
/* 'q' to quit */
/* Switch the Reader Wedge back to virtual wedge mode */ im_set_input_mode(IM_WEDGE); }
2-44