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 12 of 28

6400 PSK Reference Manual, pages 111 to 120

Pages 111 to 120 of 272

The original document is the PDF (1.1 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.

For the Intermec 6400

Page 111

im_isgood

5 im_isgood Purpose:

This macro determines if the return status code from another PSK function is a success. For more information, see “Status Code Macros” in Chapter 2.

Syntax:

#include "im64psk.h" IM_ISGOOD(status);

IN Parameters:

status

OUT Parameters:

None.

Return Value:

See Also:

Any PSK function that returns a status code.

This function returns one of these codes: 0

Warning or error

Nonzero

Success

IM_ISERROR, IM_ISSUCCESS, IM_ISWARN

Example /********************* IM_ISGOOD ************************************/ #include "im64psk.h" printf("IM_ISGOOD Example") status = im_sound(IM_LOW_PITCH, IM_BEEP_DURATION, IM_NORMAL_VOLUME) if IM_ISGOOD(status) printf(“Beep Successful!”); else im_cputs(“Beep warning or error!”, IM_NORMNAL);

5-55

Page 112

im_issuccess im_issuccess Purpose:

This macro determines if the return status code from another PSK function is either success or warning.

Syntax:

#include "im64psk.h" IM_ISSUCCESS(status);

IN Parameters:

status

OUT Parameters:

None.

Return Value:

See Also:

Any PSK function that returns a status code.

This function returns one of these codes: 0

Error

Nonzero

Success or warning

IM_ISERROR, IM_ISGOOD, IM_ISWARN

Example /********************* IM_ISSUCCESS ************************************/ #include "im64psk.h" im_cputs("IM_ISSUCCESS Example", IM_NORMAL) status = im_sound(IM_LOW_PITCH, IM_BEEP_DURATION, IM_NORMAL_VOLUME) if IM_ISSUCCESS(status) im_cputs(“Beep success or warning!”, IM_NORMAL); else printf(“Beep error!”);

5-56

Page 113

im_iswarn

5 im_iswarn Purpose:

This macro determines if the return status code from another PSK function is a warning.

Syntax:

#include "im64psk.h" IM_ISWARN(status);

IN Parameters:

status

OUT Parameters:

None.

Return Value:

See Also:

Any PSK function that returns a status code.

This function returns one of these codes: 0

Success or an error (either fatal or nonfatal)

Nonzero

Warning

IM_ISERROR, IM_ISGOOD, IM_ISSUCCESS

Example /********************* IM_ISWARN *************************************/ #include "im64psk.h" printf("IM_ISWARN Example") status = im_sound(IM_LOW_PITCH, IM_BEEP_DURATION, IM_NORMAL_VOLUME) if IM_ISWARN(status) printf("Beep warning!"); else im_cputs("Beep success or error!", IM_NORMAL);

5-57

Page 114

im_message 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 "im64psk.h" void im_message(IM_USHORT status_code);

IN Parameters:

status_code

OUT Parameters:

None.

Return Value:

None.

Notes:

5-58

Standard status code returned from various PSK functions.

The status message is displayed at the current cursor location without any formatting.

Page 115

im_power_status

5 im_power_status Purpose:

This function returns the line status, battery status, backup status, and percentage of remaining battery life.

Syntax:

#include “im64psk.h” IM_STATUS im_power_status (IM_LINE_STATUS *line_status, IM_BATTERY_STATUS battery_status, IM_BACKUP_STATUS *backup_status, IM_UCHAR fuel_gauge);

IN Parameters: OUT Parameters:

None. The line_status parameter returns one of these constants: IM_ACline_NOT_CONNECTED AC line is not connected IM_ACline_CONNECTED AC line is connected IM_UNKNOWN_ACline AC line status is unknown The battery_status parameter returns one of these constants: IM_HIGH_BAT Battery charge is high IM_LOW_BAT Battery charge is low IM_CRITICAL_BAT Battery charge is critical IM_CHARGING_BAT Battery is charging now IM_UNKNOWN_BAT Battery condition is unknown The backup_status parameter returns one of these constants: IM_BACKUP_OK Backup battery is OK IM_BACKUP_LOW Backup battery is low The fuel_gauge parameter returns one of these constants: 0 to 100 255

% of full charge in increments of 10% Unknown

Return Value:

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

Note:

The fuel_gauge returns a percentage value for the battery status only when the battery icon appears on the status line (the bottom line) of the screen. If the battery icon is not displayed, the fuel_gauge returns 255 (unknown status).

5-59

Page 116

im_power_status im_power_status (continued) Example /******************** im_power_status ******************************/ #include “stdio.h” #include "im64psk.h" IM_LINE_STATUS ac_line; IM_BATTERY_STATUS battery; IM_BACKUP_STATUS backup; IM_UCHAR fuel; IM_STATUS status; void main (void) { /* Call Intermec function */ status = im_power_status( &ac_line, &battery, &backup, &fuel); printf ("Status: %4X\n", status); printf ("Line status:\n "); switch (ac_line) { case IM_ACline_NOT_CONNECTED: printf ("Not connected\n"); break; case IM_ACline_CONNECTED: printf ("Connected\n"); break; case IM_UNKNOWN_ACline: printf ("Unknown\n"); break; default: im_cputs ("Invalid return value\n", IM_NORMAL); break; } /* End switch */ printf ("Battery status:\n "); switch (battery) { case IM_HIGH_BAT: printf ("Charge high\n"); break; case IM_LOW_BAT: printf ("Charge low\n"); break; case IM_CRITICAL_BAT: printf ("Charge critical\n"); break; case IM_CHARGING_BAT: printf ("Charging battery\n"); break;

5-60

Page 117

im_power_status

5 im_power_status (continued) case IM_UNKNOWN_BAT: printf ("Unknown\n"); break; default: im_cputs ("Invalid return value\n", IM_NORMAL); break; } /* end switch */ printf ("Backup status:\n "); switch (backup) { case IM_BACKUP_OK: printf ("Backup battery OK\n"); break; case IM_BACKUP_LOW: printf ("Backup battery low\n"); break; default: im_cputs ("Invalid return value\n", IM_NORMAL); break; } /* end switch */ if (fuel <= 100) printf("Fuel gauge:\n %u percent\n", fuel); else if (fuel == 255) printf ("Fuel gauge unknown\n"); else im_cputs ("Invalid return value\n", IM_NORMAL); }

