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.1.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.1-py3-none-any.whl (5.6 kB view details)

Uploaded Python 3

File details

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

File metadata

File hashes

Hashes for jumpstarter_driver_pyserial-0.7.1.tar.gz
Algorithm Hash digest
SHA256 610ec0e6aee291444d8bd9b19ba57e2c899fa02d7d49b11d735342ce65fa6053
MD5 cb340485ca93c77b4262d3c89be77d17
BLAKE2b-256 82bdfb8b3100eabecec25d764e5cdd1e023d1aaf5f5ff5427bc38b6111ebe272

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for jumpstarter_driver_pyserial-0.7.1-py3-none-any.whl
Algorithm Hash digest
SHA256 2f9be6a62c549640a89bd4754cec8ef9b3369f9164a9fa07e9cbf96a6ecb3185
MD5 898f07e6167f785112212147c02f8048
BLAKE2b-256 ff08534d916c5ec6eeafea875bffb3c16f8c4e015d206dba5449d9b7f8fcbe56

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