Commit Graph

62 Commits

Author SHA1 Message Date
Stanislav Angelovič
e2b3e98374 refactor: improve handling of exceptions from callback handlers (#375)
* Catch and process all exceptions (not just sdbus::Error) from callback handlers
* Unify handling of exceptions from all types of callbacks -- always set sd_bus_error and return a negative result number in case of exception

Although libsystemd logs (with DEBUG severity) all errors from such callback handlers (except method callback handler), it seems to be out of our control. One of handy sdbus-c++ features could be the ability for clients to install a log callback, which sdbus-c++ would call in case of exceptions flying from callback handlers. In case something doesn't work for clients (especially novices), they can first look into these logs.

This may be handy in common situations like ignored signals on client side because of the inadvertent mismatch between real signal signature and signal handler signature. Like here: #373. (Although in this specific case of signals, there is a solution with an additional const sdbus::Error* argument that would reveal such an error.)
2023-11-03 18:03:01 +01:00
Stanislav Angelovič
9490b3351f feat: add support for async registration of matches (#374) 2023-11-03 17:57:52 +01:00
Stanislav Angelovič
b7b454ba38 doc: add section on bus connection factories 2023-10-16 19:28:27 +02:00
Stanislav Angelovič
f420b216aa docs: update documentation 2023-10-16 15:30:23 +02:00
Stanislav Angelovič
aac7e590ea docs: add recommendation on destroying direct D-Bus connections 2023-10-10 19:15:21 +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č
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č
3717e63c64 feat: support std::future-based async methods in codegen tool (#353) 2023-08-19 20:57:32 +02:00
Stanislav Angelovič
6620a447d1 docs: add tutorial on extending sdbus-c++ types (#346) 2023-08-09 12:13:47 +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č
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č
737f04abc7 feat: add support for std::future-based async calls 2023-02-07 12:31:31 +01:00
Stanislav Angelovic
55c306ce05 docs: strip absolute paths from doxygen documentation 2023-01-04 21:51:28 +01: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
b-s-e
e33a890ce7 docs: fix send_destination property (#284) 2022-08-26 16:49:51 +02:00
Stanislav Angelovic
5ec6027d5f feat: add support for match rules 2022-06-27 12:14:57 +02:00
Stanislav Angelovic
2a4c241303 docs: add more info on D-Bus security policy file 2022-06-22 18:12:13 +02:00
Sergey Bobrenok
b5aee6d019 docs: add information about Buildroot package (#252) 2022-06-07 08:45:34 +02:00
Lukasz Marcul
442670ec18 codegen: Support chrono literal timeout by ProxyGenerator
Allow to use human readable chrono literals to specify method call
timeout. The change is backward compatbile - if no unit is provided,
the fallback is "us".

Example:
<annotation name="org.freedesktop.DBus.Method.Timeout" value="500ms"/>
2021-12-14 16:47:01 +01:00
Marcel Hellwig
b01db13ff7 fix method name in example 2021-12-01 16:18:58 +01:00
Stanislav Angelovič
dc0f487751 Reword a few tutorial statements slightly 2021-11-22 14:27:28 +01:00
Urs Ritzmann
a5ecbbfcec add examples for the ObjectManager API 2021-10-18 11:58:07 +02:00
Rolf Lussi
9cb8b89a01 add cpack to build debian packages, split the packages by components 2021-09-23 20:18:14 +02:00
Stanislav Angelovic
c422de641a Support Error parameter in signal handlers 2021-09-17 19:25:39 +02:00
Stanislav Angelovič
a72e17b932 doc: add gperf dependency for libsystemd 2021-09-17 18:28:41 +02:00
Stanislav Angelovic
6433b38ed1 Add specific sections for tips and notes in the tutorial 2021-07-22 16:01:42 +02:00
Stanislav Angelovic
e16ffb1288 Provide access to D-Bus message in high-level API 2021-06-22 11:31:08 +02:00
Sergey Bobrenok
d74365c535 docs: Add information about conan recipe 2021-06-15 15:27:29 +02:00
craig-spannring
d46cbba23c Add README and sdbus-c++ tutorial as additional pages in doxydocs (#153)
Co-authored-by: Craig Spannring <craig.spannring@milnxpd001.mti.local>
Co-authored-by: Stanislav Angelovič <angelovic.s@gmail.com>
2021-04-29 16:46:36 +02:00
Stanislav Angelovič
5f271abc0c Add note on system bus security policy file to the tutorial 2021-04-29 15:52:06 +02:00
Stanislav Angelovič
bbffcbf49e fix: minor documentation and test improvements (#166)
* fix: minor documentation and test improvements

* doc: add link to tests in standard interfaces tutorial secion

* Update README.md

Co-authored-by: Urs Ritzmann <urs.ritzmann@kistler.com>

* Update docs/using-sdbus-c++.md

Co-authored-by: Urs Ritzmann <urs.ritzmann@kistler.com>

* Use cmake instead of make in build instructions

Co-authored-by: Stanislav Angelovic <stanislav.angelovic@siemens.com>
Co-authored-by: Urs Ritzmann <urs.ritzmann@kistler.com>
2021-04-28 12:05:14 +02:00
Michal Hučko
dc6d55a282 Provide CMake config and PkgConfig files for tools (#172) 2021-04-28 11:15:47 +02:00
Stanislav Angelovič
a9f2043daa Fix examples in the tutorial
Remove sdbus:: namespace in injected-class-name of the template base class in c-tor initialization list
2021-03-10 09:49:25 +01:00
Stanislav Angelovič
96b2dfff69 Update using-sdbus-c++.md
Fix name of class in destructor
2021-03-09 17:04:43 +01:00
Stanislav Angelovič
21820f7529 Update using-sdbus-c++.md 2020-02-02 23:03:24 +01:00
sangelovic
3a4f343fb9 Provide better names to event loop-related IConnection methods 2020-02-02 22:22:26 +01:00
Stanislav Angelovič
db71707be4 Update tutorial for for full use of C++17 2020-02-01 23:03:44 +01:00
Stanislav Angelovič
49586001d6 Try to better explain the design and how to use connections in objects and proxies 2020-02-01 13:38:51 +01:00
Stanislav Angelovič
aa8e9123de Update the tutorial for new method parameter names feature 2020-02-01 12:38:39 +01:00
Stanislav Angelovič
245db893b8 Remove obsolete section on Yocto recipes for sdbus-c++ 2020-01-23 16:58:48 +01:00
Stanislav Angelovič
477c5dd714 Update section on Yocto recipes for sdbus-c++ 2020-01-23 16:57:42 +01:00
sangelovic
f41d9bc395 Fix issue of event loop thread and synchronous method call thread polling on the same D-Bus connection
Synchronous D-Bus method calls are now done in terms of blocking asynchronous calls.
2020-01-19 18:51:19 +01:00
Stanislav Angelovič
8dea11bac6 Add note on solving potential getent-related Yocto errors 2019-07-09 18:29:58 +02:00
Stanislav Angelovič
c264f83e83 Fix Yocto chapter level in the tutorial 2019-06-12 15:03:26 +02:00
Stanislav Angelovič
71adb5cf30 Add notes on sdbus-c++ Yocto recipes to the tutorial 2019-06-12 15:02:01 +02:00
sangelovic
ff944c9e95 Add protected non-virtual destructor in generated classes 2019-06-10 22:54:16 +02:00
Stanislav Angelovič
dcad208ffe Redesign inheritance from Message (#62)
... so that the code is more idiomatic, clear and expressive about its intended use
2019-06-10 21:38:30 +02:00
Stanislav Angelovič
efe799ef3f Update section on standard D-Bus interfaces in the tutorial 2019-06-05 12:34:43 +02:00