📄 wsc4vb_r.txt
字号:
Remark The SioUnGetc Function returns (.pushes.) the character back
into the serial input buffer. The character pushed will be
the next character returned by SioGetc. Only one character
can be pushed back. This Function works just like the
'ungetc' Function in the C language.
Return IE_NOPEN : Port not opened. Call SioReset first.
IE_BADID : No such port.
Other See SioReset.
WSC4VB Reference Manual Page 15
+--------------+----------------------------------------------------+
| SioWinError | Return last Win32 error code & message text. |
+--------------+----------------------------------------------------+
SYNTAX Function SioWinError(ByVal Buffer As String,
ByVal Size As Long) As Long
' Buffer : Pointer to messages buffer.
' Size : Size of buffer.
REMARK The SioWinError returns the last Win32 error code. If Buffer
is not NULL, it will also copy the corresponding text message
into 'Buffer' of size 'Size'.
RETURN The Win32 numeric error code.
WSC Error Codes
+---------------+---------------------------------------------+
| WSC_NO_DATA | No incoming serial data is available. |
| WSC_RANGE | A parameter is out of range. |
| WSC_ABORTED | The shareware version of WSC corrupted. |
| WSC_WIN32ERR | Win32 system error. |
+---------------+---------------------------------------------+
| IE_BADID | No such port. |
| IE_OPEN | Port already opened. |
| IE_NOPEN | Port not opened. Call SioReset first. |
| IE_MEMORY | Cannot allocate memory for queues. |
| IE_DEFAULT | Error in default parameters. |
| IE_HARDWARE | Hardware not present. |
| IE_BYTESIZE | Unsupported byte size. |
| IE_BAUDRATE | Unsupported baud rate. |
+---------------+---------------------------------------------+
The WSC_ABORTED error occurs in the shareware version only if there
is a problem displaying the shareware screen.
WSC4VB Reference Manual Page 16
+-----------+-------------------------------------------------------+
| mioBreak | Aborts the Modem I/O state driver. |
+-----------+-------------------------------------------------------+
Syntax Function mioBreak(ByVal Port) As Long
' Port : Port selected.
Remark Forces the MIO driver to the IDLE state, abandoning any work
in progress (if any). Used to abort mioSendTo, mioQuiet, and
mioWaitFor functions.
Return MIO_IDLE.
+------------+------------------------------------------------------+
| mioDriver | Modem I/O state driver. |
+------------+------------------------------------------------------+
Syntax Function mioDriver(ByVal Port) As Long
' Port : Port selected.
Remark Executes the next state of any previously started MIO Function
such as mioSendTo, mioWaitFor, and mioQuiet. Returns MIO_IDLE
(defined in MIO32.BAS) if ready not running, MIO_RUNNING if
running, and anything else is a character from the modem that
can be displayed if wanted.
Return MIO_IDLE : if the driver is ready for the next mioSendTo,
mioWaitFor, or mioQuiet.
MIO_RUNNING : if the driver is not idle.
<else> : if the driver is not idle, and the returned
character was received from the modem.
WSC4VB Reference Manual Page 17
+-----------+-------------------------------------------------------+
| mioQuiet | Waits for Modem I/O state driver. | *
+-----------+-------------------------------------------------------+
Syntax Function mioQuiet(ByVal Port, ByVal Wait As Long) As Long
' Port : Port selected.
' Wait : Wait in milliseconds.
Remark The mioQuiet Function waits for continuous quiet [no incoming
serial data] of 'Wait' milliseconds before returning. Any
incoming character while mioQuiet is running is lost.
Return TRUE.
+------------+------------------------------------------------------+
| mioResult | Returns result of last mioWaitFor. |
+------------+------------------------------------------------------+
Syntax Function mioResult(ByVal Port) As Long
' Port : Port selected.
Remark The mioResult Function returns the result of the last
mioWaitFor Function. This Function should not be called until
the driver returns MIO_IDLE. See the remarks section of the
mioWaitFor Function for an example.
Return 0 : False (last WaitFor not matched)
!0 : '0' if first substring matched, '1' if second substring
matched, etc.
Other See mioWaitFor.
WSC4VB Reference Manual Page 18
+-----------+-------------------------------------------------------+
| mioSendTo | Sends string to modem. |
+-----------+-------------------------------------------------------+
Syntax Function mioSendTo(ByVal Port, ByVal Pace,
ByVal Text As String) As Long
' Port : Port selected.
' Pace : The inter-character delay in milliseconds.
' Text : The string to send.
Remark The mioSendTo Function sends the characters in the string
'Text' to serial output. There is a delay of 'Pace'
milliseconds between characters.
Return TRUE.
+-------------+-----------------------------------------------------+
| mioWaitFor | Waits for continuous quiet. |
+-------------+-----------------------------------------------------+
Syntax Function mioWaitFor(ByVal Port, ByVal Wait,
ByVal Text As String) As Long
' Port : Port selected.
' Wait : Total time to wait for response (milliseconds).
' Text : The expected response string.
Remark The mioWaitFor Function waits for characters from serial
input that match the string 'Text'. A total of 'Wait'
milliseconds are allowed before timing out and returning FALSE
(0). The string comparison is NOT case sensitive.
For example, to wait up to one minute for 'CONNECT', 'NO
CARRIER', or 'BUSY' from the modem after dialing a number.
Code = mioWaitFor(ByVal Port,60000,'CONNECT|NO CARRIER|BUSY')
The Function mioDriver() must be called until MIO_IDLE is
returned. Then mioResult() is called to get the result of the
mioWaitFor. A value of 0 indicates that neither 'CONNECT',
'BUSY', nor 'NO CARRIER' was received. A non-zero value
indicates that one of the three sub-strings was received. A
'0' is returned if 'CONNECT' was seen, '1' is returned if 'NO
CARRIER' was seen, and '2' is returned if 'BUSY' was seen.
Return TRUE.
Other See mioResult.
WSC4VB Reference Manual Page 19
+---------+---------------------------------------------------------+
| xyAbort | Aborts the XYDRIVER state driver. |
+---------+---------------------------------------------------------+
Syntax Function xyAbort(ByVal Port) As Long
' Port : Port selected.
Remark The xyAbort Function forces the driver to IDLE, terminating
any file transfer which may be in progress.
Return XY_NO_ERROR (0).
+-----------+-------------------------------------------------------+
| xyAcquire | Prepares the state driver for operation. |
+-----------+-------------------------------------------------------+
Syntax Function xyAcquire(ByVal Port) As Long
' Port : Port selected.
Remark The xyAcquire Function initializes the driver for subsequent
use. This should be the first driver Function called.
Return =0 : No error (XY_NO_ERROR).
<0 : XYDRIVER error. See .XYDRIVER Error Codes.
Other See xyRelease.
WSC4VB Reference Manual Page 20
+----------+--------------------------------------------------------+
| xyDebug | Set the driver debug level. |
+----------+--------------------------------------------------------+
Syntax Function xyDebug(ByVal DebugLevel) As Long
' DebugLevel : Debug level value.
Remark The xyDebug Functions sets the driver debug level as follows:
DebugLevel : Meaning
0 Only error messages are generated [default].
1 Minimal debug messages are generated.
2 Maximal debug messages are generated.
Debug messages are retrieved using the xyGetMessage Function.
Returns New debug level [0,1,2]
+----------+--------------------------------------------------------+
| xyDriver | XMODEM / YMODEM state driver. |
+----------+--------------------------------------------------------+
Syntax Function xyDriver(ByVal Port) As Long
' Port : Port selected.
Return XY_IDLE : A transfer is not underway.
XY_RUNNING : A transfer is underway.
Remark The xyDriver Function drives the state engine. It is normally
called within a timer loop. Note that xyDriver never returns
an error code.
xyDriver can be called as often as wanted whether or not a
file transfer was initiated.
Other See xyStartTx and xyStartRx.
WSC4VB Reference Manual Page 21
+--------------+----------------------------------------------------+
| xyGetMessage | Get next XYDRIVER message. |
+--------------+----------------------------------------------------+
Syntax Function xyGetMessage(Buffer As String, ByVal Size) As Long
' Buffer : Message buffer.
' Size : Size of message buffer.
Remark The xyGetMessage Function retrieves the next message from the
driver message queue. Refer to the XMR.BAS example program for
an sample of using xyGetMessage.
Return TRUE : A message was copied into Buffer.
FALSE : No messages are available.
Other See xyDebug.
+----------------+--------------------------------------------------+
| xyGetParameter | Retrieves driver parameter. |
+----------------+--------------------------------------------------+
Syntax Function xyGetParameter(ByVal Port, ByVal Parameter) As Long
' Port : Port Selected.
' Parameter : Parameter to return.
Remark The driver parameter corresponding to the following table is
returned.
Parameter : Description
XY_GET_ERROR_CODE : Driver error code (see XYDRIVER.BAS)
XY_GET_ERROR_STATE : Error state (if in error).
XY_GET_PACKET : Current packet number.
XY_GET_STATE : Current state (see XYDRIVER.BAS).
XY_GET_FILE_SIZE : File size.
XY_GET_NBR_NAKS : Number of packets ACKed.
XY_GET_LAST_GET : Last incoming (serial) character.
XY_GET_LAST_PUT : Last outgoing (serial) character.
XY_GET_GET_COUNT : Number of incoming characters (bytes).
XY_GET_PUT_COUNT : Number of outgoing characters (bytes).
XY_GET_DRIVER_COUNT : Number times xyDriver() was called.
-1 : Cannot recognize parameter.
The xyGetParameter Function can be used to check the state of
the driver. For example:
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -