From patchwork Sun Jun 30 16:25:11 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: 1530 Return-Path: Received: from bin-mail-out-06.binero.net (bin-mail-out-06.binero.net [195.74.38.229]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 65C3861E16 for ; Sun, 30 Jun 2019 18:25:31 +0200 (CEST) X-Halon-ID: 9c58cfd6-9b53-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 9c58cfd6-9b53-11e9-8ab4-005056917a89; Sun, 30 Jun 2019 18:25:09 +0200 (CEST) From: =?utf-8?q?Niklas_S=C3=B6derlund?= To: libcamera-devel@lists.libcamera.org Date: Sun, 30 Jun 2019 18:25:11 +0200 Message-Id: <20190630162514.20522-1-niklas.soderlund@ragnatech.se> X-Mailer: git-send-email 2.21.0 MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH v2 0/3] 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: Sun, 30 Jun 2019 16:25:31 -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 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 (3): libcamera: timer: Stop timer when it is deleted libcamera: ipc: unix: Add a IPC mechanism based on Unix sockets test: ipc: unix: Add test for IPCUnixSocket include/libcamera/timer.h | 1 + src/libcamera/include/ipc_unixsocket.h | 57 ++++ src/libcamera/ipc_unixsocket.cpp | 312 ++++++++++++++++++++ src/libcamera/meson.build | 2 + src/libcamera/timer.cpp | 5 + test/ipc/meson.build | 12 + test/ipc/unixsocket.cpp | 390 +++++++++++++++++++++++++ test/meson.build | 1 + 8 files changed, 780 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