Virtual Serial Port Tools - Advanced serial port configurations for your custom ports usage scenario
Docs

IPipePortDevice Interface

This interface is implemented by a pipe port device.

Declaration

interface IPipePortDevice extends ${IDevice} {
    // Properties
    readonly ${pipeName}: string;
    readonly ${numberOfInstances}: number;
    readonly ${outputBufferSize}: number;
    readonly ${inputBufferSize}: number;
    readonly ${defaultTimeout}: number;
    // Methods
    ${configureCreatePipe}(pipeName: string, numberOfInstances: number, outputBufferSize: number, inputBufferSize: number, defaultTimeout: number): void;
    ${configureConnectPipe}(pipeName: string): void;
}
public interface IPipePortDevice : ${IDevice}
{
    // Properties
    string ${pipeName} { get; }
    uint ${numberOfInstances} { get; }
    uint ${outputBufferSize} { get; }
    uint ${inputBufferSize} { get; }
    uint ${defaultTimeout} { get; }
    // Methods
    void ${configureCreatePipe}(string pipeName, uint numberOfInstances, uint outputBufferSize, uint inputBufferSize, uint defaultTimeout);
    void ${configureConnectPipe}(string pipeName);
}
struct IPipePortDevice : IDevice
{
    // Properties
    _bstr_t ${pipeName};  // get 
    unsigned ${numberOfInstances};  // get 
    unsigned ${outputBufferSize};  // get 
    unsigned ${inputBufferSize};  // get 
    unsigned ${defaultTimeout};  // get 
    // Methods
    HRESULT ${configureCreatePipe}(_bstr_t pipeName, unsigned numberOfInstances, unsigned outputBufferSize, unsigned inputBufferSize, unsigned defaultTimeout);
    HRESULT ${configureConnectPipe}(_bstr_t pipeName);
};

IPipePortDevice Properties

pipeName

readonly pipeName: string;
string pipeName { get; }
_bstr_t pipeName;  // get 

The full name of the pipe this port is associated with. The pipe name returned is of the form \\servername\pipe\pipename.

numberOfInstances

readonly numberOfInstances: number;
uint numberOfInstances { get; }
unsigned numberOfInstances;  // get 

The maximum number of instances that can be created for this pipe. The first instance of the pipe can specify this value; the same number must be specified for other instances of the pipe. Acceptable values are in the range 1 through 255. 255 means “unlimited instances”, in this case the number of pipe instances that can be created is limited only by the availability of system resources.

outputBufferSize

readonly outputBufferSize: number;
uint outputBufferSize { get; }
unsigned outputBufferSize;  // get 

The number of bytes to reserve for the output buffer. This value is only a hint.

inputBufferSize

readonly inputBufferSize: number;
uint inputBufferSize { get; }
unsigned inputBufferSize;  // get 

The number of bytes to reserve for the input buffer. This value is only a hint.

defaultTimeout

readonly defaultTimeout: number;
uint defaultTimeout { get; }
unsigned defaultTimeout;  // get 

The default time-out value, in milliseconds. Each instance of a named pipe must specify the same value. A value of zero will result in a default time-out of 50 milliseconds.

IPipePortDevice Methods

configureCreatePipe

configureCreatePipe(pipeName: string, numberOfInstances: number, outputBufferSize: number, inputBufferSize: number, defaultTimeout: number): void;
void configureCreatePipe(string pipeName, uint numberOfInstances, uint outputBufferSize, uint inputBufferSize, uint defaultTimeout);
HRESULT configureCreatePipe(_bstr_t pipeName, unsigned numberOfInstances, unsigned outputBufferSize, unsigned inputBufferSize, unsigned defaultTimeout);
pipeName
The name of the pipe to create. Pipe name must have the following format: \\.\pipe\pipename where pipename is a unique pipe name (possibly with path).
numberOfInstances
The maximum number of instances that can be created for this pipe. The first instance of the pipe can specify this value; the same number must be specified for other instances of the pipe. Acceptable values are in the range 1 through 255. 255 means “unlimited instances”, in this case the number of pipe instances that can be created is limited only by the availability of system resources.
outputBufferSize
The number of bytes to reserve for the output buffer. This value is only a hint.
inputBufferSize
The number of bytes to reserve for the input buffer. This value is only a hint.
defaultTimeout
The default time-out value, in milliseconds. Each instance of a named pipe must specify the same value. A value of zero will result in a default time-out of 50 milliseconds.

Configures the port to automatically created a given named pipe whenever it is opened by an application. If an error occurs during creation of the pipe, this error is propagated back to the opener of the virtual serial port.

configureConnectPipe

configureConnectPipe(pipeName: string): void;
void configureConnectPipe(string pipeName);
HRESULT configureConnectPipe(_bstr_t pipeName);
pipeName
The full name of the pipe. It must be a string of the following format: \\servername\pipe\pipename, where servername is pipe's server name, DNS name, IP address or any other supported locator and pipename is a unique pipe name (possibly with a path).

Configures the port to automatically connect to a given pipe whenever it is opened by an application. If an error occurs during connection to the pipe, this error is propagated back to the opener of the virtual serial port.