public inbox for linux-bluetooth@vger.kernel.org
 help / color / mirror / Atom feed
From: Stephen Crane <steve.crane@rococosoft.com>
To: Julien Campana <juliencampana@yahoo.fr>
Cc: BlueZ-devel List <bluez-devel@lists.sourceforge.net>
Subject: Re: [Bluez-devel] Error while setting RFCOMM security options
Date: Tue, 11 May 2004 15:35:30 +0100	[thread overview]
Message-ID: <1084286129.3363.84.camel@baroque.rococosoft.com> (raw)
In-Reply-To: <1084285384.893.17.camel@fischer>

BlueZ doesn't support these socket options for RFComm yet.

On Tue, 2004-05-11 at 15:27, Julien Campana wrote:
> Hi!
> 
> I'm trying to connect to a device over RFCOMM using the flags
> "authenticate", "encryption" and "master". Part of the code is: 
> 
> /******************************************/
> if ((fd = socket(PF_BLUETOOTH, SOCK_STREAM, BTPROTO_RFCOMM)) < 0)
>      return fd;
> 
> memset(&local_addr, 0, sizeof(local_addr));
> local_addr.rc_family = AF_BLUETOOTH;
> bacpy(&local_addr.rc_bdaddr, BDADDR_ANY);
> if ((err = bind(fd, (struct sockaddr *)&local_addr, sizeof(local_addr)))
> < 0) {
>      close(fd);
>      return err;
>    }
> 
> int opt = 0;
> if (master) opt |= L2CAP_LM_MASTER;
> if (auth) opt |= L2CAP_LM_AUTH;
> if (encrypt) opt |= L2CAP_LM_ENCRYPT;
> 
> 
> 
> if (setsockopt(fd, SOL_RFCOMM, L2CAP_LM, &opt, sizeof(opt)) < 0) {
>      printf("WARNING can't set link Mode (reason: %s)\n\n",
> strerror(errno));
>    }
> /*******************************************/
> 
> This programm outputs the following message: 
> WARNING can't set link Mode (reason: Protocol not available)
> 
> Why? The L2CAP protocol is available as well as the RFCOMM protocol on
> my machine (l2ping actually works and my program exchanges data over
> RFCOMM without any problem).
> 
> Am I wrong in the way of setting these security flags?
> 
> Thank you for your answers.
> 
> Julien Campana
> 
> 
> 
> 
> 
> -------------------------------------------------------
> This SF.Net email is sponsored by Sleepycat Software
> Learn developer strategies Cisco, Motorola, Ericsson & Lucent use to deliver
> higher performing products faster, at low TCO.
> http://www.sleepycat.com/telcomwpreg.php?From=osdnemail3
> _______________________________________________
> Bluez-devel mailing list
> Bluez-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/bluez-devel
-- 
Stephen Crane, Rococo Software Ltd. http://www.rococosoft.com
steve.crane@rococosoft.com +353-1-6601315 (ext 209)



-------------------------------------------------------
This SF.Net email is sponsored by Sleepycat Software
Learn developer strategies Cisco, Motorola, Ericsson & Lucent use to deliver
higher performing products faster, at low TCO.
http://www.sleepycat.com/telcomwpreg.php?From=osdnemail3
_______________________________________________
Bluez-devel mailing list
Bluez-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bluez-devel

  reply	other threads:[~2004-05-11 14:35 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-05-11 14:27 [Bluez-devel] Error while setting RFCOMM security options Julien Campana
2004-05-11 14:35 ` Stephen Crane [this message]
2004-05-12 13:25 ` Marcel Holtmann

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1084286129.3363.84.camel@baroque.rococosoft.com \
    --to=steve.crane@rococosoft.com \
    --cc=bluez-devel@lists.sourceforge.net \
    --cc=juliencampana@yahoo.fr \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox