web-serial-rxjs API Documentation
    Preparing search index...

    Interface SerialSessionOptions

    Options for creating a SerialSession via createSerialSession.

    Composes Partial<SerialConnectionOptions> (W3C connection parameters passed to port.open) with SerialSessionFeatureOptions (library-specific session features). All connection fields are optional; omitted values fall back to DEFAULT_SERIAL_SESSION_OPTIONS (baudRate 9600, dataBits 8, stopBits 1, parity 'none', bufferSize 255, flowControl 'none').

    const session = createSerialSession({
    baudRate: 115200,
    dataBits: 8,
    stopBits: 1,
    parity: 'none',
    flowControl: 'none',
    filters: [{ usbVendorId: 0x1234, usbProductId: 0x5678 }],
    });
    interface SerialSessionOptions {
        baudRate?: number;
        bufferSize?: number;
        dataBits?: 8 | 7;
        filters?: SerialPortFilter[];
        flowControl?: FlowControlType;
        lineBuffer?: LineBufferOptions;
        parity?: ParityType;
        receiveReplay?: SerialSessionReceiveReplayOptions;
        stopBits?: 1 | 2;
        terminalBuffer?: TerminalBufferOptions;
    }

    Hierarchy (View Summary)

    Index
    baudRate?: number
    bufferSize?: number
    dataBits?: 8 | 7
    filters?: SerialPortFilter[]

    Filters for port selection when requesting a port.

    When specified, the port selection dialog will only show devices matching these filters. Each filter can specify usbVendorId and/or usbProductId.

    flowControl?: FlowControlType
    lineBuffer?: LineBufferOptions

    Limits for the incomplete line tail held by SerialSession.lines$ framing. When exceeded, leading characters are discarded and a non-fatal SerialErrorCode.LINE_BUFFER_OVERFLOW is emitted on SerialSession.errors$.

    { maxChars: 1048576 } (see DEFAULT_SERIAL_SESSION_OPTIONS)

    parity?: ParityType

    Optional receive replay: retain recent decoded text chunks so late subscribers to SerialSession.receiveReplay$ can read buffered data while a connection is active. Does not change SerialSession.receive$.

    { enabled: false, bufferSize: 512 } (see DEFAULT_SERIAL_SESSION_OPTIONS)

    stopBits?: 1 | 2
    terminalBuffer?: TerminalBufferOptions

    Limits for SerialSession.terminalText$ display memory. Oldest completed lines and leading characters are dropped when exceeded.

    { maxLines: 10000, maxChars: 1048576 } (see DEFAULT_SERIAL_SESSION_OPTIONS)