5-61

Page 118

im_protocol_extended_status im_protocol_extended_status Purpose:

This function gets the protocol extended status from the designated communications port. You allocate the protocol status buffer or RF status buffer, and then im_protocol_extended_status returns the status and setup in hexadecimal values.

Syntax:

#include “im64psk.h” IM_STATUS im_protocol_extended_status (IM_COM_PORT port_id, IM_COMM_STATUS_BUFFER_s far *status_buffer);

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 status_buffer parameter is a far pointer to the status buffer structure IM_COMM_STATUS_BUFFER_s. OUT Parameters: Return Value:

See Also:

None. This function returns one of the standard status codes defined in Appendix A, "Status Codes." im_receive_buffer_no_wait, im_transmit_buffer_no_wait

Example /******************** im_protocol_extended_status **********************/ #include <stdio.h> #include <conio.h> #include <string.h> #include “im64psk.h” void main (void) { IM_STATUS status; IM_COMM_STATUS_BUFFER_s status_buffer; /* First format string for extended protocol status */ IM_UCHAR *format_str1 = "Strut Ver = %d\nHd Ver = %s\nBaud = %lu\nParity=%XH\nStop=%XH\nData=%XH\n" "Modem=%XH\nPort stat = %XH\nActive prot = %d\n" "Lrc enabled = %XH\nInterchar dely= %d\nTurnarnd dely=%d\n" "Receive tmeout= %d\nTransmit tmeout= %d\n"; /* Second format string for extended protocol status */ IM_UCHAR *format_str2 = "Pol char = %XH\nPol length= %d\nSel char = %XH\nSel length= %d\n" "Res char = %XH\nRes length= %d\nReq char = %XH\nReq length= %d\n" "Aff char = %XH\nAff length= %d\nNeg char = %XH\nNeg length= %d\n"

