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

IDevice Interface

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

Declaration

interface IDevice {
    // Properties
    readonly ${port}: number;
    readonly ${devicePath}: string;
    // Methods
    ${deleteDevice}(): void;
}
public interface IDevice
{
    // Properties
    uint ${port} { get; }
    string ${devicePath} { get; }
    // Methods
    void ${deleteDevice}();
}
struct IDevice : IDispatch
{
    // Properties
    unsigned ${port};  // get 
    _bstr_t ${devicePath};  // 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.

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.