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

    Interface SerialClientOptions

    Options for creating a SerialClient instance.

    These options configure the serial port connection parameters. All properties are optional and will use default values if not specified. See DEFAULT_SERIAL_CLIENT_OPTIONS for the default values used.

    const client = createSerialClient({
    baudRate: 115200,
    dataBits: 8,
    stopBits: 1,
    parity: 'none',
    flowControl: 'none',
    filters: [{ usbVendorId: 0x1234, usbProductId: 0x5678 }],
    });
    interface SerialClientOptions {
        baudRate?: number;
        bufferSize?: number;
        dataBits?: 7 | 8;
        filters?: SerialPortFilter[];
        flowControl?: "none" | "hardware";
        parity?: "none" | "even" | "odd";
        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 reading data from the serial port, in bytes.

    This determines how much data can be buffered before it needs to be read. Larger buffers can improve performance but use more memory.

    255
    
    dataBits?: 7 | 8

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

    • 7: Seven data bits (used with parity)
    • 8: Eight data bits (most common, used without parity)
    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 to filter by USB device identifiers.

    filters: [
    { usbVendorId: 0x1234 },
    { usbVendorId: 0x1234, usbProductId: 0x5678 },
    ]

    SerialPortFilter for the filter structure

    flowControl?: "none" | "hardware"

    Flow control mode.

    • 'none': No flow control (most common)
    • 'hardware': Hardware flow control (RTS/CTS)
    'none'
    
    parity?: "none" | "even" | "odd"

    Parity checking mode.

    • 'none': No parity checking (most common)
    • 'even': Even parity
    • 'odd': Odd parity
    'none'
    
    stopBits?: 1 | 2

    Number of stop bits (1 or 2).

    • 1: One stop bit (most common)
    • 2: Two stop bits (less common, used for slower devices)
    1