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; }