1
0
mirror of https://git.kernel.org/pub/scm/libs/libgpiod/libgpiod.git synced 2026-10-28 13:55:08 +03:00

1390 Commits

Author SHA1 Message Date
Bartosz Golaszewski
e2539f3911 libgpiod v2.2.1
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
v2.2.1
2025-02-19 12:57:47 +01:00
Bartosz Golaszewski
c5b067c976 NEWS: updates for v2.2.1
Add release notes for libgpiod v2.2.1.

Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
2025-02-19 12:57:47 +01:00
Bartosz Golaszewski
db80089658 doc: add missing .rst files to EXTRA_DIST
Several .rst files are not bundled in distro tarballs. Add them to
EXTRA_DIST.

Fixes: dda57bd63f ("doc: move README contents to sphinx docs")
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
2025-02-19 12:57:47 +01:00
Bartosz Golaszewski
f1f38dc9ee doc: move README contents to sphinx docs
We now have comprehensive documentation available online on readthedocs.
Let's not duplicate docs in README - move all information into the
sphinx files.

While at it: make the remaining README use markdown.

Reviewed-by: Vincent Fazio <vfazio@xes-inc.com>
Link: https://lore.kernel.org/r/20250211-improve-docs-v4-17-dc56702c2ca8@linaro.org
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
2025-02-17 09:44:45 +01:00
Bartosz Golaszewski
faaca07ea6 doc: add documentation for D-Bus API, daemon and command-line client
Use the man pages for gpio-manager and gpiocli + some manual labor to
provide sphinx docs for the libgpiod D-Bus API.

Reviewed-by: Vincent Fazio <vfazio@xes-inc.com>
Link: https://lore.kernel.org/r/20250211-improve-docs-v4-16-dc56702c2ca8@linaro.org
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
2025-02-17 09:44:45 +01:00
Bartosz Golaszewski
e4a46ae560 doc: add documentation for gpio-tools
We already generate man pages for gpio-tools. Let's use man2html to make
them part of the sphinx docs.

Reviewed-by: Vincent Fazio <vfazio@xes-inc.com>
Link: https://lore.kernel.org/r/20250211-improve-docs-v4-15-dc56702c2ca8@linaro.org
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
2025-02-17 09:44:45 +01:00
Bartosz Golaszewski
125ad2154f doc: add documentation for GLib bindings
The GObject docs are generated with gi-docgen and there doesn't seem to
be an easy way of converting them to sphinx. Let's put the GLib docs
statically into the sphinx output and reference them from the bindings
chapter.

Reviewed-by: Vincent Fazio <vfazio@xes-inc.com>
Link: https://lore.kernel.org/r/20250211-improve-docs-v4-14-dc56702c2ca8@linaro.org
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
2025-02-17 09:44:45 +01:00
Bartosz Golaszewski
bdf71296bc doc: add documentation for python bindings
Integrate python docs with sphinx using autodoc and the import mock
feature which allows us to avoid having to build the C extension.

Reviewed-by: Vincent Fazio <vfazio@xes-inc.com>
Link: https://lore.kernel.org/r/20250211-improve-docs-v4-13-dc56702c2ca8@linaro.org
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
2025-02-17 09:44:45 +01:00
Bartosz Golaszewski
ae15d8ff91 doc: provide sphinx docs for the core C API and C++ bindings
Current sphinx/ contents are mostly WiP. Let's beat them into shape for
publishing on ReadTheDocs.

Integrate the API documentation generated with doxygen for the core C
API and C++ bindings into sphinx using breathe.

Update configure.ac to check for sphinx-build in addition to doxygen and
make the main Makefile trigger a sphinx build on `make doc` (although
the docs can also be generated without starting the build system by
running: `sphinx-build ./docs/ docs/sphinx-output`).

Move the introduction text from the main header into the relevant .rst
file.

Remove obsolete Doxyfile.in and create a static Doxygen under doc/ where
all the documentation now lives.

Update .gitignore where needed.

