Re: [Bluez-users] Question about bluetooth simultaneous connections

Brad Midgley
2008-03-05T14:03:45Z

Mohomed, you'll get closer to 7 if you try to keep your device master
on its connections. Something like calling a fn after estabishing
connections:

static void make_master(bdaddr_t bdaddr)
{
uint8_t role = 0; // 0 means master
int dd, dev_id;

dev_id = hci_for_each_dev(HCI_UP, find_conn, (long) &bdaddr);
if (dev_id < 0) {
fprintf(stderr, "make_master: Not connected.\n");
return;
}

dd = hci_open_dev(dev_id);
if (dd < 0) {
perror("HCI device open failed");
return;
}

if (hci_switch_role(dd, &bdaddr, role, 10000) < 0) {
perror("Switch role request failed");
}
close(dd);
}

--
Brad