interface ISerialPortLibrary {
// Properties
${compatibilityFlags}: ${CompatibilityFlags};
// Methods
${createAliasPort}(port?: number | string, deviceName?: string): ${IAliasPortDevice};
${createAliasPortEx}(options?: ${IPortCreationParams}): ${IAliasPortDevice};
${createBridgePort}(port?: number | string, deviceName?: string): ${IBridgePortDevice};
${createBridgePortEx}(options?: ${IPortCreationParams}): ${IBridgePortDevice};
${createSharedPort}(port?: number | string, reserved?: boolean, deviceName?: string): ${ISharedPortDevice};
${createSharedPortEx}(options?: ${IPortCreationParams}): ${ISharedPortDevice};
${createScriptPort}(port?: number | string, deviceName?: string): ${IScriptPortDevice};
${createScriptPortEx}(options?: ${IPortCreationParams}): ${IScriptPortDevice};
${createTcpPort}(port?: number | string, deviceName?: string): ${ITcpPortDevice};
${createTcpPortEx}(options?: ${IPortCreationParams}): ${ITcpPortDevice};
${createRemotePort}(port?: number | string, deviceName?: string): ${IRemotePortDevice};
${createRemotePortEx}(options?: ${IPortCreationParams}): ${IRemotePortDevice};
${createPipePort}(port?: number | string, deviceName?: string): ${IPipePortDevice};
${createPipePortEx}(options?: ${IPortCreationParams}): ${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);
${IAliasPortDevice} ${createAliasPortEx}(object options);
${IBridgePortDevice} ${createBridgePort}(object port, string deviceName);
${IBridgePortDevice} ${createBridgePortEx}(object options);
${ISharedPortDevice} ${createSharedPort}(object port, bool reserved, string deviceName);
${ISharedPortDevice} ${createSharedPortEx}(object options);
${IScriptPortDevice} ${createScriptPort}(object port, string deviceName);
${IScriptPortDevice} ${createScriptPortEx}(object options);
${ITcpPortDevice} ${createTcpPort}(object port, string deviceName);
${ITcpPortDevice} ${createTcpPortEx}(object options);
${IRemotePortDevice} ${createRemotePort}(object port, string deviceName);
${IRemotePortDevice} ${createRemotePortEx}(object options);
${IPipePortDevice} ${createPipePort}(object port, string deviceName);
${IPipePortDevice} ${createPipePortEx}(object options);
Array ${getRemoteSharedPorts}(string hostName);
Array ${getPorts}(${SerialPortType} type);
${ITimeouts} ${createTimeoutsObject}(uint readIntervalTimeout,
uint readTotalTimeoutMultiplier,
uint readTotalTimeoutConstant,
uint writeTotalTimeoutMultiplier,
uint writeTotalTimeoutConstant);
${IPortCreationParams} ${createPortCreationParams}(object portName, object deviceName, object compatibilityFlags);
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);
${IAliasPortDevicePtr#IAliasPortDevice} ${createAliasPortEx}(const _variant_t & options);
${IBridgePortDevicePtr#IBridgePortDevice} ${createBridgePort}(const _variant_t & port, VARIANT deviceName);
${IBridgePortDevicePtr#IBridgePortDevice} ${createBridgePortEx}(const _variant_t & options);
${ISharedPortDevicePtr#ISharedPortDevice} ${createSharedPort}(const _variant_t & port, VARIANT reserved, VARIANT deviceName);
${ISharedPortDevicePtr#ISharedPortDevice} ${createSharedPortEx}(const _variant_t & options);
${IScriptPortDevicePtr#IScriptPortDevice} ${createScriptPort}(const _variant_t & port, VARIANT deviceName);
${IScriptPortDevicePtr#IScriptPortDevice} ${createScriptPortEx}(const _variant_t & options);
${ITcpPortDevicePtr#ITcpPortDevice} ${createTcpPort}(const _variant_t & port, VARIANT deviceName);
${ITcpPortDevicePtr#ITcpPortDevice} ${createTcpPortEx}(const _variant_t & options);
${IRemotePortDevicePtr#IRemotePortDevice} ${createRemotePort}(const _variant_t & port, VARIANT deviceName);
${IRemotePortDevicePtr#IRemotePortDevice} ${createRemotePortEx}(const _variant_t & options);
${IPipePortDevicePtr#IPipePortDevice} ${createPipePort}(const _variant_t & port, VARIANT deviceName);
${IPipePortDevicePtr#IPipePortDevice} ${createPipePortEx}(const _variant_t & options);
SAFEARRAY(${IRemotePortDescription}) ${getRemoteSharedPorts}(_bstr_t hostName);
SAFEARRAY(${IDevice}) ${getPorts}(${SerialPortType} type);
${ITimeoutsPtr#ITimeouts} ${createTimeoutsObject}(unsigned readIntervalTimeout,
unsigned readTotalTimeoutMultiplier,
unsigned readTotalTimeoutConstant,
unsigned writeTotalTimeoutMultiplier,
unsigned writeTotalTimeoutConstant);
${IPortCreationParamsPtr#IPortCreationParams} ${createPortCreationParams}(const _variant_t & portName, const _variant_t & deviceName, const _variant_t & compatibilityFlags);
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. Changing this value sets the global defaults to be used by all virtual serial ports created after the last update.
Virtual device compatibility flags may also be specified for each individual device when creating them using “extended” creation methods: createAliasPortEx, createBridgePortEx, createSharedPortEx, createScriptPortEx, createTcpPortEx, createRemotePortEx or createPipePortEx.
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.
createAliasPortEx(options?: ${IPortCreationParams}): ${IAliasPortDevice};
${IAliasPortDevice} createAliasPortEx(object options);
${IAliasPortDevicePtr#IAliasPortDevice} createAliasPortEx(const _variant_t & options);
optionsThe 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.
createBridgePortEx(options?: ${IPortCreationParams}): ${IBridgePortDevice};
${IBridgePortDevice} createBridgePortEx(object options);
${IBridgePortDevicePtr#IBridgePortDevice} createBridgePortEx(const _variant_t & options);
optionsThe method returns a reference to created port device.
Create new bridge virtual serial port.
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.
createScriptPortEx(options?: ${IPortCreationParams}): ${IScriptPortDevice};
${IScriptPortDevice} createScriptPortEx(object options);
${IScriptPortDevicePtr#IScriptPortDevice} createScriptPortEx(const _variant_t & options);
optionsThe method returns a reference to created port device.
Create new script virtual 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.
createTcpPortEx(options?: ${IPortCreationParams}): ${ITcpPortDevice};
${ITcpPortDevice} createTcpPortEx(object options);
${ITcpPortDevicePtr#ITcpPortDevice} createTcpPortEx(const _variant_t & options);
optionsThe 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.
createRemotePortEx(options?: ${IPortCreationParams}): ${IRemotePortDevice};
${IRemotePortDevice} createRemotePortEx(object options);
${IRemotePortDevicePtr#IRemotePortDevice} createRemotePortEx(const _variant_t & options);
optionsThe 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.
createPipePortEx(options?: ${IPortCreationParams}): ${IPipePortDevice};
${IPipePortDevice} createPipePortEx(object options);
${IPipePortDevicePtr#IPipePortDevice} createPipePortEx(const _variant_t & options);
optionsThe method returns a reference to created port device.
Create new alias 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
${IPortCreationParams} createPortCreationParams(object portName, object deviceName, object compatibilityFlags);
${IPortCreationParamsPtr#IPortCreationParams} createPortCreationParams(const _variant_t & portName, const _variant_t & deviceName, const _variant_t & compatibilityFlags);
portNameCOMn.deviceNamecompatibilityFlagsCreate and initialize the IPortCreationParams object. All parameters are optional. Port name, device name and compatibility flags may also be set directly on a created object.
Scripting clients do not need to use this method, they may use any compatible object that corresponds to the IPortCreationParams interface.
// 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.