Introduced a new `--procimg` argument to specify the process image path.
Updated `MiddlewareDaemon` to dynamically reset D-Bus when `procimg`
changes and pass the configured path to bus providers.
Signed-off-by: Sven Sager <s.sager@kunbus.com>
Added informational log messages to track when `REVPI_DBUS_NAME` is
published and its connection is closed in both `BusProviderIos1` and
`BusProviderMiddleware1`.
Signed-off-by: Sven Sager <s.sager@kunbus.com>
Added support for a configurable `bus_provider` via command-line
arguments, enabling either "middleware" or "ios" as valid options.
Refactored `MiddlewareDaemon` to dynamically handle the selected bus
provider and streamline D-Bus management.
Signed-off-by: Sven Sager <s.sager@kunbus.com>
Introduced a `name` property returning `REVPI_DBUS_NAME` in classes
`BusProviderMiddleware1` and `BusProviderIos1`.
Signed-off-by: Sven Sager <s.sager@kunbus.com>
Replaced direct `SystemBus` and `SessionBus` instances with
address-based D-Bus connections. BusProviders will open their own bus
connections and close it at the end.
Signed-off-by: Sven Sager <s.sager@kunbus.com>
Introduced a threading `Event` named `published` in `bus_provider_ios1`
and `bus_provider_middleware1` modules to signal successful D-Bus
publishing.
Signed-off-by: Sven Sager <s.sager@kunbus.com>
Implemented checks in `MiddlewareDaemon` to monitor the status of
`bp_middleware1` and `bp_ios1` threads. Added automatic restarts for
non-alive threads using `dbus_start`.
Signed-off-by: Sven Sager <s.sager@kunbus.com>
Renamed and moved `BusProvider` and `BusProviderIo` to
`BusProviderMiddleware1` and `BusProviderIos1` respectively for better
clarity and modular organization. Updated all related imports and
references accordingly.
Signed-off-by: Sven Sager <s.sager@kunbus.com>
Enhanced the `dbus_stop` method in `MiddlewareDaemon` to support an
optional `bus_filter` parameter, allowing selective stopping of bus
providers. Updated imports to include `List` from `typing`.
Signed-off-by: Sven Sager <s.sager@kunbus.com>
Replaced `bus_provider` and `io_bus_provider` with `bp_middleware1` and
`bp_ios1` to improve naming consistency and readability in
`MiddlewareDaemon`.
Signed-off-by: Sven Sager <s.sager@kunbus.com>
Replaced direct D-Bus initialization with
`get_new_system_dbus_connection` and `get_new_session_dbus_connection`
helper functions. This functions will create a new connection to use
separate busses.
Signed-off-by: Sven Sager <s.sager@kunbus.com>
Introduced methods for retrieving input and output object paths in the
`InterfaceDevice` class. Removed `inp` and `out` properties in favor of
these methods.
Signed-off-by: Sven Sager <s.sager@kunbus.com>
Modified `get_io_object_path` and `get_device_object_path` functions to
accept full `IOBase` and `Device` objects instead of string identifiers.
All properties are available in case of changing the object path format.
Signed-off-by: Sven Sager <s.sager@kunbus.com>
Streamlined device management by introducing a dedicated `object_path`
property in `InterfaceDevice`. Refactored `InterfaceDeviceManager` to
use this property and accept a list of `InterfaceDevice` instances,
removing direct `RevPiModIO` dependencies. Updated D-Bus publishing to
reflect the new structure.
Signed-off-by: Sven Sager <s.sager@kunbus.com>
Updated method name in D-Bus interface and backend to do not use the
same name as org.freedesktop.DBus.Properties. Som libs will map all
methods of a node to an object for direct calling. If the names are the
same, you have to filter the interface.
Signed-off-by: Sven Sager <s.sager@kunbus.com>
Added `PropertiesChanged` signals for `byteorder` and `signed` property
updates. Updated D-Bus interface annotations to specify change signal
behavior for properties. Simplified `emit_io_change` implementation.
Signed-off-by: Sven Sager <s.sager@kunbus.com>
Introduced `SetByteorder` and `SetSigned` methods in both the `Input`
and `Output` D-Bus interfaces, and added the `SetValue` method
specifically for the `Output` interface. Implemented corresponding
methods in the backend.
Signed-off-by: Sven Sager <s.sager@kunbus.com>
Introduced `GetByName` and `GetByPosition` methods in the D-Bus
interface and implementation for retrieving device object paths by name
or position. Updated `GetAllDevices` return type to `ao`.
Signed-off-by: Sven Sager <s.sager@kunbus.com>
Introduced a new `position` property with read access in the D-Bus
interface and implemented its corresponding method.
Signed-off-by: Sven Sager <s.sager@kunbus.com>
Renamed `ActivateIoEvents` to `ActivateIoSignals` and
`DeactivateIoEvents` to `DeactivateIoSignals` in both the D-Bus
interface and implementation to better align with D-Bus signal
semantics.
Signed-off-by: Sven Sager <s.sager@kunbus.com>
Added a fallback mechanism to handle cases where integer values exceed
valid range by using raw byte arrays (`ay`). Updated D-Bus methods and
properties to support this behavior.
Signed-off-by: Sven Sager <s.sager@kunbus.com>
Introduced the `bitaddress` property with read-write access to `Input`
and `Output` D-Bus interfaces. Implemented corresponding property
methods.
Signed-off-by: Sven Sager <s.sager@kunbus.com>
Replaced specific IO interface classes (`InterfaceInpBool`,
`InterfaceInpInt`, etc.) with generic `InterfaceInput` and
`InterfaceOutput` classes to simplify the hierarchy.
Signed-off-by: Sven Sager <s.sager@kunbus.com>
Updated `GetAllInputs` and `GetAllOutputs` methods in the D-Bus
interface to include explicit argument names (`object-path-list`) and
adjusted their types to `ao` not strings.
Signed-off-by: Sven Sager <s.sager@kunbus.com>
Added a new `docs/dbus.md` file with an overview of standardized D-Bus
data types and their signatures. Updated `README.md` with a reference to
the documentation.
Signed-off-by: Sven Sager <s.sager@kunbus.com>
Added `min_value` and `max_value` properties to integer IOs for
determining value ranges. Updated D-Bus interface with corresponding
properties.
Signed-off-by: Sven Sager <s.sager@kunbus.com>
Added `inp` and `out` properties for accessing input and output paths in
`InterfaceDeviceManager`. Updated D-Bus interface with corresponding
properties.
Signed-off-by: Sven Sager <s.sager@kunbus.com>
The `_get_io_path` method was removed from `InterfaceIoManager` and
replaced with the `get_io_path` utility function from `ios1_helper.py`
to reduce redundancy and improve code reusability.
Signed-off-by: Sven Sager <s.sager@kunbus.com>
Added `address`, `byteorder`, and `length` properties to D-Bus
interfaces for IOs. Implemented corresponding property methods in
`ios1_helper.py`.
Signed-off-by: Sven Sager <s.sager@kunbus.com>
Introduced the `InterfaceDevice` class, enabling detailed device
property access through D-Bus. Updated `bus_provider_io` to include
device interfaces in the D-Bus provider.
Signed-off-by: Sven Sager <s.sager@kunbus.com>
Integrated the InterfaceDeviceManager class into the com.revolutionpi
.ios1 D-Bus bus provider. This addition enables managing device paths
and querying all devices via D-Bus.
Signed-off-by: Sven Sager <s.sager@kunbus.com>
Introduced a new Python-based command-line tool `revpi-config` to manage
Revolution Pi features via D-Bus. The tool supports enabling,
disabling, checking status, and availability for various features.
Signed-off-by: Sven Sager <s.sager@kunbus.com>
Previously, the check only considered 'active' as a valid ActiveState.
This update ensures the system also accounts for units in the
'activating' state, improving compatibility with transitional states in
systemd services.
Signed-off-by: Sven Sager <s.sager@kunbus.com>