Skip to main content

No project description provided

Project description

PySerial driver

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

Installation

pip3 install --extra-index-url https://pkg.jumpstarter.dev/simple/ 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.6.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.6.0-py3-none-any.whl (5.6 kB view details)

Uploaded Python 3

File details

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

File metadata

File hashes

Hashes for jumpstarter_driver_pyserial-0.6.0.tar.gz
Algorithm Hash digest
SHA256 8f0cc569439d79380051784fd4442e84182472b4b890455f3e5fb27e810c5e7a
MD5 c12c0d6796681203f081acd6128add83
BLAKE2b-256 493c84078252c116cdaea3c9591060c3b348a3a7d0205a77204253293b982397

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for jumpstarter_driver_pyserial-0.6.0-py3-none-any.whl
Algorithm Hash digest
SHA256 49cd53676f5b769b66906b1e0fab724c249a4ff7e6c69bb24c041b62b188dac3
MD5 2688dffd4b376d2dfda34199695612c8
BLAKE2b-256 2865d5cc269fe1f95c4ddeb55ca36f16e17f47cf4e1fc0300040080623e1325b

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