Node SerialPort

Node SerialPort

  • Docs
  • GitHub
  • Languages iconEnglish
    • Español
    • Português (Brasil)
    • 中文
    • Help Translate

›API Parsers

Getting Started

  • About SerialPort
  • Support Environments
  • Installing SerialPort

Usage

  • SerialPort Usage
  • Command Line Tools
  • Debugging
  • Error Handling
  • Testing

API Core

  • SerialPort

API Bindings

  • Bindings
  • Mock Bindings
  • Abstract Binding

API Interfaces

  • Stream Interface

API Parsers

  • What are Parsers?
  • ByteLength Parser
  • ccTalk Parser
  • Delimiter Parser
  • InterByteTimeout Parser
  • Readline Parser
  • Ready Parser
  • Regex Parser
  • Slip Encoder Parser

Community

  • Code of Conduct
Edit

InterByteTimeout Parser

new InterByteTimeout(options)

Emits data if there is a pause between packets for the specified amount of time.

A transform stream that emits data as a buffer after not recieving any bytes for the specified amount of time.

Arguments

  • options.interval: number the period of silence in milliseconds after which data is emited
  • options.maxBufferSize: number the maximum number of bytes after which data will be emited. Defaults to 65536.

Example

const SerialPort = require('serialport')
const InterByteTimeout = require('@serialport/parser-inter-byte-timeout')
const port = new SerialPort('/dev/tty-usbserial1')
const parser = port.pipe(new InterByteTimeout({interval: 30}))
parser.on('data', console.log) // will emit data if there is a pause between packets of at least 30ms
← Delimiter ParserReadline Parser →
  • Example
Node SerialPort
Docs
Getting StartedGuides
Community
NodeBotsJohnny-FiveStack OverflowTwitter
More
GitHub
Copyright © 2019 Node SerialPort