Reviewed-by: Vincent Fazio <vfazio@xes-inc.com>
Link: https://lore.kernel.org/r/20250211-improve-docs-v4-12-dc56702c2ca8@linaro.org
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
2025-02-17 09:44:45 +01:00
Bartosz Golaszewski
bf745e9c6f doc: create man entries for gpio-manager and gpiocli
Extend the build files under man/ to also generate man pages for
gpio-manager, gpiocli and each of the former's sub-commands.

Reviewed-by: Vincent Fazio <vfazio@xes-inc.com>
Link: https://lore.kernel.org/r/20250211-improve-docs-v4-11-dc56702c2ca8@linaro.org
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
2025-02-17 09:44:45 +01:00
Bartosz Golaszewski
3588a230cd dbus: improve comments in API xml
The current comments don't follow any particular formatting so the
resulting .rst generated with gdbus-codegen is all mangled up. Use
proper .rst formatting to make docs better.

Reviewed-by: Vincent Fazio <vfazio@xes-inc.com>
Link: https://lore.kernel.org/r/20250211-improve-docs-v4-10-dc56702c2ca8@linaro.org
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
2025-02-17 09:44:45 +01:00
Bartosz Golaszewski
e15e38f52b dbus: client: tweak help text
help2man struggles to generate correct output with current help-text for
the sub-commands section. It doesn't break the lines correctly and the
resulting .rst generated with pandoc looks just as bad. Tweak the output
a bit to generate better man pages with correctly broken lines.

Reviewed-by: Vincent Fazio <vfazio@xes-inc.com>
Link: https://lore.kernel.org/r/20250211-improve-docs-v4-9-dc56702c2ca8@linaro.org
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
2025-02-17 09:44:45 +01:00
Bartosz Golaszewski
708ece3d37 dbus: daemon: add a more detailed description to help text
In preparation for adding man pages for the daemon and the command-line
client, add a detailed description of what gpio-manager is and does to
the output presented to user when they pass --help as argument.

Reviewed-by: Vincent Fazio <vfazio@xes-inc.com>
Link: https://lore.kernel.org/r/20250211-improve-docs-v4-8-dc56702c2ca8@linaro.org
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
2025-02-17 09:44:45 +01:00
Bartosz Golaszewski
55b31b0f8a bindings: glib: add the configuration file for gi-docgen
Without the gi-docgen configuration file, the GObject docs don't
contain information such as library version, author, license, etc. Add a
simple .toml to add missing bits and update the command in Makefile.

Reviewed-by: Vincent Fazio <vfazio@xes-inc.com>
Link: https://lore.kernel.org/r/20250211-improve-docs-v4-7-dc56702c2ca8@linaro.org
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
2025-02-17 09:44:45 +01:00
Bartosz Golaszewski
bc3c29db9b bindings: gpiod: reword the docstring for LineRequest.__init__()
Change the docstring for LineRequest.__init__() so that when it appears
in sphinx docs as part of the class description, it won't sound as if
the class was not to be used at all.

Reviewed-by: Vincent Fazio <vfazio@xes-inc.com>
Link: https://lore.kernel.org/r/20250211-improve-docs-v4-6-dc56702c2ca8@linaro.org
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
2025-02-17 09:44:45 +01:00
Bartosz Golaszewski
a8ff6ed5e2 bindings: python: doc: describe undocumented members
There are several public members in python bindings that are missing
docstrings. Document them for completeness.

Reviewed-by: Vincent Fazio <vfazio@xes-inc.com>
Link: https://lore.kernel.org/r/20250211-improve-docs-v4-5-dc56702c2ca8@linaro.org
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
2025-02-17 09:44:45 +01:00
Bartosz Golaszewski
7bf48ef94e bindings: python: doc: make code examples appear as such in sphinx
In order for code examples inside docstrings to be interpreted as such
by sphinx, we need to use a double colon ("Example::").

Reviewed-by: Vincent Fazio <vfazio@xes-inc.com>
Link: https://lore.kernel.org/r/20250211-improve-docs-v4-4-dc56702c2ca8@linaro.org
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
2025-02-17 09:44:45 +01:00
Bartosz Golaszewski
6f0060a569 bindings: python: doc: update the docstring for gpiod.request_lines()
The global request_lines() function was updated to take explicitly typed
arguments instead of just passing *args and **kwargs down to
Chip.request_lines(). However, the doc remained unchanged. Update it now
to reflect the actual function parameters.

