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

Marcel Holtmann
2006-08-31T19:23:05Z

Hi Marco,

> >> I would like to set a "global" link mode and link policy that will be
> >> the default for every connection. Something similar to hcid.
> >>
> > what do you expect from doing this? It is not a good idea to change it
> > globally except you know exactly what you are doing. Changes these
> > settings can have implications you might not be aware of. So what is
> > your purpose on changing them?
> >
> I would become master on incoming connections and I would deny role
> switch on outgoing connections. If I'm not wrong, I should set MASTER as
> link mode and disable role switch from link policy.

this can't work. You must allow role switching. The initiator of a
piconet is always the master in the first place. They have to switch the
role to make the acceptor the master. So don't touch the link policy, it
must allow the role switch. Setting the link mode to MASTER will request
an immediate role switch after connection creation. However if both
sides have the MASTER link mode set, you will never get a connection,
because the initiator will refuse the switch the role.

> However, I can't use
> hcid, so I would do this from a custom application.
> Is it possible?

It is not wise at all to work without hcid. And you know that your
custom application must be placed under GPL.

Regards

Marcel