diff --git a/profiles/input/device.c b/profiles/input/device.c
index bded1ea..f1fa716 100644
--- a/profiles/input/device.c
+++ b/profiles/input/device.c
return err;
}
-static int ioctl_is_connected(struct input_device *idev)
+static bool ioctl_is_connected(struct input_device *idev)
{
struct hidp_conninfo ci;
int ctl;
ctl = socket(AF_BLUETOOTH, SOCK_RAW, BTPROTO_HIDP);
if (ctl < 0) {
error("Can't open HIDP control socket");
- return 0;
+ return false;
}
memset(&ci, 0, sizeof(ci));
if (ioctl(ctl, HIDPGETCONNINFO, &ci) < 0) {
error("Can't get HIDP connection info");
close(ctl);
- return 0;
+ return false;
}
close(ctl);
if (ci.state != BT_CONNECTED)
- return 0;
- else
- return 1;
+ return false;
+
+ return true;
}
static int ioctl_disconnect(struct input_device *idev, uint32_t flags)
return err;
}
-static int is_connected(struct input_device *idev)
+static bool is_connected(struct input_device *idev)
{
return ioctl_is_connected(idev);
}