Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 23 Aug 2007 10:59:17 +0200
From:      "Heiko Wundram (Beenic)" <wundram@beenic.net>
To:        "Maksim Yevmenkin" <maksim.yevmenkin@gmail.com>
Cc:        "freebsd-bluetooth@freebsd.org" <freebsd-bluetooth@freebsd.org>
Subject:   Re: Binding RFCOMM sockets
Message-ID:  <200708231059.19779.wundram@beenic.net>
In-Reply-To: <bb4a86c70708221421o71b25ee4pda816bef8c925f06@mail.gmail.com>
References:  <200708211228.02044.wundram@beenic.net> <1187726992.986273.1438.nullmailer@galant.ukfsn.org> <bb4a86c70708221421o71b25ee4pda816bef8c925f06@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
Am Mittwoch 22 August 2007 23:21:51 schrieb Maksim Yevmenkin:
> On 8/21/07, Iain Hibbert <plunky@rya-online.net> wrote:
> > nor in NetBSD - out of interest though, what is this server trying to
> > achieve? It does not seem especially useful to listen on 'any' channel,
> > given the way that bluetooth service discovery works..
>
> well, the idea, imo, is when a server binds to 'any' channel (or psm),
> the kernel will automatically assign first available one. next, the
> application calls getsockname(2) to obtain the actual channel (or psm)
> that was assigned by the kernel and registers that channel (or psm)
> with sdp.
>
> this simplifies resource (i.e. channel or psm) management when
> multiple applications are trying to provide multiple services at the
> same time. basically you do not have to worry about assigning channels
> (or psm's) by hand.

This is exactly what I had in mind. Generally, what I'm currently building is 
an OBEX service framework which depending on the channel the remote 
application connects to should offer differing kinds of backend services.

As the services themselves are fairly independent, I generally found the idea 
to have the kernel decide which channel to use for a specific was pretty much 
similar to what the portmapper does for TCP/IP, where a listening socket is 
bound if it wasn't on the listen command, and you can then retrieve the local 
address using getsockname() to register that port with the portmapper.

Anyway, as you said you'd accept a patch from me, I'm currently trying to hack 
this into my 6.2-STABLE. I'll be able to tell you whether I'll manage to get 
this working by the end of the weekend; (FreeBSD) kernel-programming is 
utterly new for me. ;-)

-- 
Heiko Wundram
Product & Application Development



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200708231059.19779.wundram>