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

    Interface SerialSessionOptions

    Options for creating a SerialSession via createSerialSession.

    These options configure the serial port connection parameters used when calling port.open and navigator.serial.requestPort. All properties are optional; omitted fields fall back to DEFAULT_SERIAL_SESSION_OPTIONS.

    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?: 7 | 8;
        filters?: SerialPortFilter[];
        flowControl?: "none" | "hardware";
        parity?: "none" | "even" | "odd";
        receiveReplay?: SerialSessionReceiveReplayOptions;
        stopBits?: 1 | 2;
    }
    Index

    Properties

    baudRate?: number

    Baud rate for the serial port connection (bits per second).

    Common values include 9600, 19200, 38400, 57600, 115200, etc. Must match the baud rate configured on the connected device.

    9600
    
    bufferSize?: number

    Buffer size for the underlying read stream, in bytes.

    255
    
    dataBits?: 7 | 8

    Number of data bits per character (7 or 8).

    8
    
    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?: "none" | "hardware"

    Flow control mode.

    'none'
    
    parity?: "none" | "even" | "odd"

    Parity checking mode.

    'none'
    

    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

    Number of stop bits (1 or 2).

    1