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

Marco Pracucci
2006-08-31T15:15:22Z

Hi Peter,

I would like to set a "global" link mode and link policy that will be
the default for every connection. Something similar to hcid.

Marco

> Hi Marco,
>
> depending on which level you want to set the linkmode use setsockopt()
> for your connection. E.g. for rfcomm use something like :
>
> // set security options for this service
> if(authenticate) {
> linkmode |= RFCOMM_LM_AUTH ;
> if(encrypted) linkmode |= RFCOMM_LM_ENCRYPT ;
> }
>
> if (linkmode && setsockopt(sfd, SOL_RFCOMM, RFCOMM_LM, &linkmode, sizeof(linkmode)) < 0) {
> close(sfd); sfd = 0 ;
> return -1;
> }
>
> Ciao,
>
> Peter