2 ** Copyright 2008 The Android Open Source Project
4 ** Licensed under the Apache License, Version 2.0 (the "License");
5 ** you may not use this file except in compliance with the License.
6 ** You may obtain a copy of the License at
8 ** http://www.apache.org/licenses/LICENSE-2.0
10 ** Unless required by applicable law or agreed to in writing, software
11 ** distributed under the License is distributed on an "AS IS" BASIS,
12 ** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 ** See the License for the specific language governing permissions and
14 ** limitations under the License.
17 /** Bluedroid testing */
25 #include <bluedroid/bluetooth.h>
27 static int do_enable() {
30 printf("= %d\n", ret);
34 static int do_disable() {
37 printf("= %d\n", ret);
41 static int do_is_enabled() {
43 ret = bt_is_enabled();
44 printf("= %d\n", ret);
51 } function_table[] = {
52 {"enable", do_enable},
53 {"disable", do_disable},
54 {"is_enabled", do_is_enabled},
62 for (i = 0; function_table[i].name; i++) {
63 printf("\tbttest %s\n", function_table[i].name);
67 int main(int argc, char **argv) {
74 for (i = 0; function_table[i].name; i++) {
75 if (!strcmp(argv[1], function_table[i].name)) {
76 printf("%s\n", function_table[i].name);
77 return (*function_table[i].ptr)();