OXYGEN
HomeGitHubReleasesCommunity
  • Welcome to Oxygen
  • About
    • What is Oxygen?
    • Getting Started (Videos)
      • Oxygen IDE Controls Overview
      • Recording a Web Test
      • Oxygen Commands Explained
    • Getting help
  • Download and work with Oxygen
    • Download & Installation
      • Oxygen IDE Installation
      • Oxygen for Mobile Installation
      • Oxygen for Windows Desktop Automation Setup
      • Oxygen for Mac Installation
        • Mac Installation Troubleshooting
      • Oxygen CLI Installation
      • Java Installation Instructions
      • Recording Troubleshooting
    • Start working with Oxygen
      • Getting Started - Web
        • Introduction - Web Testing
        • Recording a Web Test
        • Creating a Web Test
        • Sample Project - Web Test
      • Getting Started - Mobile
        • Introduction - Mobile Testing
        • Recording a Test on Mobile
        • Creating a Test - Mobile
        • Sample Project - Mobile
      • Getting Started - Oxygen for Windows Desktop Automation
      • Getting Started- Oxyge CLI
        • Running a Test Script on Windows
        • Running Multiple Tests (Suites) on Windows
    • Oxygen Modules
      • assert
      • date
      • db
      • email
      • eyes
      • http
      • log
      • mailinator
      • mob
      • pdf
      • proxy
      • serial
      • shell
      • soap
      • twilio
      • utils
      • web
      • win
    • Test Parameters
  • Cloud Providers
    • Sauce Labs
    • Lambda Test
    • TestObject
  • Advanced programming in Oxygen
    • Project Configuration
    • Locating Elements
    • Page Objects
    • Environments
    • Code Components
Powered by GitBook
On this page
  • getBuffer
  • list
  • open
  • waitForText
  • write

Was this helpful?

  1. Download and work with Oxygen
  2. Oxygen Modules

serial

Provides methods for working with serial ports.

getBuffer

Return data buffer.

Returns:

CircularStringBuffer - Data buffer.

list

Returns list of available ports.

See https://github.com/EmergingTechnologyAdvisors/node-serialport#module_serialport--SerialPort.list for details about the structure of returned values.

Returns:

Array.<Object> - Array of port descriptions.

open

Opens a serial port.

Data from the opened port will be automatically read line by line into a circular buffer. Once the buffer reaches it's maximum capacity specified by bufferSize argument, eldest entries are evicted to make room for new data.

** Serial port properties with default values:**

{
 baudRate: 9600,
 dataBits: 8,        // Must be one of: 8, 7, 6, or 5.
 stopBits: 1,        // Must be one of: 1 or 2.
 parity: 'none'      // Must be one of: 'none', 'even', 'mark', 'odd', 'space'.
 rtscts: false,
 xon: false,
 xoff: false,
 xany: false
}

Parameters:

Name
Type
Description

port

String

Path to serial port. E.g. '/dev/tty-usbserial1', 'COM5', etc.

opts

Object

Port properties.

bufferSize

Number

optional Size of the input data buffer. Default is 65536 bytes.

Returns:

SerialPort - SerialPort object.

waitForText

Waits for text to appear in the input data buffer.

Text pattern can be any of the supported string matching patterns(on the top of page).

Parameters:

Name
Type
Description

pattern

String

Text pattern.

timeout

Number

optional Timeout in milliseconds. Default is 60 seconds.

write

Write data to the port.

** Usage example:**

serial.write('Hello\r\n');

Parameters:

Name
Type
Description

data

String|Array

Data to send. Either a string or an array of bytes.

PreviousproxyNextshell

Last updated 2 years ago

Was this helpful?