Skip to main content

No project description provided

Project description

PySerial driver

jumpstarter-driver-pyserial provides functionality for serial port communication.

Installation

:substitutions:
$ pip3 install --extra-index-url {{index_url}} jumpstarter-driver-pyserial

Configuration

Example configuration:

export:
  serial:
    type: jumpstarter_driver_pyserial.driver.PySerial
    config:
      url: "/dev/ttyUSB0"
      baudrate: 115200

Config parameters

Parameter Description Type Required Default
url The serial port to connect to, in pyserial format str yes
baudrate The baudrate to use for the serial connection int no 115200
check_existing Check if the serial port exists during exporter initialization, disable if you are connecting to a dynamically created port (i.e. USB from your DUT) bool no True

API Reference

.. autoclass:: jumpstarter_driver_pyserial.client.PySerialClient()
    :members: pexpect, open, stream, open_stream, close

Examples

Using expect with a context manager

with pyserialclient.pexpect() as session:
    session.sendline("Hello, world!")
    session.expect("Hello, world!")

Using expect without a context manager

session = pyserialclient.open()
session.sendline("Hello, world!")
session.expect("Hello, world!")
pyserialclient.close()

Using a simple BlockingStream with a context manager

with pyserialclient.stream() as stream:
    stream.send(b"Hello, world!")
    data = stream.receive()

Using a simple BlockingStream without a context manager

stream = pyserialclient.open_stream()
stream.send(b"Hello, world!")
data = stream.receive()
from jumpstarter_driver_pyserial.driver import PySerial
from jumpstarter.common.utils import serve

instance = serve(PySerial(url="loop://"))

pyserialclient = instance.__enter__()
instance.__exit__(None, None, None)

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

jumpstarter_driver_pyserial-0.7.0.tar.gz (5.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

jumpstarter_driver_pyserial-0.7.0-py3-none-any.whl (5.6 kB view details)

Uploaded Python 3

File details

Details for the file jumpstarter_driver_pyserial-0.7.0.tar.gz.

File metadata

File hashes

Hashes for jumpstarter_driver_pyserial-0.7.0.tar.gz
Algorithm Hash digest
SHA256 325203a735d3321264aecf7f8cec0ab0f003de0e961f382ab134e6a35fcea8f1
MD5 d62c2a9c2f8fdad05c5f4867f86db569
BLAKE2b-256 423444895f978fbe41522f04c910e09aba15290ef9b2d2c956656c5b00fcec64

See more details on using hashes here.

File details

Details for the file jumpstarter_driver_pyserial-0.7.0-py3-none-any.whl.

File metadata

File hashes

Hashes for jumpstarter_driver_pyserial-0.7.0-py3-none-any.whl
Algorithm Hash digest
SHA256 57d4eeb01463c9ae1c77a790f3cfbe13613e7783769350582c945d01f152c7c2
MD5 b7086191169d32348ea4151883eebaaa
BLAKE2b-256 2c3664b31d8aff56c5e2d1859b1147c5f762ae2769ebff6d089f8be03daebd7d

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page