This is a base interface for all supported device types: alias, shared, remote and local bridge.
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}();
};
readonly port: number;
uint port { get; }
unsigned port; // get
Contains the port number assigned by the OS to the current virtual serial port device.
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
.
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.