From patchwork Mon Jul 1 22:06:10 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Niklas_S=C3=B6derlund?= X-Patchwork-Id: 1574 Return-Path: Received: from bin-mail-out-05.binero.net (bin-mail-out-05.binero.net [195.74.38.228]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id C454660BF8 for ; Tue, 2 Jul 2019 00:06:55 +0200 (CEST) X-Halon-ID: 6f2fb8ef-9c4c-11e9-8ab4-005056917a89 Authorized-sender: niklas@soderlund.pp.se Received: from bismarck.berto.se (unknown [145.14.112.32]) by bin-vsp-out-01.atm.binero.net (Halon) with ESMTPA id 6f2fb8ef-9c4c-11e9-8ab4-005056917a89; Tue, 02 Jul 2019 00:06:32 +0200 (CEST) From: =?utf-8?q?Niklas_S=C3=B6derlund?= To: libcamera-devel@lists.libcamera.org Date: Tue, 2 Jul 2019 00:06:10 +0200 Message-Id: <20190701220612.6342-1-niklas.soderlund@ragnatech.se> X-Mailer: git-send-email 2.21.0 MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH v3 0/2] libcamera: ipc: unix: Add a IPC mechanism based on Unix sockets X-BeenThere: libcamera-devel@lists.libcamera.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 01 Jul 2019 22:06:56 -0000 Hello, This series adds an IPC mechanism to pass data and file descriptors between two processes. The interface is asynchronous and bi-directional. * Changes since v2 - Mark IPCUnixSocket::isBound() const. - Fixup documentation. - Remove a unused variable. - Added two new tests, sending empty message and ordering of file descriptors. * Changes since v1 - Add a bugfix for Timer which prevented the test case to function properly. - Add destructor to close the IPC channel. - Rename attach() to bind(). - Add isBound() mehtod. - Rework signal emitted for incoming data to Signal readyRead. - Make payload argument in send() const at the cost of adding a const_cast(). - Dropped unused master_ property. - Updated documentation, thanks Laurent! - Add a call() method in the test case to simplify test logic. - Use dup() instead of opening the same file path multiple times. * Changes since RFC - Switch to an event notifications and signals for the ingress code path, making the interface asynchronous. - Removed any protocol helpers in the IPC object, a protocol should be implemented on top of the IPC. - Added documentation. - Switched to SOCK_DGRAM. - Send both data and file descriptors in the same sendmsg(). - Fixed spelling and silly errors in the code. - Merged test case in a single binary. Niklas Söderlund (2): libcamera: ipc: unix: Add a IPC mechanism based on Unix sockets test: ipc: unix: Add test for IPCUnixSocket src/libcamera/include/ipc_unixsocket.h | 57 +++ src/libcamera/ipc_unixsocket.cpp | 309 +++++++++++++++ src/libcamera/meson.build | 2 + test/ipc/meson.build | 17 + test/ipc/unixsocket.cpp | 510 +++++++++++++++++++++++++ test/meson.build | 1 + 6 files changed, 896 insertions(+) create mode 100644 src/libcamera/include/ipc_unixsocket.h create mode 100644 src/libcamera/ipc_unixsocket.cpp create mode 100644 test/ipc/meson.build create mode 100644 test/ipc/unixsocket.cpp