Skip to content
Merged

V2 #45

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions docs/api/client_service_instance.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
ClientServiceInstance
=======================

.. autoclass:: someipy::ClientServiceInstance
:exclude-members: __init__
4 changes: 4 additions & 0 deletions docs/api/connect_to_someipy_daemon.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
connect_to_someipy_daemon
===========================

.. autofunction:: someipy::connect_to_someipy_daemon
5 changes: 5 additions & 0 deletions docs/api/event.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
Event
===========================

.. autoclass:: someipy::Event
:exclude-members: __init__
5 changes: 5 additions & 0 deletions docs/api/eventgroup.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
EventGroup
=======================

.. autoclass:: someipy::EventGroup
:exclude-members: __init__
32 changes: 32 additions & 0 deletions docs/api/index.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
API Reference
=======================

Classes
-----------------------

.. toctree::
:maxdepth: 1

service
service_builder
method
method_result
eventgroup
event
server_service_instance
client_service_instance
serialization
transport_layer_protocol
message_type
return_code



Functions
-----------------------

.. toctree::
:maxdepth: 1

connect_to_someipy_daemon
someipy_logging
5 changes: 5 additions & 0 deletions docs/api/message_type.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
MessageType
==========================

.. autoclass:: someipy::MessageType
:exclude-members: __init__
5 changes: 5 additions & 0 deletions docs/api/method.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
Method
===============

.. autoclass:: someipy::Method
:exclude-members: __init__
5 changes: 5 additions & 0 deletions docs/api/method_result.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
MethodResult
==========================

.. autoclass:: someipy::MethodResult
:exclude-members: __init__
5 changes: 5 additions & 0 deletions docs/api/return_code.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
ReturnCode
==========================

.. autoclass:: someipy::ReturnCode
:exclude-members: __init__
6 changes: 6 additions & 0 deletions docs/api/serialization.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
Serialization
=================

.. automodule:: someipy.serialization
:members:
:show-inheritance:
5 changes: 5 additions & 0 deletions docs/api/server_service_instance.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
ServerServiceInstance
=======================

.. autoclass:: someipy::ServerServiceInstance
:exclude-members: __init__
5 changes: 5 additions & 0 deletions docs/api/service.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
Service
=======================

.. autoclass:: someipy::Service
:exclude-members: __init__
5 changes: 5 additions & 0 deletions docs/api/service_builder.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
ServiceBuilder
=======================

.. autoclass:: someipy::ServiceBuilder
:exclude-members: __init__
4 changes: 4 additions & 0 deletions docs/api/someipy_logging.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
someipy_logging
=======================

.. automodule:: someipy.someipy_logging
5 changes: 5 additions & 0 deletions docs/api/transport_layer_protocol.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
TransportLayerProtocol
===========================

.. autoclass:: someipy::TransportLayerProtocol
:exclude-members: __init__
4 changes: 2 additions & 2 deletions docs/calling_methods.rst
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ In this example, we will call a SOME/IP method that calculates the sum of two si
Details on defining data types can be found :doc:`here <service_interface>`.

Step 2: Connect to the someipy Daemon
----------------------------------
--------------------------------------

The first step is to connect to the someipy daemon. The daemon is a separate process communicating with the application using someipy via a Unix Domain Socket (UDS). The daemon is responsible for handling all communication with the SOME/IP network, including service discovery and message sending/receiving.

Expand Down Expand Up @@ -125,7 +125,7 @@ To avoid the ``RuntimeError`` it is possible to test whether the service was alr
print(f"Error during method call: {e}")

Step 6: Shutdown the Application
----------------------------
--------------------------------

At the end of your application, make sure to stop offering the service instance and disconnect from the someipy daemon to ensure a clean shutdown of the application.

Expand Down
23 changes: 22 additions & 1 deletion docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,36 @@
# -- Project information -----------------------------------------------------
# https://www.sphinx-doc.org/en/master/usage/configuration.html#project-information

import sys
from pathlib import Path

project = "someipy"
copyright = "2025, Christian H."
author = "Christian H."
release = "1.0.0"

sys.path.insert(0, str(Path("..", "src").resolve()))

# -- General configuration ---------------------------------------------------
# https://www.sphinx-doc.org/en/master/usage/configuration.html#general-configuration

extensions = []
extensions = ["sphinx.ext.autodoc", "sphinx.ext.napoleon"]

# Napoleon settings
napoleon_google_docstring = True
napoleon_numpy_docstring = False
napoleon_include_init_with_doc = False
napoleon_include_private_with_doc = False
napoleon_include_special_with_doc = True

# Autodoc settings
autodoc_default_options = {
"members": True,
"undoc-members": True,
"private-members": False,
}

autodoc_typehints = "description" # Show type hints in description

templates_path = ["_templates"]
exclude_patterns = []
Expand Down
10 changes: 10 additions & 0 deletions docs/cookbook.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
Cookbook
==========================

.. toctree::
:maxdepth: 2

