Boolean UtilAsciiToHex32(
const char * string,
dword * value);
This routine converts a null-terminated ASCII string into a 32-bit integer. The string may begin with a hyphen, indicating a negative number. Aside from that, the string may contain nothing but numerals until the null termination. It may not contain whitespace.
If the routine is successful, it will return
false
and write an equivalent signed long integer to
*value
. If it fails, it will return
true
and write a member of the
UtilAsciiToHexError
enumerated type to
*value
. This type contains the following members:
Include: system.h
word UtilHex32ToAscii(
char * buffer,
dword value,
UtilHexToAsciiFlags flags);
This routine converts a 32-bit unsigned integer to its ASCII representation and writes it to the specified buffer. It returns the length of the string (not counting the nulll termination, if any). The routine is passed the following arguments:
value
flags
UtilHexToAscii
flags. The following flags are available:Include: system.h
VarDataFlags VarDataFlagsPtr(
void * ptr);
This macro fetches the flags of a variable data type when given a pointer to the extra data for the type. The flags are stored in a
VarDataFlags
record. Only the flags VDF_EXTRA_DATA and/or VDF_SAVE_TO_STATE will be returned.
Include: object.h
Warnings: You must pass a pointer to the beginning of the vardata entry's extra data space.
word VarDataSizePtr(
void * ptr);
This macro fetches the size of a variable data entry when given a pointer to the extra data for the type.
Include: object.h
Warnings: You must pass a pointer to the beginning of the vardata entry's extra data space.
word VarDataTypePtr(
void * ptr);
This macro fetches the type of a variable data entry when given a pointer to the extra data of the entry. The type is stored in a
VarDataFlags
record. All flags outside the VDF_TYPE section will be cleared.
Include: object.h
Warning: You must pass a pointer to the beginning of the vardata entry's extra data space.
VirtualSerialStatus VirtualSerialClose ( void );
Waits until all outgoing data is sent to remote unit, then flushes incoming data buffer and closes connection to remote unit.
Returns VS_OK if data was successfully written.
Returns VS_CLOSED if stream was already closed.
Warning: This is a low-level routine whose use is discouraged in favor of ModemClose(). Do not call any Virtual Serial function except VirtualSerialOpen() after calling this function.
Include: vserlib.h
See Also: VirtualSerialOpen().
VirtualSerialStatus VirtualSerialFlush( word flushMode);
Flushes data from incoming buffer. The flushMode sets the operation direction. It may be:
Returns VS_OK if the stream successfully flushed.
Returns VS_CLOSED if the stream is not open.
Include: vserlib.h
VirtualSerialStatus VirtualSerialOpen( VSOpenFlags stream_open_mode, /* Fail or wait if stream is busy */ word input_buffer_size, /* # of bytes 1...4096 of input buffer */ word output_buffer_size, /* Ignore. Automatically set to 4352 bytes. */ word timeout); /* # of ticks to wait and retry if the stream is busy. */
This routine lets the client open a stream to the phone. Should the Virtual Phone data resource be in use and if stream_open_mode is set to SOF_NOBLOCK then the function fails immediately; otherwise, if stream_open_mode is set to SOF_TIMEOUT, the function will try again until it is either successful or timeout number of ticks (1 ... 32768) elapse. input_buffer_size is the size (in bytes 1...4096) of the input buffer. The output_buffer_size should be ignored, as the output buffer is set to 4352 bytes.
Returns VS_OK if successful.
Returns VS_DATA_RESOURCE_RESERVED if VP data resource is already in use.
Returns VS_STREAM_ALREADY_OPEN if stream has already been opened by another client.
Returns VS_CANNOT_ALLOC if cannot allocate memory for the streams buffer.
Warning: This is a low-level routine whose use is discouraged in favor of ModemOpen(). This routine must return VS_OK before client can start using other Virtual Serial functions. Outgoing data is not buffered in VirtualSerial library, but sent directly from calling client's buffer.
Include: vserlib.h
See Also: VirtualSerialClose().
VirtualSerialStatus VirtualSerialRead(
VSBlockingMode blocking_mode, /* to block or not to block */
word data_size, /* # of bytes of data to be read */
byte *ptr_to_buffer, /* buffer to hold data */
word *bytes_read); /* # of bytes actually read */
Copies incoming data to buffer. If there is less than data_size number of bytes in the buffer and STREAM_BLOCK was specified in blocking_mode, will block until enough data becomes available; if there is less than data_size number of bytes in the buffer and STREAM_NO_BLOCK was specified, returns immediately with VS_SHORT_READ_WRITE.
Returns VS_OK if data was successfully written.
Returns VS_CLOSED if stream is not open.
Include: vserlib.h
See Also: VirtualSerialReadByte().
VirtualSerialStatus VirtualSerialReadByte(
VSBlockingMode blockingMode, /* to block or not to block */
byte *dataByte); /* buffer to hold read data */
This routine reads a byte from the stream into dataByte. If the stream is empty and blockingMode is set to STREAM_BLOCK then the routine will wait for the request to be filled, or if STREAM_NO_BLOCK is specified the routine will immediately return an error.
Returns VS_OK if data was successfully written to dataByte.
Returns VS_SHORT_READ_WRITE if the data was not available and STREAM_NO_BLOCK was specified.
Returns VS_CLOSED if the stream is not open.
Warning: STREAM_BLOCK mode is dangerous to use: if the opposite end does not send data this function will block forever.
Include: vserlib.h
See Also: VirtualSerialRead(),
VirtualSerialWriteByte().
VirtualSerialStatus VirtualSendDTR(
byte DTR_status);
Sends Data Terminal Ready status to modem.
Include:
vserlib.h
VirtualSerialStatus VirtualSerialSetFlowControl(
VSFlowControl flow_control_mode); /* software or hardware */
Selects the flow control method used between the modem and the VirtualSerial Library. flow_control_mode can be set to either VSFC_SOFTWARE or VSFC_HARDWARE.
Returns VS_OK if successfully set or VS_CLOSED if stream is not open.
Include:
vserlib.h
GEOS SDK TechDocs
|
|
UserRemoveAutoExec() ...
|
VirtualSerialSetFormat() ...