2009-10-15 01:15:57

by Luiz Augusto von Dentz

[permalink] [raw]
Subject: dun profile

Hi List,

Im trying to put an end to this problem of detecting rfcomm port
properly, so what seems to be missing is to associate the profile to
the port so that udev can properly announce it as modem in case of dun
profile. I don't know of any mechanism to attach any profile
information to the port itself, but in theory we could identify the
port by name, so instead of using rfcomm# for all ports created by
Serial interface we could name it dun# for instance, so how about
that? Also we probably want to make this persistent so once this is
configured this will be restored in the next boot.


--
Luiz Augusto von Dentz
Engenheiro de Computa??o


2009-10-15 15:19:58

by Bastien Nocera

[permalink] [raw]
Subject: Re: dun profile

On Thu, 2009-10-15 at 11:22 -0300, Luiz Augusto von Dentz wrote:
> Hi,
>
> On Thu, Oct 15, 2009 at 6:38 AM, Bastien Nocera <[email protected]> wrote:
> > Same questions as Stefan I'm afraid.
> >
> > In any case, I think the front-ends should be creating the port
> > themselves, so they would know which one to handle.
> >
> > See the recent (and less recent) work done in NetworkManager for DUN
> > support.
>
>
> Basically I want to avoid the code done in NetworkManager, simply
> because it doesn't work for anything but the one that create the port.
> So what Im proposing is that udev take care of setting the
> capabilities to the port, not the applet manually doing it, but to
> make it possible there must be something indicating that it is a port
> to dun profile channel (or spp if that matters).

It's not the applet doing it, but the daemon. And it will run
ModemManager on the device.

> The other suggestion
> is that this port should be somehow stored so it is recreated after
> boot, but as Stefan cleverly point out this would be a bit difficult
> since some device insist in changing the channel/hide the service each
> time the profile got in use, so perhaps it is not a good idea in the
> end.
>
> What Im still missing is how I attach the information to the port so
> that udev properly recognized and nobody has to do workarounds, store
> the return of Serial.Connect("dun") and then wait it to be announced
> by udev, than I can do it directly on bluetoothd and has to duplicate
> this code on front-ends.

That's fine if you want to hack around the device. NM/MM will add the
necessary properties to the udev device when it creates the device.



2009-10-15 14:22:43

by Luiz Augusto von Dentz

[permalink] [raw]
Subject: Re: dun profile

Hi,

On Thu, Oct 15, 2009 at 6:38 AM, Bastien Nocera <[email protected]> wrote:
> Same questions as Stefan I'm afraid.
>
> In any case, I think the front-ends should be creating the port
> themselves, so they would know which one to handle.
>
> See the recent (and less recent) work done in NetworkManager for DUN
> support.


Basically I want to avoid the code done in NetworkManager, simply
because it doesn't work for anything but the one that create the port.
So what Im proposing is that udev take care of setting the
capabilities to the port, not the applet manually doing it, but to
make it possible there must be something indicating that it is a port
to dun profile channel (or spp if that matters). The other suggestion
is that this port should be somehow stored so it is recreated after
boot, but as Stefan cleverly point out this would be a bit difficult
since some device insist in changing the channel/hide the service each
time the profile got in use, so perhaps it is not a good idea in the
end.

What Im still missing is how I attach the information to the port so
that udev properly recognized and nobody has to do workarounds, store
the return of Serial.Connect("dun") and then wait it to be announced
by udev, than I can do it directly on bluetoothd and has to duplicate
this code on front-ends.

--
Luiz Augusto von Dentz
Engenheiro de Computa??o

2009-10-15 09:38:57

by Bastien Nocera

[permalink] [raw]
Subject: Re: dun profile

On Wed, 2009-10-14 at 22:15 -0300, Luiz Augusto von Dentz wrote:
> Hi List,
>
> Im trying to put an end to this problem of detecting rfcomm port
> properly, so what seems to be missing is to associate the profile to
> the port so that udev can properly announce it as modem in case of dun
> profile. I don't know of any mechanism to attach any profile
> information to the port itself, but in theory we could identify the
> port by name, so instead of using rfcomm# for all ports created by
> Serial interface we could name it dun# for instance, so how about
> that? Also we probably want to make this persistent so once this is
> configured this will be restored in the next boot.

Same questions as Stefan I'm afraid.

In any case, I think the front-ends should be creating the port
themselves, so they would know which one to handle.

See the recent (and less recent) work done in NetworkManager for DUN
support.

Cheers


2009-10-15 07:02:17

by Stefan Seyfried

[permalink] [raw]
Subject: Re: dun profile

Hi Luiz,

On Wed, 14 Oct 2009 22:15:57 -0300
Luiz Augusto von Dentz <[email protected]> wrote:

> Hi List,
>
> Im trying to put an end to this problem of detecting rfcomm port
> properly, so what seems to be missing is to associate the profile to
> the port so that udev can properly announce it as modem in case of dun
> profile.

Can you be a bit more specific on what the actual problem is?

I mean, "/usr/bin/test-serial 11:22:33:44:55:66 dun" always gave me a
rfcomm device connected to the DUN profile (back then, when I had not
switched to PAN ;)

Do you want to create /dev/rfcommX automatically on adapter insertion?
Do you also want to connect it immediately? (I would not want that).
If it would connect "on demand", then it would need to do SDP queries
and find out the port at that time since the port can change.

Or am I totally off track? (probably ;)

Have fun,

seife
--
Stefan Seyfried

"Any ideas, John?"
"Well, surrounding them's out."