Virtual Serial Port Tools - Advanced serial port configurations for your custom ports usage scenario
Download Virtual Serial Port Tools Hide this button

IDevice Interface

This is a base interface for all supported device types: alias, shared, remote and local bridge.

Declaration

interface IDevice {
    // Properties
    readonly ${port}: number;
    readonly ${devicePath}: string;
    readonly ${openingInfo}: ${IOpeningInfo};

    // Methods
    ${deleteDevice}(): void;
}
public interface IDevice
{
    // Properties
    uint ${port} { get; }
    string ${devicePath} { get; }
    ${IOpeningInfo} ${openingInfo} { get; }

    // Methods
    void ${deleteDevice}();
}
struct IDevice : IDispatch
{
    // Properties
    unsigned ${port};  // get 
    _bstr_t ${devicePath};  // get 
    ${IOpeningInfo} ${openingInfo};  // get 

    // Methods
    HRESULT ${deleteDevice}();
};

IDevice Properties

port

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

Contains the port number assigned by the OS to the current virtual serial port device.

devicePath

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

Contains the unique port path. This unique path may be passed to CreateFile function instead of usual COMn.

openingInfo

readonly openingInfo: ${IOpeningInfo};
${IOpeningInfo} openingInfo { get; }
${IOpeningInfo} openingInfo;  // get 

An object whose properties can be queried to get the information about the process that opened the port and current port parameters.

If the port is not currently opened, an exception is thrown.

IDevice Methods

deleteDevice

deleteDevice(): void;
void deleteDevice();
HRESULT deleteDevice();

Call this method to delete the virtual serial port device. Actual device is deleted immediately (notifying any registered listeners through their ISerialPortLibraryListener.deleted method), however, the API device object is only destroyed when all references are released.

ISerialPortLibrary.getPorts and ISerialPortLibrary.getPortsJs methods do not list deleted devices, even if there are still references to them.