bool bt_att_set_close_on_unref(struct bt_att *att, bool do_close) { if (!att || !att->io) return false; return io_set_close_on_destroy(att->io, do_close); }
bool bt_hci_set_close_on_unref(struct bt_hci *hci, bool do_close) { if (!hci) return false; return io_set_close_on_destroy(hci->io, do_close); }
bool bt_uhid_set_close_on_unref(struct bt_uhid *uhid, bool do_close) { if (!uhid || !uhid->io) return false; io_set_close_on_destroy(uhid->io, do_close); return true; }
struct bt_uhid *bt_uhid_new_default(void) { struct bt_uhid *uhid; int fd; fd = open(UHID_DEVICE_FILE, O_RDWR | O_CLOEXEC); if (fd < 0) return NULL; uhid = bt_uhid_new(fd); if (!uhid) { close(fd); return NULL; } io_set_close_on_destroy(uhid->io, true); return uhid; }