From: amateur <ztl.post@gmail.com>
To: bluez-users@lists.sourceforge.net
Subject: Re: [Bluez-users] Problem with RFCOMM/Socket and security
Date: Fri, 15 Dec 2006 15:07:44 +0800 [thread overview]
Message-ID: <20061215070744.GA3309@163.com> (raw)
In-Reply-To: <457F104A.3020508@sbox.tugraz.at>
On Tue, Dec 12, 2006 at 09:25:46PM +0100, Hans Juergen Gamauf wrote:
> Hello to all!
>
> I'm working with an Embedded System (Arm 9, Linux 2.6.17.3, Uart
> Bluetooth Module from Bluegiga WT11) with Bluez, but without using
> /etc/bluetooth/hcid.conf
> I'm starting it with
>
> /usr/sbin/hciattach /dev/ttyS1 csr 115200
> /usr/sbin/hciconfig hci0 up
>
> and can set it up using hciconfig (currently I only set the name)
>
> Now I want to establish a simple RFCOMM-Socket-Connection between two of
> these systems through
>
> ////// Server
> _sock = socket(AF_BLUETOOTH, SOCK_STREAM, BTPROTO_RFCOMM);
> loc_addr.rc_family = AF_BLUETOOTH;
> loc_addr.rc_bdaddr = *BDADDR_ANY;
> loc_addr.rc_channel = (uint8_t) 1;
> bind(_sock, (struct sockaddr *)&loc_addr, sizeof(loc_addr));
> listen(_sock, 1);
> _clientSock = accept(_sock, (struct sockaddr *)&rem_addr, (socklen_t*)&opt);
>
>
> Everything works fine!
>
>
> But now I want to Authenticate and Encrypt this Connection, so I inserted
>
> opt = RFCOMM_LM_AUTH|RFCOMM_LM_ENCRYPT;
> setsockopt(_sock, SOL_RFCOMM, RFCOMM_LM, &opt, sizeof(opt));
>
> after creating the socket, both on the server and the client, but now
> the connection cannot be established, of course, the pin is missing
> but where can I introduce it? I have no hcid.conf, so no pin_helper and
> so on, is it possible to tell bluez the pin through this programm?
You can handle pin code request in your own code following the way
that hcid uses. BTW, what brand of Embedded Arm Chip support 2.6.17-3?
I have never seen such a embedded arm vendor.
>
>
> One little other problem:
> I have many clients, and I want that only one connection at a time can
> be established, but when one client is talking to the server, the next
> client can establish it (connect returns 0) and can send the data, but I
> don't know who receives the data
> Is it possible to reject the connection from the server if he is dealing
> already a client?
What if you close the main socket(the listening one) after accpting
one client?
--
You will pioneer the first Martian colony.
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Bluez-users mailing list
Bluez-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bluez-users
next prev parent reply other threads:[~2006-12-15 7:07 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-12-12 20:25 [Bluez-users] Problem with RFCOMM/Socket and security Hans Juergen Gamauf
2006-12-15 7:07 ` amateur [this message]
-- strict thread matches above, loose matches on Subject: below --
2006-12-12 19:30 Hans Juergen Gamauf
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=20061215070744.GA3309@163.com \
--to=ztl.post@gmail.com \
--cc=bluez-users@lists.sourceforge.net \
/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