Reviewed-by: Vincent Fazio <vfazio@xes-inc.com>
Link: https://lore.kernel.org/r/20250211-improve-docs-v4-3-dc56702c2ca8@linaro.org
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
2025-02-17 09:44:45 +01:00
Bartosz Golaszewski
0b0099a3d9 bindings: cxx: doc: remove the gpiod_cxx doxygen group
Groups make sense for the C API as they allow us to nicely order
interfaces manipulating a given structure thematically but for C++ they
make less sense as methods are already typically part of a class.
Additionally for global functions, they seem to make it difficult for
breathe to look up the correct symbols.

Remove the gpiod_cxx group from Doxygen comments.

Reviewed-by: Vincent Fazio <vfazio@xes-inc.com>
Link: https://lore.kernel.org/r/20250211-improve-docs-v4-2-dc56702c2ca8@linaro.org
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
2025-02-17 09:44:45 +01:00
Bartosz Golaszewski
86caa62e78 build: set PACKAGE_URL
We don't set the package URL in AC_INIT() so the URL section in
pkgconfig files is empty. Set it to the address of the main git repo.

Reviewed-by: Vincent Fazio <vfazio@xes-inc.com>
Link: https://lore.kernel.org/r/20250211-improve-docs-v4-1-dc56702c2ca8@linaro.org
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
2025-02-17 09:44:45 +01:00
Bartosz Golaszewski
b4e9950849 bindings: python: add missing LineInfo import to __init__.py
We're not importing the LineInfo symbol in __init__.py which breaks the
sphinx docs build. This has been fixed in master by a big rework in
python bindings but we need to fix it locally too if we want to build the
docs for the existing stable branch.

Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
2025-02-17 09:44:45 +01:00
Bartosz Golaszewski
c129903057 gpiosim: defer removal of bank entries when device is not disabled
Linux kernel commit 8bd76b3d3f3a ("gpio: sim: lock up configfs that an
instantiated device depends on") has uncovered an issue in libgpiosim:
we use reference counting for all objects (to make RAII easier for
bindings) but, with the above change, if the user doesn't explicitly
disable the device before dropping the last reference to a bank object,
the parent device will never get correctly cleaned up.

This is because we remove the hog and line directories in bank's
release() callback unconditionally. With the directories being locked
now, this fails if device is active and then when we eventually call the
device object's release(), we'll end up stuck with leftover bank
directories and never actually clean-up correctly.

Extend the gpiosim device with a list of deferred banks. When releasing
a bank on an active device, defer any actual cleanup until the time the
device gets deactivated which may be triggered by the user explictly or
will happen automatically when the last reference to the device object is
dropped. For inactive devices, there's no functional change.

Link: https://lore.kernel.org/r/20250214102648.71382-1-brgl@bgdev.pl
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
2025-02-17 09:34:33 +01:00
Bartosz Golaszewski
3798bc2e6e bindings: glib: tests: make waiting for info events more reliable
One GMainContext iteration may not be enough for the info event to be
emitted by the kernel after the triggering event. Let's wait a bit
longer. This fixes sporadic failures in the affected test cases
depending on the system load.

Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
2025-02-05 14:34:24 +01:00
Erik Schilling
61cb72bd2f bindings: rust: libgpiod: make read_edge_events lifetimes more explicit
Newer rustc versions warn on elided named lifetimes. In thise case, it
actually revealed a misleading function signature.

The function defined &self with 'a. But there is no dependency on the
Request reference that extends longer than this function call. Yet,
the code expresses such a dependency and abuses it to force the buffer
argument to match &self lifetime (and thus the return lifetime too!).

Instead we want to explicitly break up the tie to the &self and tie it
to the buffer instead.

The 'a on &self caused a 'a on the return. With that being removed we
would get an automatic '0. So we are now forced to add the 'a on the
return that also fixes the compiler warning.

Reported-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
Co-authored-by: Kent Gibson <warthog618@gmail.com>
Link: https://lore.kernel.org/r/CAMRc=Me-QNmJ2L1K-gGzFtVZacsDiLsNUfh3QaWPdbVzyxUduA@mail.gmail.com/
Signed-off-by: Erik Schilling <erik.schilling@linaro.org>
Link: https://lore.kernel.org/r/20250103-lifetime-fix-v2-1-63902dc8cae1@linaro.org
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
2025-02-05 11:09:26 +01:00
Bartosz Golaszewski
9cc9b24d19 dbus: client: tests: fix the way we wait for simulated chips to appear
The org.freedesktop.DBus.Peer.Ping() method isn't correct for checking
if a given object is exposed by a service. It only lets us know if the
service is available no matter the object on which it's called (in fact:
it will not return an error even if it's called on a nonexistent object).

While this has worked for most part by accident, if the timing isn't
right, we may start calling methods in chips which are not yet fully
registered. We should try to read the chip's property instead and keep
on waiting for as long as org.freedesktop.DBus.Properties.Get() returns
an error.

While at it: fix the counter increment as its syntax is invalid.

Fixes: a5ab76da1e ("dbus: add the D-Bus daemon, command-line client and tests")
Link: https://lore.kernel.org/r/20250203-fix-dbus-wait-for-chip-v1-1-563f7132c04f@linaro.org
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
2025-02-05 11:02:25 +01:00
Bartosz Golaszewski
e35c96b732 bindings: rust: tests: disable device before dropping the resources
Linux kernel commit 8bd76b3d3f3a ("gpio: sim: lock up configfs that an
instantiated device depends on") uncovered an issue in Rust bindings
tests where the GPIO simulator device is not disabled before removing its
configfs entries. Implenent Drop for the Sim struct in order to disable
the simulator first before dropping its bank and device objects.

Acked-by: Viresh Kumar <viresh.kumar@linaro.org>
Link: https://lore.kernel.org/r/20250203-fix-gpiosim-in-bindings-v1-3-d2c9e0f3a29d@linaro.org
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
2025-02-05 11:02:25 +01:00
Bartosz Golaszewski
5bedd8ccf3 bindings: python: tests: disable device before releasing the bank
Linux kernel commit 8bd76b3d3f3a ("gpio: sim: lock up configfs that an
instantiated device depends on") uncovered an issue in Python bindings
tests where the GPIO simulator device is not disabled before removing its
configfs entries. Reorder the operations in chip_finalize() in order to
disable the device first (if needed) before releasing any other
resources.

Link: https://lore.kernel.org/r/20250203-fix-gpiosim-in-bindings-v1-2-d2c9e0f3a29d@linaro.org
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
2025-02-05 11:02:25 +01:00
Bartosz Golaszewski
05717740e5 bindings: cxx: tests: disable GPIO simulator before releasing it
Linux kernel commit 8bd76b3d3f3a ("gpio: sim: lock up configfs that an
instantiated device depends on") uncovered an issue in C++ bindings
tests where the GPIO simulator device is not disabled before removing its
configfs entries. Add a call to gpiosim_dev_disable() to the
gpiosim::chip's destructor.

Link: https://lore.kernel.org/r/20250203-fix-gpiosim-in-bindings-v1-1-d2c9e0f3a29d@linaro.org
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
2025-02-05 11:02:25 +01:00
George Harker
89f15944ff bindings: python: fix potential PyDict_Next() crash
PyDict_Next() does not guarantee pos is contiguous, and pypy increments
it past the end of the dict size. Fix reliance on pos for constructing
args for libgpiod call.

Fixes: b7ba732e6a ("treewide: libgpiod v2 implementation")
Signed-off-by: George Harker <george@george-graphics.co.uk>
Link: https://lore.kernel.org/r/20241202171302.51437-1-george@george-graphics.co.uk
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
2024-12-02 20:49:29 +01:00
Bartosz Golaszewski
daed8f8a49 libgpiod v2.2
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
v2.2
2024-10-22 10:57:17 +02:00
Bartosz Golaszewski
9c8d94eb59 bindings: glib: tests: fix version regex
Bring the version matching regex pattern in line with the others in the
tree so that it can also match a string without -rcX or -devel suffix.

Fixes: e090088c21 ("bindings: add GLib bindings")
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
2024-10-22 10:56:02 +02:00
Bartosz Golaszewski
91b7811955 dbus: data: fix SPDX license identifier in D-Bus config file
Remove the .txt file extension from the license identifier as it got
there by mistake and makes `reuse lint` complain.

Fixes: a5ab76da1e ("dbus: add the D-Bus daemon, command-line client and tests")
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
2024-10-15 20:37:13 +02:00
Bartosz Golaszewski
74a37ba440 libgpiod v2.2-rc3
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
v2.2-rc3
2024-10-15 15:58:46 +02:00
Vincent Fazio
035ad74fdd bindings: python: import gpiod attributes in external module
Previously, the external module relied on gpiod attributes being present
within `globals()` to construct return values back to the caller.

This assumption required callers of the external module to have imported
the attributes to populate `globals()` for the interface to work.

Having this implicit contract is opaque and prone to causing issues if
imports within gpiod modules ever get reworked.

Now, the external module explicitly imports attributes from gpiod in
order to return values back to the caller.

There should be no concern about circular imports as the external module
should be completely imported by the time callers call into it.

Since Py_gpiod_GetGlobalType is no longer used, it has been replaced
with Py_gpiod_GetModuleAttrString which returns a new PyObject*
reference for the named module and attribute that must be decremented
when no longer in use.

Closes: https://github.com/brgl/libgpiod/issues/101
Signed-off-by: Vincent Fazio <vfazio@xes-inc.com>
Link: https://lore.kernel.org/r/20241008175139.1198980-1-vfazio@xes-inc.com
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
2024-10-14 16:42:38 +02:00
Bartosz Golaszewski
cfbaa54427 dbus: display D-Bus API versions implemented by the manager and gpiocli
When passing -v/--version to gpiocli or gpio-manager, it's useful to
also know the version of the GPIO D-Bus API the program implements.
Define the version in the gpiodbus.h header and print it together with
the library version.

Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
2024-10-14 15:13:28 +02:00
Bartosz Golaszewski
392cae9e42 dbus: client: monitor: free the line list at exit
Free the list of line proxies stored for the duration of the program at
exit to fix a memory leak.

Note: these objects need to be kept alive for D-Bus events to work.

Fixes: a5ab76da1e ("dbus: add the D-Bus daemon, command-line client and tests")
Link: https://lore.kernel.org/r/20241007-dbus-memory-fixes-v1-3-0d56d1aa032d@linaro.org
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
2024-10-09 09:33:36 +02:00
Bartosz Golaszewski
85471d394b dbus: client: notify: free chip and line lists at exit
We don't free the lists storing line and chip objects for the duration
of the program when exiting. Fix it.

Note: these objects need to be kept alive for D-Bus events to work.

Fixes: a5ab76da1e ("dbus: add the D-Bus daemon, command-line client and tests")
Link: https://lore.kernel.org/r/20241007-dbus-memory-fixes-v1-2-0d56d1aa032d@linaro.org
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
2024-10-09 09:33:36 +02:00
Bartosz Golaszewski
c87847b23b dbus: client: notify: fix reference counting
There's a reference overflow when adding chips to the global list and an
underflow when fetching existing chips from that list in connect_line().
Fix both issues.

Fixes: a5ab76da1e ("dbus: add the D-Bus daemon, command-line client and tests")
Link: https://lore.kernel.org/r/20241007-dbus-memory-fixes-v1-1-0d56d1aa032d@linaro.org
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
2024-10-09 09:33:36 +02:00
Bartosz Golaszewski
0e4198b9ee build: add an additional check for glib-mkenums
Some distros split glib-mkenums and other GLib build utilities into a
separate package but the glib-2.0 pkgconfig file pointing to it is
typically shipped as part of the -dev package. This can lead to a
situation where configure thinks it knows where glib-mkenums is but make
then fails because it's not really installed on the system. Check the
existence of the actual executable in addition to querying pkgconfig.

Link: https://lore.kernel.org/r/20241004092533.34368-1-brgl@bgdev.pl
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
2024-10-07 10:06:52 +02:00
Bartosz Golaszewski
ed7ffe8362 build: drop obsolete autoconf macro
AC_HEADER_STDC is deprecated and should be replaced with
AC_CHECK_INCLUDES_DEFAULT. We haven't done this until now because the
latter is only available since autoconf v2.71. We kept supporting v2.69
for the sake of Debian stable but it has since upgraded to autoconf v2.71
so we update configure.ac as well and fix an autoconf warning.

Link: https://lore.kernel.org/r/20241003135806.41934-1-brgl@bgdev.pl
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
2024-10-07 10:06:27 +02:00
Kent Gibson
07c5c49862 tools: line wrap period help
The help for periods is overly long so wrap it to make it more
consistent with other help lines.

Signed-off-by: Kent Gibson <warthog618@gmail.com>
Link: https://lore.kernel.org/r/20241003020743.27194-1-warthog618@gmail.com
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
2024-10-03 10:50:15 +02:00
Bartosz Golaszewski
901302b18d libgpiod v2.2-rc2
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
v2.2-rc2
2024-10-02 17:44:34 +02:00
Bartosz Golaszewski
4722e901ed dbus: include data and test files in dist tarballs
Several data and test files were not included in distro tarballs so add
"dist_" automake variable prefixes where required.

Fixes: a5ab76da1e ("dbus: add the D-Bus daemon, command-line client and tests")
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
2024-10-02 17:40:47 +02:00
Bartosz Golaszewski
3fce3c0624 bindings: python: add misc build files to EXTRA_DIST
Several files are not being included in distro tarballs so the
functionality of the python build is limited compared to the repo. Add
them to EXTRA_DIST.

Fixes: d588a6a592 ("bindings: python: standalone build tooling for tests")
Fixes: 72d2fa01a2 ("bindings: python: add script to generate sdist and wheels")
Fixes: 85089d0e40 ("bindings: python: add pyproject.toml, pep 518")
Fixes: 389a966d4e ("bindings: python: move long_description into README.md")
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
2024-10-02 16:58:28 +02:00
Bartosz Golaszewski
c2a03cd0e7 libgpiod v2.2-rc1
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
v2.2-rc1
2024-10-02 12:01:13 +02:00
Bartosz Golaszewski
35d9c48693 NEWS: updates for v2.2
Add release notes for libgpiod v2.2.

Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
2024-10-02 12:00:21 +02:00
Bartosz Golaszewski
6dfca9a39a dbus: client: fix format specifiers for 64-bit types
Use G_GUINT64_FORMAT whenever printing 64-bit types to avoid format
specifier warnings.

Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
2024-10-01 20:07:48 +02:00
Bartosz Golaszewski
2df6347c08 dbus: use correct types for edge events
On 32-bit architectures the size of a gulong will typically be 4 bytes
while we try to package an 8-byte integer when creating the edge event
variant. The client also expects wrong types and crashes. Use strict
type sizes for sending the events.

Closes: https://github.com/brgl/libgpiod/issues/103
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
2024-10-01 20:07:47 +02:00
Bartosz Golaszewski
f6c8c3321d bindings: python: improve LineSettings.__repr__()
Currently, for the output of LineSettings.__repr__() to be eval()able,
the user must have pulled all the relevant definitions from gpiod.line
within the scope where it is used. Modify the output so that all the user
needs is `import gpiod`.

Reported-by: Vincent Fazio <vfazio@gmail.com>
Link: https://lore.kernel.org/r/20240920143203.6377-1-brgl@bgdev.pl
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
2024-09-27 10:09:37 +02:00
Kent Gibson
5715f61fd2 bindings: python: examples: add graceful exit to async_watch_line_value
The purpose of the example is demonstrate using a request with poll().
It provides a hint as to how the poll can be combined with other fds but,
as Python comes with batteries included, the Python version of the example
can be readily extended to actually demonstrate this, as well as how it
can be used in multi-threaded environments.

Extend the example to use an eventfd to allow the poll() to be run in
a background thread and be gracefully terminated by the main thread.

Signed-off-by: Kent Gibson <warthog618@gmail.com>
Link: https://lore.kernel.org/r/20240917125455.324551-1-warthog618@gmail.com
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
2024-09-20 11:21:24 +02:00