From e8853ee660503c7d461c157dcbd82f4729bb49ee Mon Sep 17 00:00:00 2001 From: Ryan Pavlik Date: Mon, 2 May 2011 10:38:50 -0500 Subject: [PATCH] Make the error nicer when you don't have an adapter plugged in. --- src/io_nix.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/io_nix.c b/src/io_nix.c index 90cce7a..4eb290e 100644 --- a/src/io_nix.c +++ b/src/io_nix.c @@ -37,6 +37,7 @@ #include #include +#include #include #include @@ -75,7 +76,11 @@ int wiiuse_find(struct wiimote_t** wm, int max_wiimotes, int timeout) { /* get the id of the first bluetooth device. */ device_id = hci_get_route(NULL); if (device_id < 0) { - perror("hci_get_route"); + if (errno == ENODEV) { + WIIUSE_ERROR("Could not detect a Bluetooth adapter!"); + } else { + perror("hci_get_route"); + } return 0; }