The text of a manual · part 10 of 25
TRAKKER T2090 Batch Hand-Held Computer User's Manual, pages 91 to 100
Pages 91 to 100 of 246
The original document is the PDF (737 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 T2090
Page 91
im_message
Notes
See Also
4
TRAKKER T2090 computers do not support IRL. This function provides compatibility with previous versions of PSK and is not recommended for new development. For more information on IRL and command Y, refer to the IRL Programming Reference Manual. im_irl_a, im_irl_k, im_irl_n, im_irl_v im_message Purpose
This function displays the error message associated with a specific status code returned by a PSK function. Use this function to display additional information about status codes during application development.
Syntax
#include "imt209x.h" void im_message(IM_USHORT status_code);
IN Parameters status_code
OUT Parameters
None.
Return Value
None.
Notes
Standard status code returned from various PSK functions.
The status message is displayed at the current cursor location without any formatting.
im_offset_dbyte Purpose
This function resets the offset of the first glyph in the current DBFS font.
Syntax
#include "imt209x.h" IM_STATUS im_offset_dbyte (IM_USHORT offset);
IN Parameters offset
OUT Parameters
None.
Return Value
New index of the first glyph in the fontfile (in glyphs).
This function returns one of these codes: IM_SUCCESS Offset changed. IM_INVALID_FUNCTION im_dbyte_setfont() must be called first.
4-31
Page 92
im_putchar
Notes See Also
The offset may be changed as often as desired. im_putchar_dbyte, im_puts_dbyte, im_dbyte_setfont im_putchar Purpose
This function places a character at the current cursor position and changes the line attribute to the specified attribute.
Syntax
#include "imt209x.h" IM_STATUS im_putchar (IM_UCHAR char, IM_ATTRIBUTES attrib);
IN Parameters char Specifies the character to be displayed attrib Specifies the display attribute for the character. Choose one of these constants: IM_NORMAL Plain text. IM_INVERSE Inverse color text. IM_UNDERLINE Underline text. IM_UNCHANGED Leave attribute unchanged.
OUT Parameters Return Value
None. This function returns one of these codes: IM_SUCCESS Success. IM_INVALID_PARAM_1 Invalid attribute value.
Notes
See Also
4-32
On the TRAKKER T2090 computer, placing a character with the IM_INVERSE attribute causes the entire line to be inverted. im_puts
Page 93
im_putchar_dbyte
4 im_putchar_dbyte Purpose
This function places the indicated glyph in the current DBFS font on the screen.
Syntax
#include "imt209x.h" IM_STATUS im_putchar_dbyte (IM_USHORT dbfschar, IM_ATTRIBUTES attrib);
IN Parameters dbfschar Index to the desired glyph in the fontfile (in glyphs). attrib Specifies the display attribute for the glyph. Choose one or more of these constants: IM_NORMAL
Set bits in the bitmap are set on the screen.
IM_INVERSE…….Cleared bits in the bitmap are set on the screen. Mutually exclusive with IM_NORMAL. IM_UNDERLINE The last row of pixels in the character cell are plotted as though they were set in the bitmap. IM_NOT_ADVANCING_CURSOR The cursor is not advanced after the glyph is plotted. This is useful in preventing scrolling when plotting a glyph in the last position of the last row. OUT Parameters Return Value
None. This function returns one of these codes: IM_SUCCESS Success. IM_INVALID_PARAM_1 Either a glyph could not be mapped or the attribute requested is invalid. Glyphs up to the bad mapping point will be plotted. IM_INVALID_FUNCTION first
Notes
See Also im_dbyte_setfont() must be called
Glyph 0 cannot be plotted with this function because that value is used to signify ‘end of string’. If offset is != 0, this is not a problem. im_dbyte_setfont, im_puts_dbyte, im_offset_dbyte
4-33
Page 94
im_puts im_puts Purpose
This function places a string on the screen at the current cursor location and appends a carriage return and line feed (CR LF) to the string.
Syntax
#include "imt209x.h" IM_STATUS im_puts (IM_UCHAR far *string, IM_ATTRIBUTES attrib);
IN Parameters string
Far pointer to the text string to be displayed.
attrib Specifies the display attribute for the string. Choose one of these constants: IM_NORMAL Plain text. IM_INVERSE Inverse color text. IM_UNDERLINE Underline text. IM_UNCHANGED Leave attribute unchanged. OUT Parameters Return Value
None. This function returns one of these codes: IM_SUCCESS Success. IM_BAD_ADDRESS Invalid string address. IM_INVALID_PARAM_2 Invalid attribute value.
Notes
See Also
4-34
On the TRAKKER T2090 computer, placing a character with the IM_INVERSE attribute causes the entire line to be inverted. im_cputs, im_putchar
Page 95
im_puts_dbyte
4 im_puts_dbyte Purpose
This function places the indicated glyphs in the current DBFS font on the screen.
Syntax
#include "imt209x.h" IM_STATUS im_puts_dbyte (IM_USHORT *dbfschar, IM_ATTRIBUTES attrib);
IN Parameters dbfschar Pointer to a series of indices for glyphs in the fontfile (in glyphs). Values of offset will plot the bitmap starting at 0 in the file. The series is terminated by 0x0000. attrib Specifies the display attribute for the glyphs. Choose one or more of these constants: IM_NORMAL Set bits in the bitmap are set on the screen. IM_INVERSE Cleared bits in the bitmap are set on the screen. Mutually exclusive with IM_NORMAL. IM_UNDERLINE The last row of pixels in the character cell are plotted as though they were set in the bitmap. IM_NOT_ADVANCING_CURSOR The cursor is not advanced after the glyph is plotted. This is useful in preventing scrolling when plotting a glyph in the last position of the last row, but causes successive characters in a string to be plotted in the same position.
OUT Parameters Return Value
None. This function returns one of these codes: IM_SUCCESS Success. IM_INVALID_PARAM_1 Either the glyph could not be mapped or the attribute requested is invalid. IM_INVALID_FUNCTION im_dbyte_setfont() must be called first.
Notes See Also
The string must be terminated by a double byte null (i.e., two bytes of 0). im_dbyte_setfont, im_putchar_dbyte, im_offset_dbyte
4-35
Page 96
im_receive_buffer im_receive_buffer Purpose
This function receives the contents of a data buffer from the serial communications port.
Syntax
#include "imt209x.h" IM_STATUS im_receive_buffer (IM_COM_PORT port_id, IM_USHORT length, IM_UCHAR far *data_buffer, IM_LTIME timeout, IM_USHORT far *comm_length);
IN Parameters port_id
Identifies the communications port. Use this constant:
IM_COM1 COM1 port. length
Specifies the maximum number of bytes to receive.
data_buffer Far pointer to the data array where you want to place the received data. This buffer must hold at least the number of bytes passed in as length. timeout Specifies the receive timeout period. Either enter a number from 0 to 4,294,967,294 to indicate the length of the timeout in milliseconds (55ms granularity), or choose one of these constants: IM_INFINITE_NET_TIMEOUT Never timeout. IM_ZERO_TIMEOUT No wait. OUT Parameters
Return Value comm_length Far pointer to the variable that will hold the actual number of bytes received upon completion of the call. If IM_SUCCESS is not returned this value will be 0. This function returns one of these codes: IM_SUCCESS Successfully received data. IM_NET_BAD_DATA Data pointer is null or invalid data length. IM_NET_DATA_LENGTH Data buffer size is too small for frame. IM_TIMEDOUT No data was received in the timeout period. IM_INVALID_PORT Invalid port_id. IM_BUFFER_OVERFLOW Receive buffer overflowed and needed to be flushed. This error will only be returned in character mode.
4-36
Page 97
im_receive_buffer
Notes
See Also
4
This function does not return until an end of message, a buffer is full, a timeout occurs or an error occurs. If no EOM character is defined, the function returns after a character is received. im_receive_field, im_transmit_buffer
Example /********************* im_receive_buffer *****************************/ #include <string.h> #include <conio.h> #include "stdio.h" #include "im209x.h" void main ( void ) { char szRxBuffer[1024]; IM_STATUS iStatus; IM_USHORT iCommLength; im_clear_screen(); iStatus = im_receive_buffer ( IM_NETUDP, 1024, szRxBuffer, 10000L, &iCommLength ); if(iStatus == IM_SUCCESS) printf("\nData Receive: %s, Length: %u\n", szRxBuffer, iCommLength); else { printf("\nReceive Buffer Err:\nStatus Code#: %x\n", iStatus); im_message(iStatus); } getch(); }
4-37
Page 98
im_receive_field im_receive_field Purpose
This function manages an input field area on the screen. You can specify display attributes for the field and control the length of the input data.
Syntax
#include "imt209x.h" IM_STATUS im_receive_field (IM_ORIGIN allowed, IM_UINT timeout, IM_ATTRIBUTES attrib IM_ULONG flags IM_SHORT length IM_ORIGIN *source, IM_CHAR *received);
IN Parameters allowed Defines the available input source. Choose one or more of these constants: IM_LABEL_SELECT Label selected. IM_KEYBOARD_SELECT Keypad selected. IM_COM1_SELECT COM1 selected IM_ALL_SELECT All sources selected. timeout Specifies the receive timeout period. Either enter a number from 1 to 65,534 to indicate the length of the timeout in milliseconds, or choose one of these constants: IM_ZERO_TIMEOUT No wait. IM_INFINITE_TIMEOUT Wait forever - the function does not return until the end of message character is received, a return is entered, or one of the conditions set with the flags parameter is met. If COM1 is selected, IM_INFINITE_TIMEOUT acts like IM_INFINITE_NET_TIMEOUT. attrib
Specifies the display attributes. Choose one of these constants:
IM_NORMAL Plain text. IM_INVERSE Inverse color text. IM_UNDERLINE Underline text. IM_UNCHANGED Leave attribute unchanged.
4-38
Page 99
im_receive_field flags
4
Controls the field action. Choose one or more of these constants:
IM_ERASE_FIELD Clear field data and display any field attributes on screen, filling the field area. If this flag is not set, the old data is displayed and the field is padded with blanks. Attributes are applied to the current row. IM_RETURN_ON_FULL If the input data fills the field, display the truncated data, and then exit the field. IM_RETURN_ON_FUNCTION If a function key is pressed, then display all of the data entered into the field and return the data in received. IM_DISPLAY_ONLY Display the field and its attributes without waiting for input. IM_AT_END Move the cursor to the end of the data already in the field. IM_STAY_IN_FIELD Cursor stays in the input field upon field exit. IM_NO_DISPLAY Receive input but do not echo the input to the display. IM_START_IN_INSERT Line editing mode is set to insert (default value). IM_UPCASE Changes input to upper case. IM_LOCASE Changes input to lower case. Note: If both IM_UPCASE and IM_LOCASE are set, then IM_UPCASE is used. If neither flag is set, keys are interpreted as pressed. length Defines the display field size. The buffer needs to be at least one byte larger. OUT Parameters source
Specifies the actual input source and is one of these constants:
IM_NO_SELECT No selection made. IM_LABEL_SELECT Label selected. IM_KEYBOARD_SELECT Keypad selected. IM_COM1_SELECT COM1 selected. received Return Value
Pointer to the variable where the data is placed.
This function returns one of these codes: IM_SUCCESS Successfully received input. IM_TIMEDOUT Timeout occurred.
4-39
Page 100
im_receive_field
IM_INPUT_FULL Maximum number of characters was received and input was stopped. All characters entered are returned. IM_RETURN_F1 F1 was received. IM_RETURN_F2 F2 was received. IM_RETURN_F3 F3 was received. Notes
If input from more than one source is received before this function is called, the first available input is returned in this order: label, keypad, and COM1. When allowed is set to IM_COM1_SELECT and timeout is set to IM_INFINITE_TIMEOUT, this function performs as if timeout were set to IM_INFINITE_NET_TIMEOUT.
See Also im_receive_buffer
Example /********************* im_receive_field*******************************/ /*Example of doing a data input screen using im_receive_field */ /* Also validates input for length and draws box. */ #include "imt209x.h" #include "string.h" /* Fields and prompts */ char sBadge[10] ={0}, sPart[26]={0}, sOrderNo[10]={0}; char Label0[] ="Job Setup", Label1[]="Enter Badge:", Label2[] ="Scan Part Number:", Label3[] = "Enter Order Number:"; #define FIELD_FLAGS IM_RETURN_ON_TAB | IM_RETURN_ON_FULL | IM_AT_END /* Table of information to drive display and data input */ struct screen{ char * pszText; IM_USHORT iRow, iCol, iLength, iMinLength; IM_ATTRIBUTES iAttribute; IM_USHORT iFlags; } aScreen[] = { { Label0 , 1, 5, sizeof(Label0)-1, 0, IM_NORMAL, IM_DISPLAY_ONLY }, { Label1 , 3, 1, sizeof(Label1)-1, 0, IM_NORMAL, IM_DISPLAY_ONLY }, { Label2 , 5, 1, sizeof(Label2)-1, 0, IM_NORMAL, IM_DISPLAY_ONLY }, { sBadge , 4, 1, 9, 3, IM_INVERSE, FIELD_FLAGS }, { sPart , 6, 1, 25, 0, IM_INVERSE, FIELD_FLAGS }, {(void *)0,0,0,0,0,0} /*Termination line*/ }; /*note that sizeof includes the null terminator and we pass in the displayable size*/ /* Simple example validation routine. */ IM_BOOL DoValidation ( char * szField, IM_USHORT iMinLength ) { if ( (IM_USHORT)strlen( szField ) >= iMinLength ) return IM_TRUE; else { im_status_line("Input to short", IM_TRUE, 50); return IM_FALSE; } }
4-40