Metrologic Optimus S Programming Manual page 109

"c" programming guide
Table of Contents

Advertisement

com_overrun
Purpose
To check if overrun error occurs.
Syntax
int com_overrun (int port);
int port;
Example
if (overrun (1) > 0) clear_com (1);
Description
This routine checks if overrun error occurs on COM 1 or COM 2.
Return
If overrun occurs, it returns 1.
Otherwise, it returns 0.
See Also
clear_com
nwrite_com
To send a specific number of characters through a specified COM port.
Purpose
int nwrite_com (int port, char *s, int count);
Syntax
int port;
char *s;
int count;
Example
char s[] = {"Hello\n"};
nwrite_com (1,s,2);
Description
This routine sends the characters of a string one by one until the specified
number of characters are sent out.
Return
If successful, it returns the character count.
Otherwise, it returns 0.
See Also
write_com
open_com
Purpose
To enable a specified COM port and initialize communication.
Syntax
int open_com (int com_port, int setting);
int com_port;
int setting;
Chapter 3 Terminal Specific Function Library
/* if overrun, data stored in the buffer is not complete, clear them all */
/* port settings for COM 1 or COM 2 as shown below */
/* which COM port (1 or 2) to be checked */
/* COM port to be used */
/* string to be sent out */
/* number of characters to be sent */
/* send the characters "He" through COM 1 */
/* COM port to be opened */
103

Advertisement

Table of Contents
loading

This manual is also suitable for:

Optimus r

Table of Contents