Skip to content

Commit

Permalink
Merge pull request #121 from jumpstarter-dev/build-contrib-driver-docs
Browse files Browse the repository at this point in the history
Build contrib driver docs
  • Loading branch information
kirkbrauer authored Oct 10, 2024
2 parents eef116a + 891f1c0 commit ee6a9bf
Show file tree
Hide file tree
Showing 8 changed files with 63 additions and 2 deletions.
3 changes: 2 additions & 1 deletion docs/source/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,9 @@ getting-started/index.md
cli/index.md
config.md
drivers.md
architecture.md
glossary.md
reference.md
reference/index.md
```

## Resources
Expand Down
13 changes: 13 additions & 0 deletions docs/source/reference/contrib/can.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# CAN driver

The CAN driver is a driver for using CAN bus connections.

```{eval-rst}
.. autoclass:: jumpstarter_driver_can.client.CanClient
:members:
```

```{eval-rst}
.. autoclass:: jumpstarter_driver_can.client.IsoTpClient
:members:
```
12 changes: 12 additions & 0 deletions docs/source/reference/contrib/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# Driver Packages

Driver packages from the [contrib](https://github.com/jumpstarter-dev/jumpstarter/tree/main/contrib)
directory are additional drivers that are not part of
the jumpstarter core package, we package them separately to keep the core as
lightweight and dependency-free as possible.

```{toctree}
ustreamer.md
can.md
sdwire.md
```
13 changes: 13 additions & 0 deletions docs/source/reference/contrib/sdwire.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# SDWire driver

The SDWire driver is an storgate multiplexer driver for using the SDWire
multiplexer. This device multiplexes an SD card between the DUT and the
exporter host.

The SDWire driver implements the `StorageMuxClient` class, which is a generic
storage class.

```{eval-rst}
.. autoclass:: jumpstarter.drivers.storage.client.StorageMuxClient
:members:
```
10 changes: 10 additions & 0 deletions docs/source/reference/contrib/ustreamer.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# Ustreamer driver

The Ustreamer driver is a driver for using the ustreamer video streaming server
driven by the jumpstarter exporter. This driver takes a video device and
exposes both snapshot and streaming interfaces.

```{eval-rst}
.. autoclass:: jumpstarter_driver_ustreamer.client.UStreamerClient
:members:
```
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# API Reference
# Driver API Reference

```{warning}
This project is still evolving, so these docs may be incomplete or out-of-date.
Expand Down
8 changes: 8 additions & 0 deletions docs/source/reference/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# API Reference

This section provides details on the Jumpstarter core API and contrib drivers.

```{toctree}
drivers.md
contrib/index.md
```
4 changes: 4 additions & 0 deletions jumpstarter/drivers/storage/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,15 @@

class StorageMuxClient(DriverClient):
def host(self):
"""Connect storage to host"""
return self.call("host")

def dut(self):
"""Connect storage to dut"""
return self.call("dut")

def off(self):
"""Disconnect storage"""
return self.call("off")

def write(self, handle):
Expand All @@ -25,6 +28,7 @@ def write_file(self, operator: Operator, path: str):
return self.call("write", handle)

def write_local_file(self, filepath):
"""Write a local file to the storage device"""
absolute = Path(filepath).resolve()
with OpendalAdapter(client=self, operator=Operator("fs", root="/"), path=str(absolute)) as handle:
return self.call("write", handle)
Expand Down

0 comments on commit ee6a9bf

Please sign in to comment.