Intermec 5055 Reference Guide

Page of 216
im_receive_byte
5-53
5
im_receive_byte
Purpose:
This function receives one byte of data through the designated communications port.
This function is identical to MS-DOS INT 14H service 02H.
Syntax:
#include "im5055.h"
IM_STATUS im_receive_byte
    (IM_COM_PORT 
port_id
,
    IM_UCHAR *
receive_byte
);
IN Parameters:
The port_id parameter identifies the communications port as follows:
IM_COM1
COM1.
IM_COM2
COM2.
OUT Parameters:
The receive_byte parameter is a pointer to the byte received from the communications
port.
Return Value:
This function returns one of the standard status codes defined in Appendix A, "Status
Codes."
Notes:
This function requires the PC standard protocol handler 
PHPCSTD.EXE
.
If you are using 
PHIMEC.EXE
 and want to receive a single byte, use im_receive_buffer
with a buffer length of one instead of the im_receive_byte procedure.
This procedure will not work if linked.
See Also:
im_transmit_byte
Example
/******************** im_receive_byte *******************************/
/* Uses Borland _bio_serialcom or Microsoft _bios_serialcom  to init the   */
/* com port for single byte receive.                                       */
/* Operations. It sets up for 9600,E,7,1 on serial port                    */
/* To Terminate reception of bytes:                                        */
/*    To end the reception of bytes from the host, type <ESC> on JANUS     */
/*     and then type a Ctrl Z on the host                                  */
/* Note: Phimec protocol handler must NOT be installed to run this routine */
/*       Phpcstd protocol handler must be installed to run this routine    */
#include <stdio.h>
#include <dos.h>
#include <conio.h>
#include <bios.h>
#include <string.h>
#include "im5055.h"
#include "immsg.h"