Browse
(440) 299-7778
Menu
(440) 299-7778
One-year parts and labor warranty30-day money-back guaranteeEnglishEspañolContact

The text of a manual · part 17 of 42

JANUS PSK for C/C++ Reference Manual, Version 2.1, pages 161 to 170

Pages 161 to 170 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 161

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-132

Page 162

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-133

Page 163

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-134

Page 164

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-135

Page 165

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-136

Page 166

im_setup_trx

2

The db_protocol parameter is one or more of these constants: IM_DBPACE_ENABLE

Enable pacing for database read. The database sends one record to the reader and then waits for a request for the next record. Default is on.

IM_BATCH_ENABLE

Store all records in standby file, if one is enabled with hsafety. Default is off, no standby file.

IM_DOBEST_ENABLE

Ignore NAK and continue sending records when uploading standby records. Default is off: stop sending records on NAK.

The sys_delimiter parameter is the default transaction ID delimiter set in DCM. Default is a comma (,). The parse_char parameter is the user-defined, data field-specific delimiter set in DCM. Default is a comma (,). The packet_max_len parameter defines the maximum length for a transaction packet and is one of these values: 0 -1 1-256

Use the default value and do not send a value. Use the previous setting. Set the maximum length to this number. Default is 256.

The hsafety parameter is the file handler for the standby file. Valid values are: 0 num

No standby file. Default. Use a standby file. A nonzero value that is the file handler created from open( ). See Notes below.

OUT Parameters:

None.

Return Value:

This function returns one of the status codes from the following table. For more information on these return codes, see Chapter 5, “Using the PSK With DCM.” IM_DCM_OK IM_DCM_FILE_ERR

1A00 9A09

Protocol parameters set successfully Standby file I/O error

2-137

Page 167

im_setup_trx

Notes:

To use a standby file, you must set hSafety by opening the file. The action of the standby file is determined by IM_BATCH_ENABLE. If IM_BATCH_ENABLE is off, only transactions that cannot be sent are logged into the file. Usually this happens when the transmission times out. If IM_BATCH_ENABLE is on, then all transactions are logged into the standby file. To transmit the standby file, you must set IM_BATCH_ENABLE to off, or use im_standard_trx with IM_ZIP_STANDBY to flush the standby records. See Chapter 5, “Using the PSK With DCM.”

See Also:

im_standard_trx, im_parse_host_response

Example See the sample program in Chapter 5, “Using the PSK With DCM.”

2-138

Page 168

im_sound

2 im_sound Purpose:

This function generates a beep of specified pitch and duration. For example, use a soft beep for library use, a loud beep for manufacturing use, or a unique beep to distinguish between other readers.

Syntax:

#include <im20lib.h> IM_STATUS im_sound (IM_USHORT pitch, IM_USHORT duration, IM_USHORT volume);

IN Parameters:

The pitch parameter is the frequency of the beep you want the reader to make. The numeric range for pitch is from 20 to 20,000 Hz. You can also use one of these constants: IM_HIGH_PITCH IM_LOW_PITCH IM_VERY_LOW_PITCH

2400 Hz 1200 Hz 600 Hz

The duration parameter is the length of the beep. The numeric range for duration is from 1 to 65,000 ms. You can also use one of these constants: IM_BEEP_DURATION IM_CLICK_DURATION

50 ms 4 ms

The volume parameter is one of these constants: IM_OFF_VOLUME IM_QUIET_VOLUME IM_NORMAL_VOLUME IM_LOUD_VOLUME IM_EXTRA_LOUD_VOLUME IM_CURRENT_VOLUME

Volume is off Volume is quiet Volume is normal Volume is loud Volume is extra loud Volume is the current volume

OUT Parameters:

None.

Return Value:

This function returns one of the standard status codes defined in Appendix A, “Status Codes.”

2-139

Page 169

im_sound

Example /******************** im_sound *************************************/ #include <time.h> #include <conio.h> #include <im20lib.h> enum NOTES /* Enumeration of notes and frequencies */ { C0 = 262, D0 = 296, E0 = 330, F0 = 349, G0 = 392, A0 = 440, B0 = 494, C1 = 523, D1 = 587, E1 = 659, F1 = 698, G1 = 784, A1 = 880, B1 = 988, EIGHTH = 125, QUARTER = 250, HALF = 500, WHOLE = 1000, END = 0 } song[] = /* Array initialized to notes of song */ { C1, HALF, G0, HALF, A0, HALF, E0, HALF, F0, HALF, E0, QUARTER, D0, QUARTER, C0, WHOLE, END }; /* Predefined the play volume */ IM_USHORT volume[] = { IM_NORMAL_VOLUME, IM_EXTRA_LOUD_VOLUME, IM_QUIET_VOLUME, IM_NORMAL_VOLUME };

/* Play normal volume */ /* Play extra loud volume */ /* Play quiet volume */ /* Play normal volume */ void main (void) { int note; int index; /* Play 4 times with 5 seconds dealy between each play */ for ( index = 0; index < 4; index++) { for ( note = 0; song[note] != 0; note += 2 ) im_sound( song[note], song[note + 1], volume[index]); /* Delay 5 seconds for next throughput*/ im_standby_wait(5000); } }

2-140

Page 170

im_standard_trx

2 im_standard_trx Purpose:

This function packs reader data into a DCM transaction. The function packs the data, transmits the packed transaction through a communications port, and then reads the host response message from the communications port. For a detailed discussion of programming database transactions, see Chapter 5, “Using the PSK With DCM.”

Syntax:

#include "im20lib.h" IM_USHORT im_standard_trx (IM_UCHAR *trans_id, IM_UCHAR request_type, IM_UCHAR *send_var_array[], IM_USHORT max_str_len, IM_UCHAR *ret_string, IM_DCMSTRN ret_array[], IM_UCHAR *oper_type);

IN Parameters:

The *trans_id parameter is a pointer to the transaction ID string. The transaction ID must match the ID already defined in DCM. See the example in Chapter 5, “Using the PSK With DCM.” The request_type parameter is associated with the transaction ID and either accesses the remote database or manipulates the standby file. The request_type is one of these constants: For Accessing the Remote Database IM_DBRQT_DATA IM_DBRQT_NEXTROW IM_DBRQT_DISCARD

D N S

Request data Request next row Delete the following records

For Manipulating the Standby File IM_ERROR_RECORD

E

Report error record without advancing the record pointer in the standby file

IM_ADVANCE_RECORD A

Report error record and advance the record pointer in the standby file

IM_ZIP_STANDBY

Flush the standby records

Z

2-141