calling_methods
offering_methods
subscribing_events
offering_events
14 changes: 7 additions & 7 deletions docs/getting_started.rst
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
Getting Started
===============
=================

This guide demonstrates how to create a SOME/IP service using someipy that broadcasts temperature measurements every second. The complete example is available in the `example applications on GitHub <https://github.com/chrizog/someipy/blob/v2.0.0/example_apps/send_events_udp.py>`_.
This guide demonstrates how to create a SOME/IP service using someipy that broadcasts temperature measurements every second using SOME/IP events. The complete example is available in the `example applications on GitHub <https://github.com/chrizog/someipy/blob/v2.0.0/example_apps/send_events_udp.py>`_.

Prerequisites
------------
----------------

- Linux (Ubuntu 22.04 or equivalent)
- Python 3.8+
Expand All @@ -19,12 +19,12 @@ Install someipy from PyPI:

pip3 install someipy

Service Datatype Definition
Service Data Type Definition
---------------------------

Define the temperature data structure using Python dataclasses. No IDL files required.

Create **temperature_msg.py**:
Create ``temperature_msg.py``:

.. code-block:: python

Expand Down Expand Up @@ -64,7 +64,7 @@ someipy is an `asyncio <https://docs.python.org/3/library/asyncio.html>`_ based

First we will set up our application's structure. Typically in an asyncio application, a main coroutine-function is added which is executed using `asyncio.run <https://docs.python.org/3/library/asyncio-runner.html#id1>`_. Our application's logic will be added inside the main coroutine-function *async def main*.

Create **send_events_udp.py** with the following structure:
Create ``send_events_udp.py`` with the following structure:

.. code-block:: python

Expand Down Expand Up @@ -265,4 +265,4 @@ Run the application using Python 3:

.. code-block:: bash

python3 send_events_udp.py
python3 send_events_udp.py
10 changes: 4 additions & 6 deletions docs/index.rst
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
someipy - An Open-Source Python library for SOME/IP
====================================
=====================================================

This is the documentation for someipy, an open-source Python library implementing the SOME/IP protocol, including SOME/IP Service Discovery. It is designed for fast prototyping of applications making SOME/IP more accessible to developers.

Expand Down Expand Up @@ -30,15 +30,13 @@ Table of Contents
=================

.. toctree::
:maxdepth: 1
:maxdepth: 2

whatsnew
getting_started
cookbook
someipy_daemon
calling_methods
offering_events
offering_methods
subscribing_events
service_discovery
service_interface
changelog
api/index
6 changes: 3 additions & 3 deletions docs/offering_events.rst
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ The constructor of the ``ServerServiceInstance`` class requires several paramete
- endpoint_ip: The IP address of the network interface on which the service is offered (127.0.0.1 in this example)
- endpoint_port: The port on which the service is offered (3000 in this example)
- ttl: The time-to-live for the service discovery entries (5 seconds in this example)
- cyclic_offer_delay_ms: The period of the cylic offer service SD messages (2000 ms in this example)
- cyclic_offer_delay_ms: The period of the cyclic offer service SD messages (2000 ms in this example)

.. code-block:: python

Expand Down Expand Up @@ -115,11 +115,11 @@ Now that the service is offered, clients can subscribe to the eventgroup with ID
Typical sending strategies for SOME/IP events are **cyclic updates** or **update on change**. Update on change means that an event is sent whenever the contained value changes. In a cyclic update, the event would be sent even if the contained data has not changed since the last publish.

Step 6: Shutdown the Application
----------------------------
------------------------------------------------

At the end of your application, make sure to stop offering the service instance and disconnect from the someipy daemon to ensure a clean shutdown of the application.

.. code-block:: python

await service_instance_temperature.stop_offer()
await someipy_daemon.disconnect_from_daemon()
await someipy_daemon.disconnect_from_daemon()
6 changes: 3 additions & 3 deletions docs/offering_methods.rst
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ The constructor of the ``ServerServiceInstance`` class requires several paramete
- endpoint_ip: The IP address of the network interface on which the service is offered (127.0.0.1 in this example)
- endpoint_port: The port on which the service is offered (3000 in this example)
- ttl: The time-to-live for the service discovery entries (5 seconds in this example)
- cyclic_offer_delay_ms: The period of the cylic offer service SD messages (2000 ms in this example)
- cyclic_offer_delay_ms: The period of the cyclic offer service SD messages (2000 ms in this example)

.. code-block:: python

Expand All @@ -155,11 +155,11 @@ Step 6: Announce the Service via Service Discovery
await service_instance_addition.start_offer()

Step 7: Shutdown the Application
----------------------------
---------------------------------

At the end of your application, make sure to stop offering the service instance and disconnect from the someipy daemon to ensure a clean shutdown of the application.

.. code-block:: python

await service_instance_temperature.stop_offer()
await someipy_daemon.disconnect_from_daemon()
await someipy_daemon.disconnect_from_daemon()
Loading