The text of a manual · part 19 of 42
JANUS PSK for C/C++ Reference Manual, Version 2.1, pages 181 to 190
Pages 181 to 190 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 181
im_transmit_buffer_noprot if (IM_ISSUCCESS(status)) printf("Line %d Sent\n", index + 1); else printf("Tx Error\nStatus = %xH\n", status); } printf("Tx No Protocol Done\n"); }
2-152
Page 182
im_transmit_byte
2 im_transmit_byte Purpose:
This function transmits one byte of data out from the designated communications port. This function is identical to MS-DOS INT 14H Service 01H.
Syntax:
#include <im20lib.h> IM_STATUS im_transmit_byte (IM_COM_PORT port_id, IM_UCHAR transmit_byte);
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)
The transmit_byte parameter is the byte of data to transmit. OUT Parameters:
None.
Return Value:
This function returns one of the standard status codes defined in Appendix A, “Status Codes.”
Notes:
This function requires the PC standard protocol handler PHPCSTD.EXE. Intermec recommends using im_transmit_buffer (with a user_length of one) instead of using im_transmit_byte. You can use this function for an acknowledgment.
See Also:
im_receive_byte, im_transmit_buffer
2-153
Page 183
im_transmit_byte
Example /******************** im_transmit_byte ************************************/ /* Uses Borland _bio_serialcom or Microsoft _bios_serialcom to init the */ /* com port for single byte. */ /* Operations. It sets up for 9600,E,7,1 on serial port */ /* Note: Phimec protocol handler must NOT be installed to run this routine */ #include <stdio.h> #include <dos.h> #include <conio.h> #include <stdlib.h> #include <bios.h> #include <string.h> #include "im20lib.h" #include "immsg.h" /* Byte oriented defines */ #define COM1 0 #define SETTINGS (_COM_9600 | _COM_CHR7 | _COM_STOP1 | _COM_EVENPARITY ) static IM_COM_PORT com_port = IM_COM1;
/* Uses COM1*/ void main (void) { IM_UCHAR outchar; IM_STATUS status; printf("\nChoose a protocol:\n"); printf("1) PC Standard\n"); printf("2) No protocol\n"); if (getche() == '2') /* Call bios to initialize com port */ { /* Communications port init */ _bios_serialcom(_COM_INIT, COM1, SETTINGS); } /* Display instruction */ printf ("Enter characters\n"); printf (" to be transmitted\n"); printf (" <ESC> to quit\n"); /* Phimec protocol handler must NOT be installed ...*/ while ((outchar = getche()) != '\x1B') /* Send char until <ESC> char*/ { /* Call Intermec function */ status = im_transmit_byte( com_port, outchar); if ( IM_ISERROR(status)) im_message(status); } }
2-154
Page 184
im_unlink_comm
2 im_unlink_comm Purpose:
This function removes the link between the Reader Wedge function and a designated communications port. After this function excutes, the Reader Wedge is not notified of receive buffer functions. You only need to use this procedure one time, at the end of your program.
Syntax:
#include <im20lib.h> IM_STATUS im_unlink_comm (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. 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_link_comm
Example See example for im_receive_input.
2-155
Page 185
im_viewport_end im_viewport_end Purpose:
This function sets the viewport to the lower right corner (end) of the virtual display.
Syntax:
#include <im20lib.h> void im_viewport_end(void);
IN Parameters:
None.
OUT Parameters:
None.
Return Value:
None.
Notes:
This function has no effect on the JANUS 2050.
See Also:
im_cursor_to_viewport, im_viewport_home, im_viewport_move, im_viewport_page_down, im_viewport_page_up, im_viewport_to_cursor
Example See example for im_viewport_setxy.
2-156
Page 186
im_viewport_getxy
2 im_viewport_getxy Purpose:
This function retrieves the column and row of the upper left corner of the viewport.
Syntax:
#include "im20lib.h" IM_STATUS im_viewport_getxy (IM_USHORT *row, IM_USHORT *col);
IN Parameters:
None.
OUT Parameters:
The row parameter returns the row value (Y-coordinate) of the viewport. The col parameter returns the column value (X-coordinate) of the viewport.
Return Value:
This function returns one of the standard status codes defined in Appendix A, “Status Codes.”
Notes:
This function is valid only when the display is in 80 x 25 mode. This function has no effect on the JANUS 2050.
See Also:
im_viewport_end, im_viewport_home, im_viewport_move, im_viewport_page_up, im_viewport_page_down, im_viewport_setxy, im_viewport_to_cursor
Example See example for im_viewport_setxy.
2-157
Page 187
im_viewport_home im_viewport_home Purpose:
This function sets the viewport to the upper left corner (home) of the virtual display.
Syntax:
#include <im20lib.h> void im_viewport_home(void);
IN Parameters:
None.
OUT Parameters:
None.
Return Value:
None.
Notes:
This function has no effect on the JANUS 2050.
See Also:
im_cursor_to_viewport, im_viewport_end, im_viewport_move, im_viewport_page_down, im_viewport_page_up, im_viewport_to_cursor
Example See example for im_viewport_setxy.
2-158
Page 188
im_viewport_move
2 im_viewport_move Purpose:
This function moves the viewport the specified distance and direction.
Syntax:
#include <im20lib.h> IM_STATUS im_viewport_move (IM_VIEWPORT_DIRECTION direction, IM_USHORT distance, IM_USHORT *row, IM_USHORT *col);
IN Parameters:
The direction parameter is one of these constants: IM_VIEWPORT_LEFT IM_VIEWPORT_RIGHT IM_VIEWPORT_UP IM_VIEWPORT_DOWN
Move left Move right Move up Move down
The distance parameter indicates the number of units to move the viewport and is either a numeric value between 1 and 70 or is IM_DEFAULT_DISTANCE. If the distance parameter is IM_DEFAULT_DISTANCE, the default step size is used. The distance moved is a configurable parameter. For more information on configuring the viewport, see your JANUS user’s manual. OUT Parameters:
The row parameter returns the row number to which the viewport has moved. The col parameter returns the column number to which the viewport has moved.
Return Value:
This function returns one of the standard status codes defined in Appendix A, “Status Codes.”
2-159
Page 189
im_viewport_move
Notes:
The (row, column) pair represents the upper left corner of the viewport being displayed. The minimum value for both the row and column is (0,0), which is the upper left corner of the virtual window. The maximum value is determined by the video mode and the number of lines and columns displayed. For example, for the normal video mode 3 (80 x 25 display) with a 20 x 16 display size, the maximum value of row is 9 (25 minus 16) and the maximum value of column is 60 (80 minus 20). The row and column viewport settings are set to the maximum allowed for the current mode and display size. To determine the actual values set, check the returned values of row and col. 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_cursor_to_viewport
Example See example for im_viewport_setxy.
2-160
Page 190
im_viewport_page_down
2 im_viewport_page_down Purpose:
This function moves the viewport down one viewport length.
Syntax:
#include <im20lib.h> void im_viewport_page_down(void);
IN Parameters:
None.
OUT Parameters:
None.
Return Value:
None.
Notes:
This function has no effect on the JANUS 2050.
See Also:
im_cursor_to_viewport, im_viewport_end, im_viewport_home, im_viewport_move, im_viewport_page_up, im_viewport_to_cursor
Example See example for im_viewport_setxy.
2-161