The text of a manual · part 12 of 25
TRAKKER T2090 Batch Hand-Held Computer User's Manual, pages 111 to 120
Pages 111 to 120 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 111
im_sound
Return Value
4
This function returns one of these codes: IM_SUCCESS Success. IM_SCAN_PORT_NOT_OPEN The port was not open. IM_SCAN_PORT_FAILED The port failed to open for scanning. IM_COMM_PORT_OPENED The port is open for serial communication. The port must be closed before the T2090 computer can scan. IM_RESUME_OCCURRED The function determined that the T2090 computer recently came out of Suspend mode. IM_UNIT_DOCKED The T2090 computer was docked in the cradle when the scanner was activated.
im_sound Purpose
This function generates a beep of specified pitch and duration. For example, use no beep or a short beep for library use, a long beep for manufacturing use, or a unique beep to distinguish among other computers.
Syntax
#include "imt209x.h" IM_STATUS im_sound (IM_USHORT pitch, IM_USHORT duration, IM_USHORT volume);
IN Parameters pitch Specifies the frequency of the beep you want the computer to make. Either enter a number from 20 to 8189 to indicate the pitch in Hz, or choose one of these constants: IM_HIGH_PITCH
2400 Hz.
IM_LOW_PITCH 1200 Hz. IM_VERY_LOW_PITCH 600 Hz. duration Specifies the length of the beep. Either enter a number from 2 to 79999 to indicate the duration of the beep in milliseconds, or choose one of these constants (55 ms granularity): IM_BEEP_DURATION 50 ms. IM_CLICK_DURATION 5 ms.
4-51
Page 112
im_standby_wait volume
Specifies the volume. Choose one of these constants:
IM_OFF_VOLUME Off. IM_QUIET_VOLUME Quiet. IM_NORMAL_VOLUME
Normal.
IM_LOUD_VOLUME Loud. IM_EXTRA_LOUD_VOLUME Extra loud. IM_CURRENT_VOLUME Use volume from configuration menu. OUT Parameters Return Value
None. This function returns one of these codes: IM_SUCCESS Successful beep. IM_INVALID_PARAM1 Pitch is outside allowed range. IM_INVALID_PARAM2 Duration is outside allowed range. IM_INVALID_PARAM3 Volume is outside allowed range.
Notes
The beep volumes for quiet, normal, loud, and extra loud are actually all the same volume on the TRAKKER T2090 computer.
im_standby_wait Purpose
This function places the application and computer in standby mode for a specific period of time to save the battery power.
Syntax
#include "imt209x.h" IM_STATUS im_standby_wait (IM_USHORT timeout);
IN Parameters timeout Specifies the amount of time to wait in standby mode. Either enter a number from 1 to 65,535 (resolution of 10 ms) 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.
OUT Parameters Return Value
4-52
None. IM_SUCCESS Success.
Page 113
im_status_line
4 im_status_line Purpose
This function briefly displays an error message in the status line without wrapping or scrolling the display. The status line is displayed until a key is pressed or a time out occurs. The original contents of the line reappear after the message is erased.
Syntax
#include "imt209x.h" IM_STATUS im_status_line (char far *stmessage IM_BOOL wait IM_USHORT row);
IN Parameters stmessage
Pointer to the error message string to display.
wait Specifies if the application should wait for a key to be pressed. Choose one of these values: 0 Do not wait for a key. non-zero Pause until any key is pressed or until a timeout occurs. row Row number to display the message in. If this number is larger than the number of visible rows, the last row is used. The first row is 0. OUT Parameters Return Value Notes
None. Returns 0 or the key pressed to terminate waiting. If the wait parameter is set, the message will be erased after 20 seconds or when a key is pressed. Then, the screen is refreshed to look as it did before displaying the message.
4-53
Page 114
im_timed_status_line im_timed_status_line Purpose
This function displays an error message in the status line without wrapping or scrolling the display. The status line is displayed until a key is pressed or a time out occurs. The original contents of the line reappear after the message is erased.
Syntax
#include "imt209x.h" void im_timed_status_line (char far *string, IM_USHORT timeout IM_USHORT line);
IN Parameters string
String to be displayed.
timeout Number of milliseconds to wait before erasing the string. Either enter a number from 1 to 65,535 (resolution of 10 ms) 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. line Positive number identifying the line, relative to the top of the screen, where the string is to be displayed. If this number is larger than the number of lines on the screen, the last line is used. The first line is 0. OUT Parameters
None.
Return Value
None.
See Also
4-54 im_status_line
Page 115
im_tm_callback_cancel
4 im_tm_callback_cancel Purpose
This function removes a registered function from the timer callback database.
Syntax
#include "imt209x.h" IM_STATUS im_tm_callback_cancel (IM_USHORT index);
IN Parameters
OUT Parameters Return Value index Identifies the registered function in the timer callback database. This number was returned by im_tm_callback_register when the function was added to the timer callback database. None. This function returns one of these codes: IM_SUCCESS Success. IM_INVALID_INDEX The value for index is invalid.
See Also im_tm_callback_register
Example
See example for im_tm_callback_register.
4-55
Page 116
im_tm_callback_register im_tm_callback_register Purpose
This function adds a function to the timer callback database and specifies how the function will be called back.
Syntax
#include "imt209x.h" IM_STATUS im_tm_callback_register (PTIMERCALLBACK function, time_t start_time, IM_USHORT repeat_count IM_ULONG period, IM_BOOL fDisable, IM_USHORT *index);
IN Parameters function Pointer to the function to be called. start_time Specifies when to perform the first callback. Either enter the time as the number of seconds elapsed since midnight on January 1, 1970, or choose this constant: IM_CALLBK_NOW Start the first callback immediately. repeat_count Specifies the number of callbacks. Either enter any number from 2 to 65534 (two-byte range of IM_USHORT), or choose one of these constants: IM_CALLBK_ONCE Callback once. IM_CALLBK_CONTINUOUS Callback continuously. period Specifies the interval between callbacks. Either enter any number to indicate the interval in seconds, or choose one of these constants: IM_CALLBK_SECOND Callback every second. IM_CALLBK_MINUTE Callback every minute. IM_CALLBACK_HOUR Callback every hour. IM_CALLBK_DAY Callback every day. IM_CALLBK_WEEK Callback every week. IM_CALLBK_MONTH Callback every month. IM_CALLBK_QUARTER Callback every quarter. IM_CALLBK_YEAR Callback every year.
4-56
Page 117
im_tm_callback_register
4 fDisable Specifies whether the callback is enabled or disabled if the application does not control the screen. Use this constant only: IM_FALSE Enable callback whether or not the application controls the screen. OUT Parameters Return Value index
Index number for the function in the timer callback database.
This function returns one of these codes: IM_SUCCESS Success. IM_TMCALLBK_TABLE_FULL Timer callback database table is full. IM_INVALID_TMCALLBK_PERIOD The period value is out of range. IM_INVALID_TMCALLBK_REPETITION The repeat_count value is out of range.
Notes
You must specify the index value when you use im_tm_callback_cancel to remove the function from the timer callback database. Because the T2090 is a DOS unitasking environment, the application always controls the screen. The application does not release control of the screen until all the callbacks have been completed or until the user terminates the function call by entering Q to quit the loop. Therefore, you set the fDisable parameter to IM_FALSE.
See Also im_tm_callback_cancel
4-57
Page 118
im_tm_callback_register
Example
#include <time.h> #include <stdio.h> #include “imt209x.h” void printHello(void) { im_sound(1000,50,IM_NORMAL_VOLUME); im_puts("hello world! ",IM_NORMAL); } void main(void) { IM_UCHAR input[300]; IM_ORIGIN source; IM_STATUS iStatus = 11; PTIMERCALLBACK pFunction; IM_USHORT iIndex = 0; time_t timeToStart; IM_BOOL fDisplay; IM_USHORT iRepeatCount; IM_ULONG iPeriod; //initialize // callback 10 times iRepeatCount = 10; // 10-second period iPeriod = IM_CALLBK_SECOND*10; //print hello pFunction = printHello; //enable callback fDisplay = IM_FALSE; //time to first callback time(&timeToStart); //get current time timeToStart += 16; //future after 16seconds or //timeToStart -= 20; // or pass current 20 seconds //timeToStart = IM_CALLBK_NOW; //register the callback function iStatus = im_tm_callback_register(pFunction, timeToStart, iRepeatCount, iPeriod, fDisplay, &iIndex); //cancel the callback function iStatus = im_tm_callback_cancel(iIndex); }
4-58
Page 119
im_transmit_buffer
4 im_transmit_buffer Purpose
This function transmits the contents of a data buffer through the serial communications port. This function continues operating until the buffer transmission is complete or until an error status is detected.
Syntax
#include "imt209x.h" IM_STATUS im_transmit_buffer (IM_COM_PORT port_id, IM_USHORT length, IM_UCHAR far *data_buffer, IM_LTIME timeout);
IN Parameters port_id
Identifies the communications port. Use this constant:
IM_COM1 COM1 selected. length
Length of the data string that you want to transmit.
data_buffer
Far pointer to the data array that you want to transmit.
timeout Specifies the transmit timeout period. Either enter a number from 0 to 4,294,967.294 to indicate the length of the timeout in milliseconds, or choose one of these constants: IM_INFINITE_NET_TIMEOUT Never timeout. IM_ZERO_TIMEOUT No wait. OUT Parameters Return Value
None. This function returns one of these codes: IM_SUCCESS Transmit completed. IM_NET_BAD_DATA Data pointer is null or invalid data length. IM_TIMEDOUT ACK not received or function timeout expired. IM_INVALID_PORT Invalid port_id. IM_NET_CONFIG_ERROR Incorrect configuration or hardware fault.
Notes
For IM_COM1, a numeric timeout larger than 65534 is converted to 65534. The hardware cannot support long timeout values. The timeout granularity is 55 ms. Once the transmission begins, program control remains inside this function until the transmission is completed. There is no way to check the transmission status while transmitting.
4-59
Page 120
im_transmit_buffer
See Also im_receive_buffer
Example /********************* im_transmit_buffer ****************************/ #include <string.h> #include <conio.h> #include "stdio.h" #include "im209x.h" void main ( void ) { char szTxBuffer[1024]; IM_STATUS iStatus; im_clear_screen(); strcpy ( szTxBuffer, "MSG_HEADER,Testing Message 1, 2, 3, ..." ); iStatus = im_transmit_buffer ( IM_COM1, strlen(szTxBuffer), szTxBuffer, 5000 ); if(iStatus == IM_SUCCESS) { printf("\nData sent: %s\n", szTxBuffer); } else { printf("\nTransmit Buffer Error: "); im_message(iStatus); } getch(); }
4-60