[Bluez-devel] ioctl: setting link mode and link policy

Marco Pracucci
2006-08-31T13:59:27Z

Hi list,

I have some problem when I try to set link mode and link policy using
ioctl() system call. In particular, when I set link policy or link mode,
it seems that nothing happens.

-----------------
int deviceDescriptor;
struct hci_dev_req request;

// Open device
deviceDescriptor = hci_open_dev(deviceID);
[...]

// Set link mode
memset(&request, 0, sizeof(request));
request.dev_id = deviceID;
request.dev_opt = HCI_LM_MASTER;
ioctl(deviceDescriptor, HCISETLINKMODE, (unsigned long) &request);
[...]

// Set link policy
memset(&request, 0, sizeof(request));
request.dev_id = deviceID;
request.dev_opt = policy;
ioctl(deviceDescriptor, HCISETLINKPOL, (unsigned long) &request);
[...]
-----------------

ioctl() system calls do not return any error, but when I check the link
mode and link policy with "hciconfig -a" nothing has changed. Moreover,
I have tried to debug it with "hcidump -V" but no related hci commands
are reported.

Bluez-libs: 2.25
Bluez-utils: 2.25

Have you any idea and/or suggestion?

Thanks,
Marco Pracucci