interface ISerialPortLibrary {
// Properties
${compatibilityFlags}: ${CompatibilityFlags};
// Methods
${createAliasPort}(port?: number | string, deviceName?: string): ${IAliasPortDevice};
${createBridgePort}(port?: number | string, deviceName?: string): ${IBridgePortDevice};
${createSharedPort}(port?: number | string, reserved?: boolean, deviceName?: string): ${ISharedPortDevice};
${createScriptPort}(port?: number | string, deviceName?: string): ${IScriptPortDevice};
${createTcpPort}(port?: number | string, deviceName?: string): ${ITcpPortDevice};
${createRemotePort}(port?: number | string, deviceName?: string): ${IRemotePortDevice};
${createPipePort}(port?: number | string, deviceName?: 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}[];
${getPortsJs#getPortsJs7}(type: ${SerialPortType.Script#SerialPortType}): ${IScriptPortDevice}[];
${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, string deviceName);
${IBridgePortDevice} ${createBridgePort}(object port, string deviceName);
${ISharedPortDevice} ${createSharedPort}(object port, bool reserved, string deviceName);
${IScriptPortDevice} ${createScriptPort}(object port, string deviceName);
${ITcpPortDevice} ${createTcpPort}(object port, string deviceName);
${IRemotePortDevice} ${createRemotePort}(object port, string deviceName);
${IPipePortDevice} ${createPipePort}(object port, string deviceName);
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, VARIANT deviceName);
${IBridgePortDevicePtr#IBridgePortDevice} ${createBridgePort}(const _variant_t & port, VARIANT deviceName);
${ISharedPortDevicePtr#ISharedPortDevice} ${createSharedPort}(const _variant_t & port, VARIANT reserved, VARIANT deviceName);
${IScriptPortDevicePtr#IScriptPortDevice} ${createScriptPort}(const _variant_t & port, VARIANT deviceName);
${ITcpPortDevicePtr#ITcpPortDevice} ${createTcpPort}(const _variant_t & port, VARIANT deviceName);
${IRemotePortDevicePtr#IRemotePortDevice} ${createRemotePort}(const _variant_t & port, VARIANT deviceName);
${IPipePortDevicePtr#IPipePortDevice} ${createPipePort}(const _variant_t & port, VARIANT deviceName);
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, deviceName?: string): ${IAliasPortDevice};
${IAliasPortDevice} createAliasPort(object port, string deviceName);
${IAliasPortDevicePtr#IAliasPortDevice} createAliasPort(const _variant_t & port, VARIANT deviceName);
portCOMn. If omitted, a next available port number is automatically selected.deviceNameVT_EMPTY or VT_BSTR.The method returns a reference to created port device.
Create new alias virtual serial port.
createBridgePort(port?: number | string, deviceName?: string): ${IBridgePortDevice};
${IBridgePortDevice} createBridgePort(object port, string deviceName);
${IBridgePortDevicePtr#IBridgePortDevice} createBridgePort(const _variant_t & port, VARIANT deviceName);
portCOMn. If omitted, a next available port number is automatically selected.deviceNameVT_EMPTY or VT_BSTR.The method returns a reference to created port device.
Create new virtual serial port that will act as one of the local bridge sides.
createScriptPort(port?: number | string, deviceName?: string): ${IScriptPortDevice};
${IScriptPortDevice} createScriptPort(object port, string deviceName);
${IScriptPortDevicePtr#IScriptPortDevice} createScriptPort(const _variant_t & port, VARIANT deviceName);
portCOMn. If omitted, a next available port number is automatically selected.deviceNameVT_EMPTY or VT_BSTR.The method returns a reference to created port device.
Create new virtual script serial port.
createTcpPort(port?: number | string, deviceName?: string): ${ITcpPortDevice};
${ITcpPortDevice} createTcpPort(object port, string deviceName);
${ITcpPortDevicePtr#ITcpPortDevice} createTcpPort(const _variant_t & port, VARIANT deviceName);
portCOMn. If omitted, a next available port number is automatically selected.deviceNameVT_EMPTY or VT_BSTR.The method returns a reference to created port device.
Create new TCP virtual serial port.
createRemotePort(port?: number | string, deviceName?: string): ${IRemotePortDevice};
${IRemotePortDevice} createRemotePort(object port, string deviceName);
${IRemotePortDevicePtr#IRemotePortDevice} createRemotePort(const _variant_t & port, VARIANT deviceName);
portCOMn. If omitted, a next available port number is automatically selected.deviceNameVT_EMPTY or VT_BSTR.The method returns a reference to created port device.
Create new remote virtual serial port.
createPipePort(port?: number | string, deviceName?: string): ${IPipePortDevice};
${IPipePortDevice} createPipePort(object port, string deviceName);
${IPipePortDevicePtr#IPipePortDevice} createPipePort(const _variant_t & port, VARIANT deviceName);
portCOMn. If omitted, a next available port number is automatically selected.deviceNameVT_EMPTY or VT_BSTR.Create new pipe virtual serial port.
// This method is not available in scripting environment
Array getPorts(${SerialPortType} type);
SAFEARRAY(${IDevice}) getPorts(${SerialPortType} type);
typeThis 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
typeThis 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
typeThis 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
typeThis 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
typeThis 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
typeThis 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
typeThis 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
typeThis method returns an array of all TCP/IP virtual serial port devices.
getPortsJs(type: ${SerialPortType.Script#SerialPortType}): ${IScriptPortDevice}[];
// This method is not available in managed environment
// This method is not available in native environment
typeThis method returns an array of all script 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);
readIntervalTimeoutreadTotalTimeoutMultiplierreadTotalTimeoutConstantwriteTotalTimeoutMultiplierwriteTotalTimeoutConstantThis 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);
pListenerAdds 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);
pListenerRemoves specified listener object from the list of listener objects.
installLicenseFile(path: string): void;
void installLicenseFile(string path);
HRESULT installLicenseFile(_bstr_t path);
pathInstall 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);
dataInstall the license from the memory buffer.