-

ITerminalManager Interface

This interface consists of methods and properties supported by the Serial Terminal module.

This interface is exposed by the global object terminal.

Declaration

interface ITerminalManager {
    // Properties
    readonly sessions: ITerminalSession[];

    // Methods
    closeAllSessions(): void;
    createSession(portName: string, deviceConfig?: IDeviceConfig, showWindow?: boolean): ITerminalSession;
}
// This interface is not available in managed environment
// This interface is not available in native environment

ITerminalManager Properties

sessions

readonly sessions: ITerminalSession[];
// This property is not available in managed environment
// This property is not available in native environment

Returns the array of session objects.

Obtain a list of terminal sessions and print their baud rates:

var sessions = terminal.sessions;
for (var i = 0; i < sessions.length; ++i)
    alert(sessions[i].config.baudRate);

ITerminalManager Methods

closeAllSessions

closeAllSessions(): void;
// This method is not available in managed environment
// This method is not available in native environment

Call this method to stop and close all serial terminal sessions.

createSession

createSession(portName: string, deviceConfig?: IDeviceConfig, showWindow?: boolean): ITerminalSession;
// This method is not available in managed environment
// This method is not available in native environment
portName
The name of the device to create a session on.
deviceConfig
Optional device configuration object. If omitted, defaults provided by operating system are used.
showWindow
Pass true to create a visible terminal session, omit or pass false to create invisible session.

Returns the reference to created empty session object.

Creates new terminal session.

Create new terminal session:

var session = terminal.createSession("COM1", { baudRate: 115200, dataBits: 8, stopBits: 1, 
        parity: Terminal.Parity.None, flowControl: flowControl.hardware }, false);