3 * BlueZ - Bluetooth protocol stack for Linux
5 * Copyright (C) 2012-2014 Intel Corporation. All rights reserved.
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by
10 * the Free Software Foundation; either version 2 of the License, or
11 * (at your option) any later version.
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
18 * You should have received a copy of the GNU General Public License
19 * along with this program; if not, write to the Free Software
20 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
34 static void check_result(const char *name, const char *pathname)
39 for (i = 0; i < 50; i++) {
42 if (!stat(pathname, &st)) {
43 printf("Found %s selftest result\n", name);
50 fp = fopen(pathname, "re");
52 char result[32], *ptr;
54 ptr = fgets(result, sizeof(result), fp);
57 ptr = strpbrk(result, "\r\n");
61 printf("%s: %s\n", name, result);
65 int main(int argc, char *argv[])
67 check_result("ECDH", "/sys/kernel/debug/bluetooth/selftest_ecdh");
68 check_result("SMP", "/sys/kernel/debug/bluetooth/selftest_smp");