ZCOM C I/F Library Routines

ZREAD (3X)

rlen (Return Actual data length. NULL may be specified if the caller does

Param) not require the returned message length. Note that rlen may exceed len. This indicates the received data is truncated to just fill up ibuf.

rstat

 

Return status.

(Return

0

- no error

Param)

 

 

 

 

-ve - ZCOM error code

 

 

+ve

- terminal error status

 

 

It is meaningful only if the returned message is a response or

 

 

terminal message. For other message types, it is always

 

 

returned with zero. NULL may be specified if the caller does

 

 

not require this return status.

 

 

The return status rstat and the request code

 

 

mhp->mrq.mrqcodemay be used to retrieve a status message

 

 

by calling zcomstatus(3X).

NOTES

1. If zsend(3X) was used to send data using modes 1, 2, 5, or 7, then the

 

 

input ZLU queue may contain response status messages. If the sent

 

 

message could not be delivered by the driver (e.g., data corruption in

 

 

the host system), an error response is returned to the sender’s

 

 

primary ZLU. When such an error response is picked up by zread, the

 

 

function returns with zero (indicating no problem in reading the

 

 

input ZLU), the returned message type is set (e.g.,

 

 

ZCOM_MSTYPE_RSLT) and the return status will carry a negative

 

 

ZCOM error code. If the message could not be delivered by the

 

 

interface (e.g., a problem with the terminal line), the returned

 

 

response will have a positive ZCOM status code indicating the

 

 

problem.

 

2.If the received message (or response) is from a terminal, the request code is returned in mhp->mrq.mrqcode. The request code and the returned status may be used to retrieve an appropriate status/error message by zcomstatus(3X). Refer to Appendix B ZCOM Status Codes of the Multiprotocol ACC Programmers’ Reference Guide for more information. The mhp->mrq.mrqcodefield contains 0 if the message is from a program or is a System Event Message (SEM).

Chapter 4

299