Content-Type: multipart/mixed; boundary="===============5365846584606109860==" MIME-Version: 1.0 From: Martin =?unknown-8bit?q?Hundeb=C3=B8ll?= Subject: [PATCH] tools: Add gpio utility Date: Fri, 21 Jun 2019 11:40:07 +0200 Message-ID: <20190621094007.35008-1-martin@geanix.com> List-Id: To: ell@lists.01.org --===============5365846584606109860== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable --- .gitignore | 1 + Makefile.am | 5 +- tools/gpio.c | 264 +++++++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 269 insertions(+), 1 deletion(-) create mode 100644 tools/gpio.c diff --git a/.gitignore b/.gitignore index d34127b..d60c2e8 100644 --- a/.gitignore +++ b/.gitignore @@ -76,3 +76,4 @@ tools/certchain-verify tools/genl-discover tools/genl-watch tools/genl-request +tools/gpio diff --git a/Makefile.am b/Makefile.am index 072867f..c39e0e9 100644 --- a/Makefile.am +++ b/Makefile.am @@ -326,7 +326,7 @@ examples_glib_eventloop_LDADD =3D ell/libell-private.la= @GLIB_LIBS@ examples_dhcp_client_LDADD =3D ell/libell-private.la = noinst_PROGRAMS +=3D tools/certchain-verify tools/genl-discover \ - tools/genl-watch tools/genl-request + tools/genl-watch tools/genl-request tools/gpio tools_certchain_verify_SOURCES =3D tools/certchain-verify.c tools_certchain_verify_LDADD =3D ell/libell-private.la = @@ -339,6 +339,9 @@ tools_genl_watch_LDADD =3D ell/libell-private.la tools_genl_request_SOURCES =3D tools/genl-request.c tools_genl_request_LDADD =3D ell/libell-private.la = +tools_gpio_SOURCES =3D tools/gpio.c +tools_gpio_LDADD =3D ell/libell-private.la + EXTRA_DIST =3D ell/ell.sym \ $(unit_test_data_files) unit/gencerts.cnf unit/plaintext.txt = diff --git a/tools/gpio.c b/tools/gpio.c new file mode 100644 index 0000000..f2bdb1f --- /dev/null +++ b/tools/gpio.c @@ -0,0 +1,264 @@ +/* + * Embedded Linux library + * + * Copyright (C) 2019 Geanix. All rights reserved. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 = USA + */ + +#ifdef HAVE_CONFIG_H +#include +#endif + +#define _GNU_SOURCE +#include +#include +#include +#include + +#include + +static int print_usage(void) +{ + fprintf(stderr, + "usage: %1$s find \n" + " %1$s get ( |