Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 21 Jun 2011 12:02:33 -0700
From:      Maksim Yevmenkin <maksim.yevmenkin@gmail.com>
To:        Iain Hibbert <plunky@rya-online.net>
Cc:        freebsd-bluetooth@freebsd.org
Subject:   Re: obexapp & openobex-current
Message-ID:  <BANLkTi=M0z0bf3xXvxwhzeBijmdV-w2PQg@mail.gmail.com>
In-Reply-To: <alpine.NEB.2.00.1106211735230.14756@galant.ukfsn.org>
References:  <alpine.NEB.2.00.1106211735230.14756@galant.ukfsn.org>

next in thread | previous in thread | raw e-mail | index | archive | help
Hi Iain,

> openobex is aiming towards a 2.0 release so I thought I'd try it out.. I
> have forwarded a set of patches for some build failures on NetBSD which
> may also help for FreeBSD, but after that I have another issue
>
> The issue I found was that obexapp when linked with openobex-current fail=
s
> to run in server mode. =A0I traced the problem to the custom transport
> backend does not have any method for setting a local address, which is
> implied by OBEX_ServerRegister passing one, but in truth there was never
> any actual point in passing an address here since a custom transport is
> responsible for its own addressing.
>
> The documentation was perhaps lacking before, but the following appears i=
n
> the comments for OBEX_ServerRegister now;
>
> =A0 =A0 =A0 =A0Bind a server socket to an Obex service. Common transport =
have
> =A0 =A0 =A0 =A0specialised version of this function.
> =A0 =A0 =A0 =A0If you want to call the listen callback of the custom tran=
sport,
> =A0 =A0 =A0 =A0use NULL for saddr and 0 for addrlen.
>
> and so, changing server.c as below allows to the server to run just fine
> without any side effects, and I think that should be ok for earlier
> openobex versions too?

i think it looks fine :) thank you. i will give it a quick test in a
day or two and commit it. in the same time, it would be helpful if
someone who uses obexapp on freebsd give it a quick try as well.

thanks,
max


> --- /home/plunky/misc/orig/obexapp/server.c =A0 =A0 2010-01-08 18:31:22.0=
00000000 +0000
> +++ server.c =A0 =A02011-06-21 15:47:47.000000000 +0100
> @@ -119,7 +119,6 @@ obexapp_server(obex_t *handle)
> =A0{
> =A0 =A0 =A0 =A0context_p =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0context =3D (cont=
ext_p) OBEX_GetUserData(handle);
> =A0 =A0 =A0 =A0int =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0error =3D -=
1;
> - =A0 =A0 =A0 struct sockaddr_rfcomm =A0 addr;
>
> =A0 =A0 =A0 =A0context->ss =3D sdp_open_local(NULL);
> =A0 =A0 =A0 =A0if (context->ss =3D=3D NULL) {
> @@ -141,14 +140,7 @@ obexapp_server(obex_t *handle)
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0goto done;
> =A0 =A0 =A0 =A0}
>
> - =A0 =A0 =A0 memset(&addr, 0, sizeof(addr));
> - =A0 =A0 =A0 addr.rfcomm_len =3D sizeof(addr);
> - =A0 =A0 =A0 addr.rfcomm_family =3D AF_BLUETOOTH;
> - =A0 =A0 =A0 addr.rfcomm_channel =3D context->channel;
> - =A0 =A0 =A0 memcpy(&addr.rfcomm_bdaddr, &context->laddr, sizeof(context=
->laddr));
> -
> - =A0 =A0 =A0 if (OBEX_ServerRegister(handle, (struct sockaddr *) &addr,
> - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 sizeof(addr)) < 0) {
> + =A0 =A0 =A0 if (OBEX_ServerRegister(handle, NULL, 0) < 0) {
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0log_err("%s(): OBEX_ServerRegister failed"=
, __func__);
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0goto done;
> =A0 =A0 =A0 =A0}
>
> _______________________________________________
> freebsd-bluetooth@freebsd.org mailing list
> http://lists.freebsd.org/mailman/listinfo/freebsd-bluetooth
> To unsubscribe, send any mail to "freebsd-bluetooth-unsubscribe@freebsd.o=
rg"
>



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?BANLkTi=M0z0bf3xXvxwhzeBijmdV-w2PQg>