Virtual Serial Port Tools - Advanced serial port configurations for your custom ports usage scenario
Download Virtual Serial Port Tools Hide this button

IScriptDevice Interface

This interface must be implemented by a custom device script.

NOTE

This interface consists of optional members. A device script utilizing a pull model and not requiring custom parameter support will actually “inherit” none of this interface members.

Declaration

interface IScriptDevice {

    // Methods
    ${onSend}(data: Uint8Array): Promise<void>;
    ${setParam}(name: string, value: string): void;
}
public interface IScriptDevice
{

    // Methods
}
struct IScriptDevice : IDispatch
{

    // Methods
};

IScriptDevice Methods

onSend

onSend(data: Uint8Array): Promise<void>;
// This method is not available in managed environment
// This method is not available in native environment
data
A copy of the data from the port's output queue.

This optional method must be implemented by a device script utilizing a push model. Application's write request will not be completed until the promise returned by this method is resolved.

setParam

setParam(name: string, value: string): void;
// This method is not available in managed environment
// This method is not available in native environment
name
A custom parameter name.
value
A custom parameter value.

This optional method must be implemented by a device script that wants to provide external code a way to customize its behavior.

An external caller may either use the IScriptPortDevice.setScriptParam method or send a custom IOCTL_SCRIPTPORT_SET_PARAM I/O control request to an opened port.