From owner-freebsd-bluetooth@FreeBSD.ORG Tue Jun 21 17:28:04 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 161861065670 for ; Tue, 21 Jun 2011 17:28:04 +0000 (UTC) (envelope-from plunky@rya-online.net) Received: from mail.ukfsn.org (mail.ukfsn.org [77.75.108.10]) by mx1.freebsd.org (Postfix) with ESMTP id AA5328FC1A for ; Tue, 21 Jun 2011 17:28:03 +0000 (UTC) Received: from localhost (smtp-filter.ukfsn.org [192.168.54.205]) by mail.ukfsn.org (Postfix) with ESMTP id 67E58DEC3F for ; Tue, 21 Jun 2011 17:54:44 +0100 (BST) Received: from mail.ukfsn.org ([192.168.54.25]) by localhost (smtp-filter.ukfsn.org [192.168.54.205]) (amavisd-new, port 10024) with ESMTP id KzVkNTKMcIva for ; Tue, 21 Jun 2011 17:54:44 +0100 (BST) Received: from galant.ukfsn.org (unknown [89.194.132.197]) by mail.ukfsn.org (Postfix) with ESMTP id 89E57DEBB9 for ; Tue, 21 Jun 2011 17:54:43 +0100 (BST) Received: by galant.ukfsn.org (Postfix, from userid 1000) id E31292600B0; Tue, 21 Jun 2011 17:52:44 +0100 (BST) Date: Tue, 21 Jun 2011 17:52:44 +0100 (BST) From: Iain Hibbert To: freebsd-bluetooth@freebsd.org Message-ID: User-Agent: Alpine 2.00 (NEB 1167 2008-08-23) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Subject: 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 17:28:04 -0000 Hi, 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 fails to run in server mode. I 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 in the comments for OBEX_ServerRegister now; Bind a server socket to an Obex service. Common transport have specialised version of this function. If you want to call the listen callback of the custom transport, use 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? iain --- /home/plunky/misc/orig/obexapp/server.c 2010-01-08 18:31:22.000000000 +0000 +++ server.c 2011-06-21 15:47:47.000000000 +0100 @@ -119,7 +119,6 @@ obexapp_server(obex_t *handle) { context_p context = (context_p) OBEX_GetUserData(handle); int error = -1; - struct sockaddr_rfcomm addr; context->ss = sdp_open_local(NULL); if (context->ss == NULL) { @@ -141,14 +140,7 @@ obexapp_server(obex_t *handle) goto done; } - memset(&addr, 0, sizeof(addr)); - addr.rfcomm_len = sizeof(addr); - addr.rfcomm_family = AF_BLUETOOTH; - addr.rfcomm_channel = context->channel; - memcpy(&addr.rfcomm_bdaddr, &context->laddr, sizeof(context->laddr)); - - if (OBEX_ServerRegister(handle, (struct sockaddr *) &addr, - sizeof(addr)) < 0) { + if (OBEX_ServerRegister(handle, NULL, 0) < 0) { log_err("%s(): OBEX_ServerRegister failed", __func__); goto done; } 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" > From owner-freebsd-bluetooth@FreeBSD.ORG Tue Jun 21 19:45:24 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 E893210656B2 for ; Tue, 21 Jun 2011 19:45:24 +0000 (UTC) (envelope-from plunky@rya-online.net) Received: from mail.ukfsn.org (mail.ukfsn.org [77.75.108.10]) by mx1.freebsd.org (Postfix) with ESMTP id AA72D8FC19 for ; Tue, 21 Jun 2011 19:45:24 +0000 (UTC) Received: from localhost (smtp-filter.ukfsn.org [192.168.54.205]) by mail.ukfsn.org (Postfix) with ESMTP id CF17DDEC86; Tue, 21 Jun 2011 20:45:22 +0100 (BST) Received: from mail.ukfsn.org ([192.168.54.25]) by localhost (smtp-filter.ukfsn.org [192.168.54.205]) (amavisd-new, port 10024) with ESMTP id fS7jT5JQg6He; Tue, 21 Jun 2011 20:45:22 +0100 (BST) Received: from galant.ukfsn.org (unknown [89.195.130.176]) by mail.ukfsn.org (Postfix) with ESMTP id D5A1EDEC80; Tue, 21 Jun 2011 20:45:21 +0100 (BST) Received: by galant.ukfsn.org (Postfix, from userid 1000) id 4F1B92600B0; Tue, 21 Jun 2011 20:44:51 +0100 (BST) Date: Tue, 21 Jun 2011 20:44:51 +0100 (BST) From: Iain Hibbert To: Maksim Yevmenkin In-Reply-To: Message-ID: References: User-Agent: Alpine 2.00 (NEB 1167 2008-08-23) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII 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:45:25 -0000 On Tue, 21 Jun 2011, Maksim Yevmenkin wrote: > > 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, btw I will report back when the openobex patches have been merged with upstream, it will probably be worth testing that on FreeBSD before they actually release.. (seems there has been a bit of work with documentation at least, but still doxygen no manpages ;) iain From owner-freebsd-bluetooth@FreeBSD.ORG Wed Jun 22 04:08:41 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 D5BF9106568E for ; Wed, 22 Jun 2011 04:08:41 +0000 (UTC) (envelope-from jamesbrandongooch@gmail.com) Received: from mail-ww0-f50.google.com (mail-ww0-f50.google.com [74.125.82.50]) by mx1.freebsd.org (Postfix) with ESMTP id 6BFDB8FC08 for ; Wed, 22 Jun 2011 04:08:41 +0000 (UTC) Received: by wwe6 with SMTP id 6so384567wwe.31 for ; Tue, 21 Jun 2011 21:08:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:date:message-id:subject:from:to :content-type; bh=8GnxFpXnTnfP+mUr6JR+9XL/CzIWwMbIP45dyGU7Kag=; b=AKl8x+Fzp0zuZeuXyGrbYMyFC93DGWYEGLlS+hCUmqGquFPRSXJu8n2FiZnyHw85wc XzkqEX8++0fe1TnX6oY88JIlk0Pii4Fm2NStS/o1lwy+HK3Dg12+l7OIlSW3qZZcNZ2A biO1Q65LcgetWFZS+Pg/umrWfx/YVUDp8l5MA= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:content-type; b=Pbq/9JZowMTkeTTNoTXFc1FSrQ8MI1EUZOe3K6ILu83zuWh/xRPupDlcaaS2C7u1OA cRWyiyS2W67N2U43YluL7eg5aICtPCnpRUTdx77WHVqrPUF0D+JAPTGn5+lbGdPNSdYw PYb1pnrOXqRkgitqUt+YxRhHYje32y3mQc/RE= MIME-Version: 1.0 Received: by 10.216.232.13 with SMTP id m13mr1500612weq.110.1308713844367; Tue, 21 Jun 2011 20:37:24 -0700 (PDT) Received: by 10.216.65.203 with HTTP; Tue, 21 Jun 2011 20:37:24 -0700 (PDT) Date: Tue, 21 Jun 2011 22:37:24 -0500 Message-ID: From: Brandon Gooch To: freebsd-bluetooth@freebsd.org Content-Type: text/plain; charset=ISO-8859-1 Subject: Broadcom BCM2046B1 in HCI mode? 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: Wed, 22 Jun 2011 04:08:41 -0000 I have one of these in my notebook: uhub4: on usbus0 This is a bluetooth device in HID mode, but I'd like to switch it to HCI mode. I found the following in rc.conf(5): ubthidhci_enable (bool) If set to ``YES'', change the USB Bluetooth controller from HID mode to HCI mode. You also need to specify the location of USB Bluetooth controller with the ubthidhci_busnum and ubthidhci_addr variables. ubthidhci_busnum Bus number where the USB Bluetooth controller is located. Check the output of usbconfig(8) on your system to find this information. ubthidhci_addr Bus address of the USB Bluetooth controller. Check the out- put of usbconfig(8) on your system to find this information. So I added the appropriate directives to /etc/rc.conf, to no avail: ubthidhci_enable="YES" ubthidhci_busnum="0" ubthidhci_addr="5" This basically calls usbconfig(8) at system start-up in the following way: /usr/sbin/usbconfig -u 0 -a 5 do_request 0x40 0 0 0 0 > /dev/null 2>&1 Running this command manually, I see this output: REQUEST = ...which I've read as potentially being OK, as the operation still may have successfully completed -- it hasn't :( So, has anyone had any luck using this rc.conf(5) directive, or does anyone on this list have a modified usbconfig(8) command that may help me coax HCI from this device? -Brandon From owner-freebsd-bluetooth@FreeBSD.ORG Wed Jun 22 16:17:46 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 61B811065672 for ; Wed, 22 Jun 2011 16:17:46 +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 E12218FC0A for ; Wed, 22 Jun 2011 16:17:40 +0000 (UTC) Received: by bwz12 with SMTP id 12so1307419bwz.13 for ; Wed, 22 Jun 2011 09:17:39 -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=u2Vj3TD5gQoQbQKx1hR1dAzdyVojrjBZZOclCrdQ+Hk=; b=HLwMDszFCNo6Qc3P8gepcBRVrNYks+tW3t1xbUVphBfgPbm35qaJXB+3eB/ZO3/DOD CijZ9fEmzV1H96ifj+59hGXK0zZxN6S6lAbNYffsT7N+YZBGsdqmg337wy1B8jjiS7bb gTCG0XsZ8M1HeLV13Uyss74xQMTpMgfwkn8aQ= 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=eCHxucs7T6gNn5IX1JKINvEwOLINa40dgVrUATM/m/A9Y6xez/8Qq7rc0h5vwY/G+g tSEl3dyWe9VfdorzXFVe1qcfYZX0qUY1hCTUGAWkfmyf32ov45QTE9Zx1qVqitaKXemU V0oq0yuMNKrQnlQO+dbPVxd8C4Qz6Hj+q6Rak= MIME-Version: 1.0 Received: by 10.204.84.24 with SMTP id h24mr28850bkl.185.1308759459103; Wed, 22 Jun 2011 09:17:39 -0700 (PDT) Received: by 10.204.38.10 with HTTP; Wed, 22 Jun 2011 09:17:39 -0700 (PDT) In-Reply-To: References: Date: Wed, 22 Jun 2011 09:17:39 -0700 Message-ID: From: Maksim Yevmenkin To: Brandon Gooch Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: "freebsd-bluetooth@freebsd.org" Subject: Re: Broadcom BCM2046B1 in HCI mode? 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: Wed, 22 Jun 2011 16:17:46 -0000 On Tuesday, June 21, 2011, Brandon Gooch wrot= e: > I have one of these in my notebook: > > uhub4: on usbus0 > > This is a bluetooth device in HID mode, but I'd like to switch it to > HCI mode. I found the following in rc.conf(5): > > =A0 =A0 ubthidhci_enable > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 (bool) If set to ``YES'', change the USB= Bluetooth controller > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 from HID mode to HCI mode. =A0You also n= eed to specify the > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 location of USB Bluetooth controller wit= h the > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 ubthidhci_busnum and ubthidhci_addr vari= ables. > > =A0 =A0 ubthidhci_busnum > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 Bus number where the USB Bluetooth contr= oller is located. > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 Check the output of usbconfig(8) on your= system to find this > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 information. > > =A0 =A0 ubthidhci_addr > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 Bus address of the USB Bluetooth control= ler. =A0Check the out- > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 put of usbconfig(8) on your system to fi= nd this information. > > So I added the appropriate directives to /etc/rc.conf, to no avail: > > ubthidhci_enable=3D"YES" > ubthidhci_busnum=3D"0" > ubthidhci_addr=3D"5" > > This basically calls usbconfig(8) at system start-up in the following way= : > > /usr/sbin/usbconfig -u 0 -a 5 do_request 0x40 0 0 0 0 > /dev/null 2>&1 > > Running this command manually, I see this output: > > REQUEST =3D > > ...which I've read as potentially being OK, as the operation still may > have successfully completed -- it hasn't :( > > So, has anyone had any luck using this rc.conf(5) directive, or does > anyone on this list have a modified usbconfig(8) command that may help > me coax HCI from this device? Switching device between hid and hci modes is s something that is device / manufacturer specific. It could be that this particular device need different request or something like that. I would suggest to look at linux tool called hid2hci. It has support for different devices from different manufacturers. Thanks, Max