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>
Renamed the key 'systemd-timesyncd' to 'ntp' in the services mapping.
This improves naming consistency and aligns it with the expected service
identifier. No functional changes were introduced.
Signed-off-by: Sven Sager <s.sager@kunbus.com>
Added calls to `StatusChanged` in `Disable` and `Enable` methods to
notify when a feature's state is updated. This ensures proper tracking
and external communication of feature status changes.
Signed-off-by: Sven Sager <s.sager@kunbus.com>
This change integrates the InterfaceSoftwareServices class into the list
of interfaces initialized by the bus provider. It ensures the new
interface is properly registered and available for use, improving
system functionality and extensibility.
Signed-off-by: Sven Sager <s.sager@kunbus.com>
Introduce `InterfaceSoftwareServices` to handle service enable/disable
actions, status, and availability via D-Bus. Consolidate `avahi` service
configuration into the new interface by removing redundant logic from
`revpi_config.py`.
Signed-off-by: Sven Sager <s.sager@kunbus.com>
Moved the `simple_systemd` function to a dedicated `systemd_helper`
module to improve code organization and reusability. Updated imports
accordingly in affected files.
Signed-off-by: Sven Sager <s.sager@kunbus.com>
Updated `InterfaceRevpiConfig` to require a bus parameter, ensuring
proper initialization. Introduced a constructor in `DbusInterface` to
store the bus instance.
Signed-off-by: Sven Sager <s.sager@kunbus.com>
This signal provides a mechanism for notifying changes in availability
status. It will complement the existing `StatusChanged` signal and
enhance the system's event-handling capabilities.
Signed-off-by: Sven Sager <s.sager@kunbus.com>
Introduced the `StatusChanged` signal in `.RevpiConfig` interface to
notify changes in feature status. Emitting this signal in `Enable` and
`Disable` methods ensures real-time updates for feature state changes.
This enhances communication and monitoring within the DBus middleware.
Signed-off-by: Sven Sager <s.sager@kunbus.com>