Commit Graph

352 Commits

Author SHA1 Message Date
Jan Beich
189fd23744 fix(tests): fix ETIMEDOUT message on FreeBSD (#365)
[ RUN      ] SdbusTestObject/0.ThrowsTimeoutErrorWhenMethodTimesOut
tests/integrationtests/DBusMethodsTests.cpp:181: Failure
Value of: e.getMessage()
Expected: (is equal to "Connection timed out") or (is equal to "Method call timed out")
  Actual: "Operation timed out"

[  FAILED  ] SdbusTestObject/0.ThrowsTimeoutErrorWhenMethodTimesOut, where TypeParam = sdbus::test::SdBusCppLoop (3 ms)
2023-10-04 15:48:51 +02:00
Maksim Fedyarov
cfb71bd6cf feat: add support for direct connections (#350)
* feat: add support for direct connections

* refactor: simplify a bit, change comments, extend tests

* fix: compiler warning about unused variable

* docs: add section on direct connections to the tutorial

---------

Co-authored-by: Maksim Fedyarov <m.fedyarov@omp.ru>
Co-authored-by: Stanislav Angelovič <stanislav.angelovic@protonmail.com>
2023-09-25 20:12:34 +02:00
Stanislav Angelovič
c437b4d508 fix: honor CMAKE_POSITION_INDEPENDENT_CODE when building (#361) 2023-09-25 08:53:24 +02:00
Jan Beich
1e2d13a04a feat: add FreeBSD support (#358)
* chore: don't use systemd headers with elogind

In file included from src/VTableUtils.c:27:
src/VTableUtils.h:30:10: fatal error: 'systemd/sd-bus.h' file not found
 #include <systemd/sd-bus.h>
          ^~~~~~~~~~~~~~~~~~

* chore: add basu support

Similar to elogind but also supported on non-Linux.

* chore(tests): permit /var/lib/machine-id on non-systemd

https://github.com/elogind/elogind/commit/84fdc0fc61c1
https://git.sr.ht/~emersion/basu/commit/8324e6729231

* chore(ci): add simple freebsd job

Mainly to cover libc++ and basu.

* chore(ci): explicitly pass CMAKE_INSTALL_PREFIX

Some sdbus-cpp tests require configuring system bus. However, Linux
testing relies on writing outside of prefix in order to affect current
system bus instance instead of launching a dedicated one.

* chore(tests): respect CMAKE_INSTALL_PREFIX for system bus config

DBus isn't part of base system on BSDs, so may not use /etc for configs.
Also, testing installation failed as non-root:

$ cmake -DBUILD_TESTS=1 -DCMAKE_INSTALL_PREFIX=/tmp/sdbus-cpp_prefix -DTESTS_INSTALL_PATH=/tmp/sdbus-cpp_prefix/tests
$ cmake --build .
$ cmake --install .
[...]
CMake Error at tests/cmake_install.cmake:105 (file):
  file cannot create directory: /etc/dbus-1/system.d.  Maybe need
  administrative privileges.

* chore(tests): temporarily skip 1 test on FreeBSD to keep CI happy

* chore(ci): run tests in freebsd job
2023-09-18 11:35:23 +02:00
Stanislav Angelovič
290078d6af feat: add support for async property get/set on client-side (#354)
* feat: add async property get/set convenience support classes

* feat: add no-reply and async overloads to Properties_proxy

* feat: add convenience functions for GetAll functionality

* test: add tests for new functionality

* add codegen IDL support and documentation
2023-09-14 10:54:57 +02:00
Stanislav Angelovič
0eda855745 chore: version 1.3.0 v1.3.0 2023-08-20 11:45:44 +02:00
Stanislav Angelovič
2a992ca84d fix: remove explicit from Variant ctor to avoid potential breaking client code 2023-08-20 11:17:10 +02:00
Stanislav Angelovič
3717e63c64 feat: support std::future-based async methods in codegen tool (#353) 2023-08-19 20:57:32 +02:00
Apteryks
8113bf88ad chore(cmake): add support for libelogind (#352)
* CMakeLists.txt: Fallback to elogind when libsystemd could not be
found.  Set LIBSYSTEMD variable.
* pkgconfig/sdbus-c++.pc.in (Description): Parameterize with above
LIBSYSTEMD variable.

Co-authored-by: Sven Eden <sven.eden@prydeworx.com>
2023-08-18 12:08:37 +02:00
Stanislav Angelovič
3e84b254e9 refactor: improve type extensibility and its safety (#348) 2023-08-09 12:39:16 +02:00
Stanislav Angelovič
8728653359 test: add tests for type extensibility (#347) 2023-08-09 12:14:33 +02:00
Stanislav Angelovič
6620a447d1 docs: add tutorial on extending sdbus-c++ types (#346) 2023-08-09 12:13:47 +02:00
Stanislav Angelovič
24a3d83c3f chore: fix file permissions 2023-08-04 13:30:34 +02:00
Marcel Hellwig
dcd9d46b9c style: remove trailing whitespace (#345)
* style: restore correct 644 file permission

* style: remove trailing whitespace
2023-08-04 13:26:45 +02:00
Stanislav Angelovič
605fbe48c0 fix: moving instead of copying std::string argument 2023-08-03 14:25:33 +02:00
Stanislav Angelovič
fb61420bf0 feat: support serialization of array, span and unordered_map (#342)
* feat: support serialization of array, span and unordered_map

* fix some spelling mistakes

* docs: update table of valid c++ types

---------

Co-authored-by: Marcel Hellwig <github@cookiesoft.de>
2023-08-03 13:55:37 +02:00
Stanislav Angelovič
0a2bda9c67 feat: make Struct tuple-like class (#343) 2023-08-03 13:00:01 +02:00
Christian Schneider
f6e597a583 fix: add cast to void to silence compiler warning in case of empty parameter list 2023-08-03 12:59:48 +02:00
pliniofpa
29c877a89a perf: optimize serialization of arrays of trivial D-Bus types (#340)
* Improve performance of std::vector<> per Issue #339.

* refactor: improve performance of vector serialization

---------

Co-authored-by: Plinio Andrade <plinio.andrade@oracle.com>
Co-authored-by: Stanislav Angelovič <stanislav.angelovic@protonmail.com>
2023-07-27 18:31:49 +02:00
Stanislav Angelovič
98f4929337 fix: pseudo-connection static lifetime issue 2023-07-26 08:57:21 +02:00
Stanislav Angelovič
8d0d9b0d40 chore(ci): remove ubuntu-18.04 container image 2023-07-26 08:46:00 +02:00
Anthony Brandon
c39bc637b8 fix: race condition in async Proxy::callMethod
Signed-off-by: Anthony Brandon <anthony@amarulasolutions.com>
2023-02-07 22:23:35 +01:00
Stanislav Angelovič
737f04abc7 feat: add support for std::future-based async calls 2023-02-07 12:31:31 +01:00
Stanislav Angelovic
3a56113422 fix: fix namespace name in ScopeGuard 2023-01-21 01:34:34 +01:00
Stanislav Angelovič
f332f46087 fix: use correct runtime component in CMake file 2023-01-17 09:58:21 +01:00
Stanislav Angelovic
c9e157e3e1 fix: flush long messages after sending 2023-01-05 15:12:39 +01:00
Stanislav Angelovič
8ca3fdd5ce chore: update issue templates 2023-01-04 22:05:56 +01:00
Stanislav Angelovic
55c306ce05 docs: strip absolute paths from doxygen documentation 2023-01-04 21:51:28 +01:00
Stanislav Angelovic
6c5e72326c refactor(ci): use newer github actions and ubuntu v22 image 2023-01-04 21:51:13 +01:00
Stanislav Angelovic
8bbeeeb4ce fix: integration tests in release mode 2023-01-03 16:39:54 +01:00
Stanislav Angelovic
7a09e9bcc8 chore: install namelink to dev component 2023-01-03 15:24:17 +01:00
Stanislav Angelovic
c812d03bc7 fix: integration tests for libsystemd v251 2023-01-03 15:20:30 +01:00
Bhavith C
e7d4e07926 fix: broken D-Bus specs link in README (#297)
- D-Bus specification broken url link is corrected

Signed-off-by: Bhavith C <bhavithc.acharya@gmail.com>

Signed-off-by: Bhavith C <bhavithc.acharya@gmail.com>
2023-01-02 15:31:08 +01:00
Stanislav Angelovic
031f4687ca fix: compilation warnings 2022-09-21 15:37:57 +02:00
Stanislav Angelovic
aeae79003a refactor: support move semantics in generated adaptor and proxy classes 2022-09-20 17:05:59 +02:00
Stanislav Angelovic
74d849d933 feat: add support for proxy with no event loop thread 2022-09-05 17:25:37 +02:00
b-s-e
f336811fc7 docs: add section on D-Bus types to C++ types mapping (#285)
* Added D-Bus type C++ type table

* docs: do corrections and rewordings in the proposed chapter

Co-authored-by: Stanislav Angelovič <stanislav.angelovic@protonmail.com>
2022-09-05 13:51:05 +02:00
James Le Cuirot
35bffd0f25 build: don't include libsystemd as shared pkg-config dep when statically linked (#283)
This works whether `BUILD_LIBSYSTEMD` is `ON` or the separate build of
libsystemd picked up by pkg-config is static. The Gentoo Linux package
requires the latter.

This change also handles `BUILD_SHARED_LIBS` being `OFF`. In this case,
the libsystemd dependency does need to be included, even though it is
static.

CMake does not allow you to build shared and static libraries
simultaneously (with a single `add_library` call), but this change
declares the libsystemd dependency as `Requires.private` rather than
omitting it entirely. This is in case someone builds and installs both a
static and shared build and then calls `pkg-config --static sdbus-c++`.
The static build needs to be installed first so that the pkg-config
file from the shared build takes precedence.
2022-09-03 22:54:06 +02:00
b-s-e
e33a890ce7 docs: fix send_destination property (#284) 2022-08-26 16:49:51 +02:00
Stanislav Angelovic
751c1addc4 chore: version 1.2.0 v1.2.0 2022-08-09 09:50:33 +02:00
Stanislav Angelovic
2991fa4960 refactor: use pseudo D-Bus connection for plain messages 2022-08-09 08:55:29 +02:00
alivenets
0f2362d8c3 feat: add support for session bus connection at custom address (#273)
* Add methods to initiate custom session bus connection

The new function helper `createSessionBusConnectionWithAddress` allows to create connection to session bus with custom address.

Signed-off-by: Alexander Livenets <a.livenets@gmail.com>

* feat: add support for session bus connection at custom address

Co-authored-by: Stanislav Angelovic <stanislav.angelovic@siemens.com>
2022-08-08 13:54:09 +02:00
Stanislav Angelovic
e07c1f3981 chore: update doxygen header info 2022-07-05 18:10:05 +02:00
Stanislav Angelovic
58426966f4 feat: add CMake variable for extra libsystemd config options 2022-06-27 15:01:06 +02:00
Stanislav Angelovic
4e105081c9 fix: remove executable flag from source files 2022-06-27 12:17:18 +02:00
Stanislav Angelovic
5ec6027d5f feat: add support for match rules 2022-06-27 12:14:57 +02:00
Stanislav Angelovic
d864e1dfa4 refactor: rename dont_request_slot tag to floating_slot 2022-06-27 12:05:06 +02:00
Stanislav Angelovic
b7f3d7c876 refactor: little fixes and reorganizations around Connection class 2022-06-22 18:12:42 +02:00
Stanislav Angelovic
2a4c241303 docs: add more info on D-Bus security policy file 2022-06-22 18:12:13 +02:00
Michael Binz
5e933c3f17 Detects missing type after array declaration. Fixes #253. (#255)
Co-authored-by: Michael Binz <michael.binz@daimler.com>
2022-06-19 23:02:54 +02:00