The text of a manual · part 16 of 40
2D JANUS PSK for C/C++ Reference Manual, pages 151 to 160
Pages 151 to 160 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 151
im_set_display_mode
2 im_set_display_mode Purpose:
This function sets the size mode, video mode, scroll mode, and character height of the display.
Syntax:
#include "im20lib.h" IM_STATUS im_set_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:
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, you also need to set the video mode, scroll mode, and character height. If any other size_mode is set, the video mode, scroll mode, and character height are automatically set. 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
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)
2-125
Page 152
im_set_display_mode
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 requires IM_SIZE_MODE_80X25 and is one of these constants: IM_STANDARD_CHAR_HEIGHT
Standard height characters. You must have set the scroll_mode to scroll at line 25 or line 16.
IM_DOUBLE_CHAR_HEIGHT
Double height characters. You must have set the scroll_mode to scroll at line 8 or line 13.
OUT Parameters:
None.
Return Value:
This function returns one of the standard status codes defined in Appendix A, “Status Codes.”
Notes:
Changing display modes clears the screen. The IRL input commands do not display correctly when the display is in 80 x 25 mode and the cursor has scrolled off the display. To alleviate this problem, set the display mode to one of the other modes, such as 20 x 16. If your application uses an 8 x 10 or 16 x 10 (double width) display size and direct video addressing, the application will lock up because the display size does not provide enough characters to be detected by the hardware and displayed to the JANUS reader’s screen. To avoid this problem, you must write the video using the BIOS when using a double width display size. For example, you can use the Borland global variable directvideo, which determines whether video writing goes to BIOS or direct video. Note: Intermec recommends that all applications write video using the BIOS instead of using direct video addressing.
2-126
Page 153
im_set_display_mode
2
The mode does not change if there are conflicting parameters, such as trying to set the video_mode to 16 lines and the scroll_mode at line 8. If you want to use one of the graphics modes, use the appropriate function call provided by your programming language. For example, Borland uses initgraph and Microsoft uses _setvideomode. 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_get_display_mode, im_set_follow_cursor
Example See example for im_viewport_setxy.
2-127
Page 154
im_set_follow_cursor im_set_follow_cursor Purpose:
When the display is in 80 x 25 mode, the viewport follows the cursor as it moves. This function enables or disables the follow-the-cursor feature.
Syntax:
#include "im20lib.h" IM_STATUS im_set_follow_cursor (IM_CONTROL follow_cursor);
IN Parameters:
The follow_cursor parameter is one of these constants: IM_ENABLE IM_DISABLE
Enable follow-the-cursor mode Disable follow-the-cursor mode
OUT Parameters:
None.
Return Value:
This function returns one of the standard status codes defined in Appendix A, “Status Codes.”
Notes:
The display must be in 80 x 25 mode for this function to work correctly. This function has no effect on the JANUS 2050.
See Also:
im_get_follow_cursor
Example See example for im_get_follow_cursor.
2-128
Page 155
im_set_input_mode
2 im_set_input_mode Purpose:
This function clears the input buffers and sets the input manager to one of three modes: Wedge, Programmer, or Desktop.
Syntax:
#include <im20lib.h> void im_set_input_mode (IM_MODE mode);
IN Parameters:
The mode parameter is one of these constants: IM_WEDGE IM_PROGRAMMER IM_DESKTOP
Wedge mode Programmer mode Desktop mode
OUT Parameters:
None.
Return Value:
None.
Notes:
You must install the Reader Wedge to use this function. For information on loading RWTSR.EXE, see “Runtime Requirements” earlier in this chapter. There are three different reader input modes: Wedge, Programmer, or Desktop. These 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-129
Page 156
im_set_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 “Reader Input Modes” in Chapter 4, “Advanced Programming.” Upon exiting the program, set the input mode to IM_WEDGE so that DOS will work as expected. See Also:
im_get_input_mode, im_receive_input
Example See example for im_get_input_mode.
2-130
Page 157
im_set_keyclick
2 im_set_keyclick Purpose:
Each time you press a key, the reader can emit a click. This function enables or disables the keyclick.
Syntax:
#include "im20lib.h" IM_STATUS im_set_keyclick (IM_CONTROL keyclick_status);
IN Parameters:
The keyclick_status parameter is one of these constants: IM_ENABLE IM_DISABLE
Enable the keyclick Disable the keyclick
OUT Parameters:
None.
Return Value:
This function returns one of the standard status codes defined in Appendix A, “Status Codes.”
See Also:
im_get_keyclick
Example See example for im_get_keyclick.
2-131
Page 158
im_set_viewport_lock im_set_viewport_lock Purpose:
This function enables or disables the keys that move the viewport.
Syntax:
#include "im20lib.h" IM_STATUS im_set_viewport_lock (IM_CONTROL viewport_lock);
IN Parameters:
The viewport_lock parameter is one of these constants: IM_ENABLE IM_DISABLE
Lock the viewport Unlock the viewport
OUT Parameters:
None.
Return Value:
This function returns one of the standard status codes defined in Appendix A, “Status Codes.”
Notes:
The display must be in 80 x 25 mode for this function to work correctly. This function controls whether the viewport moves (unlocked) or does not move (locked) when the cursor movement keys are pressed. This function has no effect on the JANUS 2050.
See Also:
im_get_viewport_lock, im_set_follow_cursor
Example See example for im_get_viewport_lock.
2-132
Page 159
im_set_warm_boot
2 im_set_warm_boot Purpose:
This function enables or disables the Ctrl-Alt-Del warm boot key sequence. When disabled, the Ctrl-Alt-Del key sequence does not reboot the reader.
Syntax:
#include "im20lib.h" IM_STATUS im_set_warm_boot (IM_CONTROL warm_boot);
IN Parameters:
The warm_boot parameter is one of these constants: IM_ENABLE IM_DISABLE
Enable Ctrl-Alt-Del warm boot Disable Ctrl-Alt-Del warm boot
OUT Parameters:
None.
Return Value:
This function returns one of the standard status codes defined in Appendix A, “Status Codes.”
See Also:
im_get_warm_boot
Example See example for im_get_warm_boot.
2-133
Page 160
im_setup_trx im_setup_trx Purpose:
This function sets up the protocol parameters for a DCM transaction. If your program calls a DCM function without first calling im_setup_trx, then the default protocol values listed below are used. For a detailed discussion of programming database transactions, see Chapter 5, “Using the PSK With DCM.”
Syntax:
#include "im20lib.h" IM_USHORT im_setup_trx (IM_COM_PORT port_id, IM_USHORT tx_timeout, IM_USHORT rx_timeout, IM_USHORT db_protocol, IM_UCHAR sys_delimiter, IM_UCHAR parse_char, IM_USHORT packet_max_len, int hsafety);
IN Parameters:
The port_id parameter identifies the communications port as follows: IM_COM1 IM_COM4
COM1 (Default) COM4 (RF only)
The tx_timeout parameter is the transmit timeout and is a numeric value in seconds or IM_INFINITE_TIMEOUT. The numeric range is between 0 and 65,000 seconds. The default is IM_INFINITE_TIMEOUT. The rx_timeout parameter is the receive timeout and is a numeric value in seconds or IM_INFINITE_TIMEOUT. The numeric range is between 0 and 65,000 seconds. The default is IM_INFINITE_TIMEOUT.
2-134