5-62

Page 119

im_protocol_extended_status

5 im_protocol_extended_status (continued) "Som char = %XH\nSom length= %d\n"; /* Third format string for extended protocol status */ IM_UCHAR *format_str3 = "Tx eom len = %XH\nTx eom char 1 = %XH\n" "Tx eom char 2 = %XH\nRx eom len = %XH\nRx eom char 1 = %XH\n" "Rx eom char 2 = %XH\nFlow ctrl = %XH\nMulti drp addr = %XH\n" "Multi drp addr = %XH\nMulti drp enbled = %XH\n" "EOF len = %XH\nEOF char = %XH\nRecv clt buff= %d\n" "Xmit clt buff= %d\nProt mode = %d\n"; /* Call Intermec routine */ status_buffer.status_structure_version = STATUS_STRUCT_VERSION; status = im_protocol_extended_status(IM_COM1, &status_buffer); clrscr(); gotoxy(1, 1);

/* to upper left screen */

/* Print first page of status info */ im_cputs("Extd Status,Page 1of3\n", IM_NORMAL); printf(format_str1, status_buffer.status_structure_version, status_buffer.handler_ver, status_buffer.specific.serial.baud_rate, status_buffer.specific.serial.parity, status_buffer.specific.serial.stop_bits, status_buffer.specific.serial.data_bits, status_buffer.specific.serial.modem_status, status_buffer.specific.serial.port_status, status_buffer.specific.serial.active_prot, status_buffer.specific.serial.lrc_enabled, status_buffer.specific.serial.interchar_delay, status_buffer.specific.serial.turnaround_delay, status_buffer.specific.serial.receive_timeout, status_buffer.specific.serial.transmit_timeout); /* Pause between screens */ printf("Any key to cont'\n"); getch(); clrscr(); gotoxy(1, 1); im_cputs ("Extd Status,Page 2of3\n"); /* Print second page of status info */ im_cputs (format_str2, status_buffer.specific.serial.pol_char, status_buffer.specific.serial.pol_length, status_buffer.specific.serial.sel_char, status_buffer.specific.serial.sel_length, status_buffer.specific.serial.res_char, status_buffer.specific.serial.res_length, status_buffer.specific.serial.req_char, status_buffer.specific.serial.req_length, status_buffer.specific.serial.aff_char,

5-63

Page 120

im_protocol_extended_status im_protocol_extended_status (continued) status_buffer.specific.serial.aff_length, status_buffer.specific.serial.neg_char, status_buffer.specific.serial.neg_length, status_buffer.specific.serial.som_char, status_buffer.specific.serial.som_length); /* Pause between screens */ printf ("Any key to cont'\n"); getch(); clrscr(); gotoxy(1, 1); im_cputs("Extd Status,Page 3of3\n", IM_NORMAL); /* Print third page of status info */ printf(format_str3, status_buffer.specific.serial.txeom_len, status_buffer.specific.serial.txeom_char_1, status_buffer.specific.serial.txeom_char_2, status_buffer.specific.serial.rxeom_len, status_buffer.specific.serial.rxeom_char_1, status_buffer.specific.serial.rxeom_char_2, status_buffer.specific.serial.flow_ctrl, status_buffer.specific.serial.multi_drop_addr, status_buffer.specific.serial.multi_drop_enabled, status_buffer.specific.serial.eof_length, status_buffer.specific.serial.eof_char, status_buffer.specific.serial.have_recv_client_buffer, status_buffer.specific.serial.have_xmit_client_buffer, status_buffer.specific.serial.protocol_mode); /* Function call return status */ printf ("Extd Prot Stat=%XH\n", status); }

5-64