From owner-freebsd-bluetooth@FreeBSD.ORG Tue Jun 21 19:28:01 2011 Return-Path: Delivered-To: freebsd-bluetooth@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BED3810656D1 for ; Tue, 21 Jun 2011 19:28:01 +0000 (UTC) (envelope-from maksim.yevmenkin@gmail.com) Received: from mail-bw0-f54.google.com (mail-bw0-f54.google.com [209.85.214.54]) by mx1.freebsd.org (Postfix) with ESMTP id 48EA58FC08 for ; Tue, 21 Jun 2011 19:28:00 +0000 (UTC) Received: by bwz12 with SMTP id 12so289630bwz.13 for ; Tue, 21 Jun 2011 12:28:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=TlQOkmrbx1/MSeNFxydOeAMBKLo8S6ClyeZBF5a0lSo=; b=uOmv/zT92WwCjg/Uh0PeWux2RMS6igYslBvMjMK19WFlGPAAFu3kFFODqIqO+s+L8r er+QHis0vLagmMyZW7VhmOf0DaS3AFdDyROzs0MBoxn+2+E7dTT4IN0d6xqsTKJRfGgJ V2bNW0wLHp/bpHKZv9k2Pt4GqOWDZ4Kzd8Wzo= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; b=Wk1FTvLPMrbDm3ZCvOOve4BDOodB7ex0O+JThBHncXR1YTvVF0+eIqn4wuD7KfltY0 9p5+dXnkbcM58jf/+h5LJY6NjnaK+YaBOR20rfVdtMrXVvoZozYuDnbM205CSq6zVPPd sw+NFWXBdxtd57gNF30HILzd7rWgYuiL1ODjo= MIME-Version: 1.0 Received: by 10.204.80.93 with SMTP id s29mr238222bkk.23.1308682953169; Tue, 21 Jun 2011 12:02:33 -0700 (PDT) Received: by 10.204.38.10 with HTTP; Tue, 21 Jun 2011 12:02:33 -0700 (PDT) In-Reply-To: References: Date: Tue, 21 Jun 2011 12:02:33 -0700 Message-ID: From: Maksim Yevmenkin To: Iain Hibbert Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: freebsd-bluetooth@freebsd.org Subject: Re: obexapp & openobex-current X-BeenThere: freebsd-bluetooth@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Using Bluetooth in FreeBSD environments List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 21 Jun 2011 19:28:01 -0000 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" >