The text of a manual · part 19 of 36
Trakker Antares Application Development Tools System Manual: Part I - Trakker Antares PSK Reference Manual, pages 175 to 184
Pages 175 to 184 of 340, from Trakker Antares Application Development Tools System Manual
The original document is the PDF (1.6 MB). This is its text as extracted, unedited; tables and drawings read best in the PDF, and each page heading opens it at that page.
Filed in the catalog under the Intermec 2420, Intermec 2425, Intermec 2435 and Intermec 2481
Page 175
Chapter 5, PSK Function Descriptions
Notes
You need to enable mixed mode to display Thai characters on the terminal. Currently, the Application Simulator cannot support double-byte characters. The 2460 and 2461 terminals do not support this function.
im_set_no_autosend Purpose
Syntax
This function determines how im_transmit_buffer and its variations should remember the data buffer last sent to the host. If the autosend feature is enabled and a network error was detected since the last call to im_transmit_buffer, the old data buffer will be re-sent. #include "imt24lib.h" void im_set_no_autosend ( IM_BOOL iBValue);
IN Parameters iBValue
One of these constants: IM_TRUE Disable autosend feature IM_FALSE Enable autosend feature
Note: Intermec recommends that you not rely on the default iBValue constant (IM_TRUE), because it is compiler dependent. OUT Parameters
None
Return Value
None
Notes
The application is responsible for ensuring that a data buffer is not sent twice. The autosend feature is only appropriate in some cases. For example, this is one scenario demonstrating how extra data can be sent: 1 The im_set_no_autosend function is enabled. 2 Client sends a data buffer to the host. 3 Server acknowledges the data and the client ignores it. 4 Period of inactivity in the network. 5 Server goes down while the client is not checking for network status. 6 Server comes up. 7 Client requests to send more data. 8 Client machine’s transport realizes and error has occurred and attempts to re-establish a new TCP connection. 9 PSK re-sends the old data buffer before sending the new data buffer. 10 Server ACK’d two data packets for the new connection.
Trakker Antares PSK Reference Manual
155
Page 176
Chapter 5, PSK Function Descriptions im_set_optical_callback Purpose
This function sets a pointer to a function that will be called if an optical sensor input changes during a call to im_receive_field. This is very similar to an interrupt handler. This allows im_receive_field to continue looking for input from the allowed sources even if a change in an optical sensor occurs. When this happens, the specified function is called that then returns IM_TRUE or IM_FALSE to im_receive_field that will either continue or return back to its calling routine. This function is valid only on a 248X with the enhanced input/output board option.
Syntax
IN Parameters
#include "imt24lib.h" void im_set_optical_callback (OPTCALLBACK pCallBack);
pCallBack
Pointer to a callback function. OPTCALLBACK is defined as: typedef IM_STATUS (* OPTCALLBACK )( void );
If set, pCallBack points to a function that is called if the status of the optical sensor changes during a call to im_receive_field. If im_receive_field detects a change in the sensor status, im_receive_field calls the specified function. This callback function can do whatever you want it to, but should return either IM_TRUE or IM_FALSE to im_receive_field. If the callback function returns IM_TRUE, im_receive_field returns the status of the optical sensors in the buffer to the caller. See im_receive_field for more details on the format of the returned data. If the callback function returns IM_FALSE, im_receive_field continues to wait for input from the specified sources. To cancel the callback function, pass a NULL pointer as a parameter to this function. For example, im_set_optical_callback(NULL);
156
OUT Parameters
None
Return Value
None
Trakker Antares PSK Reference Manual
Page 177
Chapter 5, PSK Function Descriptions
Example /******************** im_set_optical_callback **************/ /* Use this function with im_receive_field #include <string.h> #include "imstdio.h" #include "imt24lib.h"
*/
IM_UCHAR szRxBuffer[256]; /* prototype call back function */ IM_STATUS optical_callback(void); main(void) { char c; int iStatus; IM_SENSOR_STATE iSensorState; IM_ORIGIN iOrigin, iSource; /* Use im_receive_field() */ do { im_set_optical_callback( (OPTCALLBACK) optical_callback); /* Trigger optical sensor input */ /* Shall see call back message */ iOrigin = IM_OPTICAL_SELECT | IM_KEYBOARD_SELECT; iStatus = im_receive_field(iOrigin, IM_INFINITE_TIMEOUT,0, IM_RETURN_ON_FULL, 20, &iSource, szRxBuffer); printf("iSource: %X\n", iSource); printf("Opt-State: %X\n", *szRxBuffer); printf("Opt-Change: %X\n", *(szRxBuffer+1)); getch(); /* Clear call back function's pointer */ im_set_optical_callback(NULL); /* Trigger optical sensor input */ /* Shall not see call back message */ iOrigin = IM_OPTICAL_SELECT | IM_KEYBOARD_SELECT; iStatus = im_receive_field(iOrigin, IM_INFINITE_TIMEOUT,0, IM_RETURN_ON_FULL, 20, &iSource, szRxBuffer); printf("iSource: %X\n", iSource); printf("Opt-State: %X\n", *szRxBuffer); printf("Opt-Change: %X\n", *(szRxBuffer+1)); getch(); printf("Continue(Y/N)?"); c = getch(); } while ( c== 'Y' || c == 'y'
);
}
Trakker Antares PSK Reference Manual
157
Page 178
Chapter 5, PSK Function Descriptions im_set_relay Purpose Syntax
IN Parameters
This function opens or closes the specified terminal relay. This function is valid only on a 248X with the enhanced input/output board option. #include "imt24lib.h" IM_STATUS im_set_relay (IM_RELAY_PORT iRelayID, IM_RELAY_CONTROL fEnergizeRelay)
iRelayID fEnergizeRelay
OUT Parameters Return Value
One of these constants: IM_RELAY1 IM_RELAY2 IM_RELAY3 IM_RELAY4 One of these constants: IM_CONTACT_ON IM_CONTACT_OFF
Close or energize the relay Open or de-energize the relay
None This function returns one of these codes: IM_SUCCESS IM_DIO_CONFIG_ERROR IM_INVALID_PORT
Notes
Relay 1 selected Relay 2 selected Relay 3 selected Relay 4 selected
Success Relay configuration error Invalid relay port selected iRelayId is mutually exclusive and cannot be ORed together.
Example See example for im_get_relay on page 89.
im_set_repeat_key Purpose
Syntax
158
This function sets the repeat key delay so you can press and hold a key and get the same character to repeat on the terminal display. This function is only valid on 242X terminals. #include "imt24lib.h" IM_STATUS im_set_repeat_key (IM_USHORT initDelay, IM_USHORT repeatDelay)
Trakker Antares PSK Reference Manual
Page 179
Chapter 5, PSK Function Descriptions
IN Parameters initDelay
Delay, in milliseconds, after first key is pressed. Zero disables this parameter. Delay, in milliseconds, after the key is held down. Zero disables this parameter.
repeatDelay OUT Parameters Return Value
None This function returns one of these codes: IM_SUCCESS IM_SUB_FUNC_INVALID
Success Invalid function request. Older version of firmware is loaded.
im_set_scanning Purpose Syntax
IN Parameters
This function enables or disables the scanner port. #include "imt24lib.h" void im_set_scanning (IM_CONTROL EnableDisable)
EnableDisable
OUT Parameters
None
Return Value
None
Notes
Pointer to IM_UCHAR and is one of these constants: IM_ENABLE Enable scanner port IM_DISABLE Disable scanner port
The Application Simulator does not simulate this function.
im_set_screen_size Purpose
Syntax
This function lets you easily configure a proportional screen for a handheld terminal (241X, 242X, 243X). You define the number of rows and columns that you want the screen to display and the largest font that will fit in the screen using these constraints is chosen. Then, the row and column spacing is adjusted for the best fit on the screen. #include "imt24lib.h" IM_STATUS im_set_screen_size (IM_USHORT iColumns, IM_USHORT iRows)
IN Parameters iColumns iRows
Trakker Antares PSK Reference Manual
Number of columns (up to 31) that you want the screen to display. If you enter a number greater than 31, 31 is used. Number of rows (up to 21) that you want the screen to display. If you enter a number greater than 21, 21 is used.
159
Page 180
Chapter 5, PSK Function Descriptions im_set_screen_size (continued) OUT Parameters Return Value
None This function returns one of these codes: IM_SUCCESS IM_SUB_FUNC_INVALID
Notes
Success Invalid function request. Older version of firmware is loaded.
If you set both the row and column to 0, the default 8x8 font will be used. If the terminal is not a handheld terminal, the same process to choose the fonts and spacing is used as if the terminal is a handheld terminal. Functions that return screen size values for rows and columns will return the actual values instead of the values that you set using this function. Some row/column combinations may not be valid because of the underlying capability of the terminal screen. If you choose an invalid combination, the screen will display the closest size that has at least the requested rows and columns. For example, if you request 15x20, the screen will display 16x20. The Application Simulator does not attempt to simulate the font and spacing set by this function. However, it will use the results to determine where to draw the screen boundaries and where to apply wrap and scroll properties to text. The 2460 and 2461 terminals do not support this function.
im_set_thai_cursor_mode Purpose Syntax
This function sets the cursor mode for Thai characters. #include "imt24lib.h" void im_set_thai_cursor_mode (IM_USHORT ThaiCursorMode);
IN Parameters ThaiCursorMode
OUT Parameters
None
Return Value
None
Notes
160
Pointer to IM_USHORT and is one of these constants: IM_TRUE Turn on cursor mode for Thai characters IM_FALSE Turn off cursor mode for Thai characters
You must have the Thai character set installed on the host in order to use this function.
Trakker Antares PSK Reference Manual
Page 181
Chapter 5, PSK Function Descriptions im_set_time_event Purpose
Syntax
This function starts a timer that runs from 0 to 65,534 ms. After reaching the upper limit, a timeout event occurs that can be recognized by the im_event_wait function or any of the input functions. #include "imt24lib.h" IM_STATUS im_set_time_event (IM_UINT timeout)
IN Parameters timeout OUT Parameters Return Value
Number of milliseconds, from 0 to 65,534, to wait before a timeout event occurs.
None This function returns one of these codes: IM_SUCCESS E_TABLE_FULL
Notes
Successfully started timer No more timer services available, timeout not established
The timer is accurate within 5 ms. If you call this function again before the timer reaches the value passed in, the timer is reset to 0 and starts counting toward the passed in value again. When the timeout occurs and IM_TIMER_SELECT is an allowed source for the im_event_wait or im_event_status function, IM_TIMER_SELECT is returned as the source for that function.
See Also im_event_wait, im_event_status, im_receive_input, im_receive_field
Example See example for im_event_wait on page 61.
Trakker Antares PSK Reference Manual
161
Page 182
Chapter 5, PSK Function Descriptions im_set_validation_callback Purpose
Syntax
IN Parameters
This function sets a pointer to a function that will be called when im_receive_field is receiving data (characters) from the terminal keypad in order to validate the data or to control the editing of the data. #include "imt24lib.h" void im_set_validation (VALCALLBACK callback)
callback
Pointer to a callback function. VALCALLBACK is defined as: typedef IM_STATUS (* VALCALLBACK )( void );
If set, pCallBack points to a callback function that is called when data from the terminal keypad is received during a call to im_receive_field. For each key that is pressed, im_receive_field passes the ASCII value of the key, a pointer to a variable containing the character offset in the string/field, and a pointer to the string as it currently exists to the callback function. The function can validate the data and return IM_TRUE for success, IM_FALSE for fail, or IM_USER_MODIFIED if the function modified the string. • If the callback function returns IM_TRUE, im_receive_field handles the keypad data as normal input and inserts/appends data to string. See im_receive_field for more details on the format of the returned data. • If the callback function returns IM_FALSE, im_receive_field ignores the keystrokes and continues to wait for input from the keypad. To cancel the callback function, pass a NULL pointer as a parameter to this function. For example, im_set_validation(NULL);
• If the callback function returns IM_USER_MODIFIED, im_receive_field ignores the keystrokes, assuming that the callback function already inserted the data, and redisplays the field. OUT Parameters
None
Return Value
None
Example See example for im_receive_field on page 141.
162
Trakker Antares PSK Reference Manual
Page 183
Chapter 5, PSK Function Descriptions im_set_viewport_lock Purpose Syntax
IN Parameters
OUT Parameters Return Value
This function enables or disables the keys that move the viewport. #include "imt24lib.h" IM_STATUS im_set_viewport_lock (IM_CONTROL view_lock);
view_lock
One of these constants: IM_ENABLE Lock the viewport (keys cannot move viewport) IM_DISABLE Unlock the viewport
None This function returns one of these codes: IM_SUCCESS IM_VP_DISABLED
Notes
Successfully locked Viewporting disabled, but viewport lock is set for when viewporting is enabled
This function controls whether the viewport moves (unlocked) or does not move (locked) when the cursor movement keys are pressed. The 2460 and 2461 terminals do not support this function.
See Also im_get_viewport_lock, im_set_follow_cursor
Example See example for im_get_viewport_lock on page 100.
im_set_viewporting Purpose
Syntax
This function enables and disables viewporting without changing the viewport lock. When viewporting is enabled, the terminal accepts viewport movement commands. #include "imt24lib.h" void im_set_viewporting (IM_CONTROL viewport);
IN Parameters viewport
OUT Parameters
None
Return Value
None
Trakker Antares PSK Reference Manual
Flag that is one of these constants: IM_ENABLE Enable viewporting IM_DISABLE Disable viewporting
163
Page 184
Chapter 5, PSK Function Descriptions im_set_viewporting (continued) Notes
If viewporting is enabled, the terminal accepts viewport movement commands, including follow-the-cursor mode. All cursor positioning is relative to the virtual display. When viewporting is enabled and the viewport lock is disabled, you can move the viewport with the cursor movement keys, such as Viewport Page Up ( ) 9 ). If viewporting is disabled, the terminal does not accept any viewport movement commands. All cursor positioning is relative to the viewport upper left corner. The 2460 and 2461 terminals do not support this function.
See Also im_get_viewport_lock, im_set_follow_cursor, im_set_viewport_lock
Example See example for im_receive_field on page 141.
im_setup_follow_cursor Purpose
Syntax
IN Parameters
This function specifies how close the cursor can get to the edge of the viewport, and how far it should move when follow-the-cursor is enabled. Viewport movement is bounded by the virtual screen. #include "imt24lib.h" IM_STATUS im_setup_follow_cursor (IM_UCHAR side_boundary, IM_UCHAR vert_boundary, IM_UCHAR side_move, IM_UCHAR vert_move);
side_boundary vert_boundary side_move vert_move OUT Parameters
164
Defines the right edge limit. The viewport moves when the cursor is within the specified number of characters from the edge. The default value is 1. Defines top and bottom edge limit. The viewport moves when the cursor is within the specified number of characters from the top or bottom. The default value is 1. Defines the number of characters to move the viewport left or right. The default value is 10. Defines the number of characters to move the viewport up or down. The default value is 8.
None
Trakker Antares PSK Reference Manual