diff options
author | Grzegorz Kolodziejczyk <grzegorz.kolodziejczyk@tieto.com> | 2015-03-13 13:41:50 +0100 |
---|---|---|
committer | Szymon Janc <szymon.janc@tieto.com> | 2015-03-13 15:03:48 +0100 |
commit | 07861ffd100e140f8308e31b3f9285ed3ab3442c (patch) | |
tree | 194109e0b9785c470c202ce6832b0395bd61c783 /tools/bneptest.c | |
parent | 33fa99fb341e054f1c2fa2ac731c1d76093c80a9 (diff) | |
download | bluez-07861ffd100e140f8308e31b3f9285ed3ab3442c.tar.gz |
tools/bneptest: Add initial support for bneptest tool
This tool should be designed to help testing bnep on BlueZ.
Diffstat (limited to 'tools/bneptest.c')
-rw-r--r-- | tools/bneptest.c | 74 |
1 files changed, 74 insertions, 0 deletions
diff --git a/tools/bneptest.c b/tools/bneptest.c new file mode 100644 index 000000000..619427beb --- /dev/null +++ b/tools/bneptest.c @@ -0,0 +1,74 @@ +/* + * + * BlueZ - Bluetooth protocol stack for Linux + * + * Copyright (C) 2015 Intel Corporation + * + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + * + */ + +#ifdef HAVE_CONFIG_H +#include <config.h> +#endif + +#include <stdio.h> +#include <stdlib.h> +#include <getopt.h> + +#include <glib.h> + +#include "src/log.h" + +static GMainLoop *mloop; + +static void usage(void) +{ + printf("bneptest - BNEP testing ver %s\n", VERSION); + printf("Usage:\n" + "\tbneptest [options]\n"); +} + +static struct option main_options[] = { + { "help", 0, 0, 'h' }, + { 0, 0, 0, 0 } +}; + +int main(int argc, char *argv[]) +{ + int opt; + + DBG(""); + + mloop = g_main_loop_new(NULL, FALSE); + if (!mloop) { + printf("cannot create main loop\n"); + + exit(1); + } + + while ((opt = getopt_long(argc, argv, "h", main_options, NULL)) + != EOF) { + switch (opt) { + case 'h': + default: + usage(); + exit(0); + } + } + + return 0; +} |