This interface must be implemented by a custom device script.
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.
interface IScriptDevice {
// Methods
${onSend}(data: Uint8Array): Promise<void>;
${setParam}(name: string, value: string): void;
}
public interface IScriptDevice
{
// Methods
}
struct IScriptDevice : IDispatch
{
// Methods
};
onSend(data: Uint8Array): Promise<void>;
// This method is not available in managed environment
// This method is not available in native environment
data
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(name: string, value: string): void;
// This method is not available in managed environment
// This method is not available in native environment
name
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.