[libgpiod][PATCH 1/2] bindings: cxx: provide request_builder::set_output_values()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Bartosz Golaszewski <bartosz.golaszewski@xxxxxxxxxx>

Implement a new method in the request_builder class that allows to set
output values at request-time by calling the set_output_values() method
of the internal line_config object.

Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@xxxxxxxxxx>
---
 bindings/cxx/gpiodcxx/request-builder.hpp | 8 ++++++++
 bindings/cxx/request-builder.cpp          | 8 ++++++++
 2 files changed, 16 insertions(+)

diff --git a/bindings/cxx/gpiodcxx/request-builder.hpp b/bindings/cxx/gpiodcxx/request-builder.hpp
index 3216216..90cc8f0 100644
--- a/bindings/cxx/gpiodcxx/request-builder.hpp
+++ b/bindings/cxx/gpiodcxx/request-builder.hpp
@@ -114,6 +114,14 @@ public:
 	 */
 	request_builder& add_line_settings(const line::offsets& offsets, const line_settings& settings);
 
+	/**
+	 * @brief Set output values for a number of lines in the line config
+	 *        stored by this object.
+	 * @param values Buffer containing the output values.
+	 * @return Reference to self.
+	 */
+	request_builder& set_output_values(const line::values& values);
+
 	/**
 	 * @brief Make the line request.
 	 * @return New line_request object.
diff --git a/bindings/cxx/request-builder.cpp b/bindings/cxx/request-builder.cpp
index 6a1a487..d11e47b 100644
--- a/bindings/cxx/request-builder.cpp
+++ b/bindings/cxx/request-builder.cpp
@@ -106,6 +106,14 @@ request_builder::add_line_settings(const line::offsets& offsets, const line_sett
 	return *this;
 }
 
+GPIOD_CXX_API request_builder&
+request_builder::set_output_values(const line::values& values)
+{
+	this->_m_priv->line_cfg.set_output_values(values);
+
+	return *this;
+}
+
 GPIOD_CXX_API line_request request_builder::do_request()
 {
 	line_request_ptr request(::gpiod_chip_request_lines(
-- 
2.39.2




[Index of Archives]     [Linux SPI]     [Linux Kernel]     [Linux ARM (vger)]     [Linux ARM MSM]     [Linux Omap]     [Linux Arm]     [Linux Tegra]     [Fedora ARM]     [Linux for Samsung SOC]     [eCos]     [Linux Fastboot]     [Gcc Help]     [Git]     [DCCP]     [IETF Announce]     [Security]     [Linux MIPS]     [Yosemite Campsites]

  Powered by Linux