Options
All
  • Public
  • Public/Protected
  • All
Menu

The main class for ComPort package

Hierarchy

  • ComPort

Index

Constructors

constructor

Methods

addEventListener

  • addEventListener(eventType: ComEventType, listener: (this: this, ev: CustomEvent<string>) => void): void
  • Adds a event listnere type for ComPort

    Parameters

    • eventType: ComEventType

      either two types of event rx or rx-msg

    • listener: (this: this, ev: CustomEvent<string>) => void

      a function callback for CustomEvent

        • (this: this, ev: CustomEvent<string>): void
        • Parameters

          • this: this
          • ev: CustomEvent<string>

          Returns void

    Returns void

connect

  • connect(baudrate: Baudrate): void
  • Connect to the serial port. This will open the request user dialog box.

    Parameters

    • baudrate: Baudrate

      : speed of connection e.g. 9600 or 115200

    Returns void

disconnect

  • disconnect(): Promise<void>

removeEventListener

  • removeEventListener(): void

sendLine

  • sendLine(line: string): void
  • Send a line of String

    Parameters

    • line: string

      : a line of string. The \n character will be added to end of the line

    Returns void

Legend

  • Constructor
  • Method

Generated using TypeDoc