Intermec 5055 Reference Guide
im_receive_buffer
5-51
5
im_receive_buffer
Purpose:
This function receives the contents of a data buffer from the serial communications port.
Syntax:
#include "im5055.h"
IM_STATUS im_receive_buffer
(IM_COM_PORT
IM_STATUS im_receive_buffer
(IM_COM_PORT
port_id
,
IM_USHORT
length
,
IM_UCHAR far
*data_buffer
,
IM_LTIME
timeout
,
IM_USHORT far
*comm_length
);
IN Parameters:
port_id Identifies the communications port. Use this constant:
IM_COM1 COM1 port.
IM_COM2 COM2 port.
IM_NET Radio stream or TCP/IP network.
length Specifies the maximum number of bytes to receive.
data_buffer Far pointer to the data array where you want to place the received data.
This buffer must hold at least the number of bytes passed in as length.
This buffer must hold at least the number of bytes passed in as length.
timeout Specifies the receive timeout period. Either enter a number from 0 to
4,294,967,294 to indicate the length of the timeout in milliseconds (55 ms granularity),
or choose one of these constants:
4,294,967,294 to indicate the length of the timeout in milliseconds (55 ms granularity),
or choose one of these constants:
IM_INFINITE_NET_TIMEOUT Never timeout.
IM_ZERO_TIMEOUT No wait.
OUT Parameters:
comm_length Far pointer to the variable that will hold the actual number of bytes
received upon completion of the call. If IM_SUCCESS is not returned, this value will
be 0.
received upon completion of the call. If IM_SUCCESS is not returned, this value will
be 0.
Return Value:
This function returns one of these codes:
IM_SUCCESS Successfully received data.
IM_NET_BAD_DATA Data pointer is null or invalid data length.
IM_NET_DATA_LENGTH Data buffer size is too small for frame.
IM_TIMEDOUT No data was received in the timeout period.
IM_INVALID_PORT Invalid port_id.
IM_BUFFER_OVERFLOW Receive buffer overflowed and needed to be flushed.
This error will only be returned in character mode.
This error will only be returned in character mode.