?? mnpc.doc
字號:
1 = 7 data bits, even parity
2 = 7 data bits, odd parity
3 = 7 data bits, mark parity
4 = 7 data bits, space parity
[Note: In this Library version, once the Link
is established, it is not possible to change
format.]
PORT - an integer which indicates the communications
port, as follows:
1 = COM1
2 = COM2
[Note: This Library version does not support
other comm ports. Also, COM2 cannot be speci-
fied if no COM1 is present in the system.]
MODE - an integer which indicates the role in link
establishment, as follows:
0 = link initiator (caller)
1 = link accepter (answerer)
The function returns an integer value, as follows:
RETCODE - an integer returned to the caller which
indicates the result of the link
establishment attempt, as follows:
0 = success (link established)
-64 - failure, no additional info
-65 - failure, timeout (no remote response)
-66 - failure, physical-connection lost
(carrier lost)
-70 - failure, incompatible MNP
-72 - failure, remote protocol error
[Note: -70 and -72 should never occur.]
MNPCONNECT is called as follows:
RETCODE = MNPCONNECT(RATE,FORMAT,PORT,MODE);
4.2 Link Termination - MNPDISCONNECT
MNPDISCONNECT has two functions, to send the appropriate protocol
message to the other side to indicate Link termination and to reset the PC
interrupt environment. MNPDISCONNECT must always be called if MNPCONNECT
had been called previously. This is so even for establishment failure or
for loss of the physical-connection (i.e. carrier lost).
MNPDISCONNECT has no parameters and returns no value. It is
called as follows:
MNPDISCONNECT();
4.3 Send Data - MNPSEND
MNPSEND is called to copy data to be sent on the Link from the
application into the MNP transmit buffer.
MNPSEND has parameters as follows:
SNDBUF - a pointer to the user char buffer from which
transmit data is to be copied.
BUFLEN - an integer which indicates the maximum
number of data bytes which can be copied
from the user buffer
The function returns an integer value, as follows:
RETCODE - an integer returned to the caller which
indicates the number of bytes copied
or a Link error condition, as follows:
positive int = number of bytes copied
0=no bytes copied
-64 = link terminated, retransmission limit
exceeded
-65 = link terminated, unable to send
-66 = link terminated, carrier lost
-67 = link terminated, remote disconnected
MNPSEND is called as follows:
RETCODE = MNPSEND(&SNDBUF,BUFLEN)
4.4 Receive Data - MNPRECEIVE
MNPRECEIVE is called to copy data received on the Link into the
application. MNPRECEIVE transfers all available data up to the size of the
application buffer. MNPRECEIVE returns immediately if no data is
available.
MNPRECEIVE has the following parameters:
RCVBUF - a pointer to the user char buffer into which
received data is to be copied. This buffer must
be at least as long as the value of BUFLEN.
BUFLEN - an integer which indicates the maximum
number of data bytes which can be copied
into the user buffer
The function returns an integer value, as follows:
RETCODE - an integer returned to the caller which
indicates the number of bytes copied
or a Link error condition, as follows:
positive int = number of bytes copied
0=no bytes available.
-64 = link terminated. retransmission limit
exceeded
-65 = link terminated, unable to send
-66 = link terminated, carrier lost
-67 = link terminated, remote disconnected
MNPRECEIVE is called as follows:
RETCODE = MNPRECEIVE(&RCVBUF,BUFLEN);
4.5 Link Status - MNPSTATUS
MNPSTATUS is called to return to the application the status of the
Link and to read parameters which indicate the availability of received
data or the ability to enqueue data for transmission.
MNPSTATUS has a structure as its parameter, with members
as follows:
PSTATUS - an integer which indicates the condition of
the physical-connection, as follows:
0 = not connected (carrier not present)
1 = connected (carrier present)
LSTATUS - an integer which indicates the condition of
Link, as follows:
0 = link not established (i.e. link
terminated)
1 = link established
SCOUNT - an integer which indicates the number of
bytes free in the Link send buffer. This is
the number of bytes which can be completely
copied to the Link transmit code via an
MNPSEND call.
RCOUNT - an integer which indicates the number of
received data bytes which are available to
be copied into the application via MNPRECEIVE
ALLSENT - an integer which indicates whether or not
all data passed to the Link code has been
successfully sent and acknowledged, as
follows:
0 = all data not sent
1 = all data sent
MNPSTATUS is called as follows:
MNPSTATUS(&STATUS_BLOCK);
4.6 Send Signal - MNPBREAK
MNPBREAK is called to send a signal to the remote DTE. When the
remote side is an MNP error-correcting modem, an MNPBREAK call causes the
remote modem to send a break signal (continuous spacing) to its attached
DTE.
MNPBREAK employs the MNP Link Protocol's reliable attention
mechanism in 'destructive mode'. That is, when MNPBREAK is called, the
Link is reset and any data pending transmission on the link is discarded as
is any received data which has not been read via the MNPRECEIVE subroutine.
Data may also be discarded at the remote side of the Link.
MNPBREAK has no parameters but returns an integer value,
as follows:
RETCODE - an integer returned to the caller which
indicates the result of the MNPBREAK call
or a Link error condition, as follows:
0 = break initiated
-64 = link terminated, retransmission limit
exceeded
-65 = link terminated, unable to send
-66 = link terminated, carrier lost
-67 = link terminated, remote disconnected
-75 = break not supported (remote did not
negotiate attention support for this
Link)
-76 = previous break still in progress
MNPBREAK is called as follows:
RETCODE = MNPBREAK();
[Note that the MNP Library does not support application
notification of the receipt of the MNP attention message and
hence it is assumed that MNPBREAK will only be employed when the
remote side of the connection is an MNP error-correcting
modem.]
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -