Blob: btmgmt.c
Blob id: 0f3de2880014e3f385f76a2405d19b628c94e275
Size: 987 B
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 | // SPDX-License-Identifier: GPL-2.0-or-later /* * BlueZ - Bluetooth protocol stack for Linux * * Copyright (C) 2011 Intel Corporation. All rights reserved. * */ #ifdef HAVE_CONFIG_H #include <config.h> #endif #define _GNU_SOURCE #include <stdlib.h> #include <stdio.h> #include "src/shared/shell.h" #include "client/mgmt.h" static const char *index_option; static struct option main_options[] = { { "index", 1, 0, 'i' }, { 0, 0, 0, 0 } }; static const char **optargs[] = { &index_option }; static const char *help[] = { "Specify adapter index\n" }; static const struct bt_shell_opt opt = { .options = main_options, .optno = sizeof(main_options) / sizeof(struct option), .optstr = "i:V", .optarg = optargs, .help = help, }; int main(int argc, char *argv[]) { int status; bt_shell_init(argc, argv, &opt); mgmt_add_submenu(); mgmt_set_index(index_option); bt_shell_attach(fileno(stdin)); status = bt_shell_run(); mgmt_remove_submenu(); return status; } |