interface ISerialPortLibrary {
// Properties
${compatibilityFlags}: ${CompatibilityFlags};
// Methods
${createAliasPort}(port?: number | string): ${IAliasPortDevice};
${createBridgePort}(port?: number | string): ${IBridgePortDevice};
${createSharedPort}(port?: number | string, reserved?: boolean): ${ISharedPortDevice};
${createTcpPort}(port?: number | string): ${ITcpPortDevice};
${createRemotePort}(port?: number | string): ${IRemotePortDevice};
${createPipePort}(port?: number | string): ${IPipePortDevice};
${getRemoteSharedPortsJs}(hostName: string): ${IRemotePortDescription}[];
${getPortsJs}(type: ${SerialPortType}): ${IDevice}[];
${getPortsJs#getPortsJs1}(type: ${SerialPortType.Remote#SerialPortType}): ${IRemotePortDevice}[];
${getPortsJs#getPortsJs2}(type: ${SerialPortType.Shared#SerialPortType}): ${ISharedPortDevice}[];
${getPortsJs#getPortsJs3}(type: ${SerialPortType.Alias#SerialPortType}): ${IAliasPortDevice}[];
${getPortsJs#getPortsJs4}(type: ${SerialPortType.Bridge#SerialPortType}): ${IBridgePortDevice}[];
${getPortsJs#getPortsJs5}(type: ${SerialPortType.Pipe#SerialPortType}): ${IPipePortDevice}[];
${getPortsJs#getPortsJs6}(type: ${SerialPortType.Tcp#SerialPortType}): ${ITcpPortDevice}[];
${createTimeoutsObject}(readIntervalTimeout: number,
readTotalTimeoutMultiplier: number,
readTotalTimeoutConstant: number,
writeTotalTimeoutMultiplier: number,
writeTotalTimeoutConstant: number): ${ITimeouts};
${installLicenseFile}(path: string): void;
}
public interface ISerialPortLibrary
{
// Properties
${CompatibilityFlags} ${compatibilityFlags} { get; set; }
// Methods
${IAliasPortDevice} ${createAliasPort}(object port);
${IBridgePortDevice} ${createBridgePort}(object port);
${ISharedPortDevice} ${createSharedPort}(object port, bool reserved);
${ITcpPortDevice} ${createTcpPort}(object port);
${IRemotePortDevice} ${createRemotePort}(object port);
${IPipePortDevice} ${createPipePort}(object port);
Array ${getRemoteSharedPorts}(string hostName);
Array ${getPorts}(${SerialPortType} type);
${ITimeouts} ${createTimeoutsObject}(uint readIntervalTimeout,
uint readTotalTimeoutMultiplier,
uint readTotalTimeoutConstant,
uint writeTotalTimeoutMultiplier,
uint writeTotalTimeoutConstant);
void ${addListener}(${ISerialPortLibraryListener} pListener);
void ${removeListener}(${ISerialPortLibraryListener} pListener);
void ${installLicenseFile}(string path);
void ${installLicenseInMemory}(byte[] data);
}
struct ISerialPortLibrary : IDispatch
{
// Properties
${CompatibilityFlags} ${compatibilityFlags}; // get set
// Methods
${IAliasPortDevicePtr#IAliasPortDevice} ${createAliasPort}(const _variant_t & port);
${IBridgePortDevicePtr#IBridgePortDevice} ${createBridgePort}(const _variant_t & port);
${ISharedPortDevicePtr#ISharedPortDevice} ${createSharedPort}(const _variant_t & port, VARIANT_BOOL reserved);
${ITcpPortDevicePtr#ITcpPortDevice} ${createTcpPort}(const _variant_t & port);
${IRemotePortDevicePtr#IRemotePortDevice} ${createRemotePort}(const _variant_t & port);
${IPipePortDevicePtr#IPipePortDevice} ${createPipePort}(const _variant_t & port);
SAFEARRAY(${IRemotePortDescription}) ${getRemoteSharedPorts}(_bstr_t hostName);
SAFEARRAY(${IDevice}) ${getPorts}(${SerialPortType} type);
${ITimeoutsPtr#ITimeouts} ${createTimeoutsObject}(unsigned readIntervalTimeout,
unsigned readTotalTimeoutMultiplier,
unsigned readTotalTimeoutConstant,
unsigned writeTotalTimeoutMultiplier,
unsigned writeTotalTimeoutConstant);
HRESULT ${addListener}(${ISerialPortLibraryListener *#ISerialPortLibraryListener} pListener);
HRESULT ${removeListener}(${ISerialPortLibraryListener *#ISerialPortLibraryListener} pListener);
HRESULT ${installLicenseFile}(_bstr_t path);
HRESULT ${installLicenseInMemory}(SAFEARRAY(BYTE) data);
};
compatibilityFlags: ${CompatibilityFlags};
${CompatibilityFlags} compatibilityFlags { get; set; }
${CompatibilityFlags} compatibilityFlags; // get set
Zero or more of compatibility flags that can be set to increase compatibility with legacy software.
createAliasPort(port?: number | string): ${IAliasPortDevice};
${IAliasPortDevice} createAliasPort(object port);
${IAliasPortDevicePtr#IAliasPortDevice} createAliasPort(const _variant_t & port);
port
COMn
. If omitted, a next available port number is automatically selected.The method returns a reference to created port device.
Create new alias virtual serial port.
createBridgePort(port?: number | string): ${IBridgePortDevice};
${IBridgePortDevice} createBridgePort(object port);
${IBridgePortDevicePtr#IBridgePortDevice} createBridgePort(const _variant_t & port);
port
COMn
. If omitted, a next available port number is automatically selected.The method returns a reference to created port device.
Create new virtual serial port that will act as one of the local bridge sides.
createTcpPort(port?: number | string): ${ITcpPortDevice};
${ITcpPortDevice} createTcpPort(object port);
${ITcpPortDevicePtr#ITcpPortDevice} createTcpPort(const _variant_t & port);
port
COMn
. If omitted, a next available port number is automatically selected.The method returns a reference to created port device.
Create new TCP virtual serial port.
createRemotePort(port?: number | string): ${IRemotePortDevice};
${IRemotePortDevice} createRemotePort(object port);
${IRemotePortDevicePtr#IRemotePortDevice} createRemotePort(const _variant_t & port);
port
COMn
. If omitted, a next available port number is automatically selected.The method returns a reference to created port device.
Create new remote virtual serial port.
createPipePort(port?: number | string): ${IPipePortDevice};
${IPipePortDevice} createPipePort(object port);
${IPipePortDevicePtr#IPipePortDevice} createPipePort(const _variant_t & port);
port
COMn
. If omitted, a next available port number is automatically selected.Create new pipe virtual serial port.
// This method is not available in scripting environment
Array getPorts(${SerialPortType} type);
SAFEARRAY(${IDevice}) getPorts(${SerialPortType} type);
type
This method returns an array of all local virtual serial port devices of specified type.
getPortsJs(type: ${SerialPortType}): ${IDevice}[];
// This method is not available in managed environment
// This method is not available in native environment
type
This method returns an array of all local virtual serial port devices of specified type.
getPortsJs(type: ${SerialPortType.Remote#SerialPortType}): ${IRemotePortDevice}[];
// This method is not available in managed environment
// This method is not available in native environment
type
This method returns an array of all remote virtual serial port devices.
getPortsJs(type: ${SerialPortType.Shared#SerialPortType}): ${ISharedPortDevice}[];
// This method is not available in managed environment
// This method is not available in native environment
type
This method returns an array of all shared virtual serial port devices.
getPortsJs(type: ${SerialPortType.Alias#SerialPortType}): ${IAliasPortDevice}[];
// This method is not available in managed environment
// This method is not available in native environment
type
This method returns an array of all alias virtual serial port devices.
getPortsJs(type: ${SerialPortType.Bridge#SerialPortType}): ${IBridgePortDevice}[];
// This method is not available in managed environment
// This method is not available in native environment
type
This method returns an array of all bridge virtual serial port devices.
getPortsJs(type: ${SerialPortType.Pipe#SerialPortType}): ${IPipePortDevice}[];
// This method is not available in managed environment
// This method is not available in native environment
type
This method returns an array of all pipe virtual serial port devices.
getPortsJs(type: ${SerialPortType.Tcp#SerialPortType}): ${ITcpPortDevice}[];
// This method is not available in managed environment
// This method is not available in native environment
type
This method returns an array of all TCP/IP virtual serial port devices.
createTimeoutsObject(readIntervalTimeout: number,
readTotalTimeoutMultiplier: number,
readTotalTimeoutConstant: number,
writeTotalTimeoutMultiplier: number,
writeTotalTimeoutConstant: number): ${ITimeouts};
${ITimeouts} createTimeoutsObject(uint readIntervalTimeout,
uint readTotalTimeoutMultiplier,
uint readTotalTimeoutConstant,
uint writeTotalTimeoutMultiplier,
uint writeTotalTimeoutConstant);
${ITimeoutsPtr#ITimeouts} createTimeoutsObject(unsigned readIntervalTimeout,
unsigned readTotalTimeoutMultiplier,
unsigned readTotalTimeoutConstant,
unsigned writeTotalTimeoutMultiplier,
unsigned writeTotalTimeoutConstant);
readIntervalTimeout
readTotalTimeoutMultiplier
readTotalTimeoutConstant
writeTotalTimeoutMultiplier
writeTotalTimeoutConstant
This method creates a timeouts override object. Scripting languages may construct and assign timeouts override objects directly, while native and managed languages may use this helper method to create a pre-filled timeouts override object.
// This method is not available in scripting environment
void addListener(${ISerialPortLibraryListener} pListener);
HRESULT addListener(${ISerialPortLibraryListener *#ISerialPortLibraryListener} pListener);
pListener
Adds specified listener object to the list of listener objects. When new virtual serial devices are created or deleted, library calls methods of the supplied listener object, passing the list of affected devices.
// This method is not available in scripting environment
void removeListener(${ISerialPortLibraryListener} pListener);
HRESULT removeListener(${ISerialPortLibraryListener *#ISerialPortLibraryListener} pListener);
pListener
Removes specified listener object from the list of listener objects.
installLicenseFile(path: string): void;
void installLicenseFile(string path);
HRESULT installLicenseFile(_bstr_t path);
path
Install the given license file. Throws an exception if an error occurs.
// This method is not available in scripting environment
void installLicenseInMemory(byte[] data);
HRESULT installLicenseInMemory(SAFEARRAY(BYTE) data);
data
Install the license from the memory buffer.