From owner-freebsd-bluetooth@FreeBSD.ORG Tue Oct 21 08:57:54 2008 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 27DD01065674 for ; Tue, 21 Oct 2008 08:57:54 +0000 (UTC) (envelope-from mad@madpilot.net) Received: from megatron.madpilot.net (megatron.madpilot.net [88.149.173.206]) by mx1.freebsd.org (Postfix) with ESMTP id D0B5E8FC20 for ; Tue, 21 Oct 2008 08:57:53 +0000 (UTC) (envelope-from mad@madpilot.net) Received: by megatron.madpilot.net (Postfix, from userid 1000) id 9273F130C39; Tue, 21 Oct 2008 10:42:39 +0200 (CEST) Date: Tue, 21 Oct 2008 10:42:39 +0200 From: Guido Falsi To: freebsd-bluetooth@freebsd.org Message-ID: <20081021084239.GA80573@megatron.madpilot.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline X-Operating-System: FreeBSD 7.1-PRERELEASE User-Agent: Mutt/1.5.18 (2008-05-17) Subject: Need help with SDP interface 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 Oct 2008 08:57:54 -0000 Hello, I'm the maintainer of the gnokii port. With the new version the author added some code to automatically find the rfcomm channel to talk with mobiles using AT commands. This function is very BlueZ specific and I'm trying to rewrite it to work with FreeBSD's bluetooth stack. I can't really find some documentation I need about bluetooth, so I thought I could ask for help here. The function as written by Powell Kot (gnokii author) reads out the SDP_ATTR_PRIMARY_LANGUAGE_BASE_ID + SDP_ATTR_SERVICE_NAME_OFFSET attribute of all the RFCOMM enabed profiles, discards some based on this descriptive name and select the first one not being discarded, exctracting the channel attribute. What I can't find is the data structure of the NAME attribute, and hot to read it using the SDP_DATA_* functions. Anyone is willing to help, I think I just need the the pdf or links to documentation. I've checked through the sdpcontrol functions, and got some idea of how things work. I'm also doing a little cut & paste of code, so I wil need permission from Maksim before submitting the code to the gnokii project. Please don't judge me too hard, I'm no C programmer, just a system administrator with some coding abilities :) Thank you in advance. -- Guido Falsi From owner-freebsd-bluetooth@FreeBSD.ORG Tue Oct 21 17:15:29 2008 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 9B5471065680 for ; Tue, 21 Oct 2008 17:15:29 +0000 (UTC) (envelope-from maksim.yevmenkin@gmail.com) Received: from ug-out-1314.google.com (ug-out-1314.google.com [66.249.92.169]) by mx1.freebsd.org (Postfix) with ESMTP id 7EA9B8FC0C for ; Tue, 21 Oct 2008 17:15:25 +0000 (UTC) (envelope-from maksim.yevmenkin@gmail.com) Received: by ug-out-1314.google.com with SMTP id m2so959080uge.39 for ; Tue, 21 Oct 2008 10:15:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to :subject:cc:in-reply-to:mime-version:content-type :content-transfer-encoding:content-disposition:references; bh=Dqk0AemijAU3b/zM59vUR6mMBKC3TULdWJFOVbdADe4=; b=WgWXmdgyBPa/VLU7wgwgYCKQhxxk38+IZpFm53IWg37gVXZ8I+ICYnZ6BtIstpZTcc N84590e0OgyPl3VXuLTwMnjoF7G5PhOfXThOSztChyhZbbExODRdo/OdjlaHQBWOAeAp CjOqRTBw6p5ZbMcnELJQAprVvujKK222t8ve8= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:cc:in-reply-to:mime-version :content-type:content-transfer-encoding:content-disposition :references; b=rCmAOUr7dw5atTy++CEh1LLSyUrsfgPctExOhEoJCjLQCWstufbW8zSK2leyuvvDqY I9wR6sIyLAgzn3B0hHP/X3Yz6UnuBu3sgQhSz9DplYkEdQp2W2pPV0WVKhRJsJd5Zh7j TakMiOOiXx6oXwa9jq+Iq4Pam1NpHszmgjhHE= Received: by 10.86.84.18 with SMTP id h18mr8241203fgb.5.1224609323274; Tue, 21 Oct 2008 10:15:23 -0700 (PDT) Received: by 10.86.84.4 with HTTP; Tue, 21 Oct 2008 10:15:23 -0700 (PDT) Message-ID: Date: Tue, 21 Oct 2008 10:15:23 -0700 From: "Maksim Yevmenkin" To: "Guido Falsi" In-Reply-To: <20081021084239.GA80573@megatron.madpilot.net> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <20081021084239.GA80573@megatron.madpilot.net> Cc: freebsd-bluetooth@freebsd.org Subject: Re: Need help with SDP interface 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 Oct 2008 17:15:29 -0000 On 10/21/08, Guido Falsi wrote: > Hello, I'm the maintainer of the gnokii port. > > With the new version the author added some code to automatically find > the rfcomm channel to talk with mobiles using AT commands. is it looking for serial port service? if so, you can use rfcomm_sppd(1) source code as an example on how to find rfcomm channel number. you can also use sdpcontrol(8) source code to see how it searches/parses sdp record attributes > This function is very BlueZ specific and I'm trying to rewrite it to > work with FreeBSD's bluetooth stack. > > I can't really find some documentation I need about bluetooth, so I > thought I could ask for help here. > > The function as written by Powell Kot (gnokii author) reads out the > SDP_ATTR_PRIMARY_LANGUAGE_BASE_ID + SDP_ATTR_SERVICE_NAME_OFFSET > attribute of all the RFCOMM enabed profiles, discards some based on this > descriptive name and select the first one not being discarded, > exctracting the channel attribute. > > What I can't find is the data structure of the NAME attribute, and hot > to read it using the SDP_DATA_* functions. the data structures for sdp described in the particular bluetooth profile document. > Anyone is willing to help, I think I just need the the pdf or links > to documentation. > > I've checked through the sdpcontrol functions, and got some idea of how > things work. good ;) > I'm also doing a little cut & paste of code, so I wil need permission > from Maksim before submitting the code to the gnokii project. do not need to ;) my code is under bsd license, so everything should be fine as long as you comply with the term of the license thanks, max From owner-freebsd-bluetooth@FreeBSD.ORG Tue Oct 21 20:08:45 2008 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 E49AB1065672 for ; Tue, 21 Oct 2008 20:08:45 +0000 (UTC) (envelope-from plunky@rya-online.net) Received: from post.rya-online.net (post.rya-online.net [195.26.225.220]) by mx1.freebsd.org (Postfix) with ESMTP id AD7DF8FC18 for ; Tue, 21 Oct 2008 20:08:45 +0000 (UTC) (envelope-from plunky@rya-online.net) Received: from rya-online.net (post.rya-online.net [127.0.0.1]) by post.rya-online.net (Postfix) with SMTP id 635721D416D; Tue, 21 Oct 2008 20:34:05 +0100 (BST) Sender: plunky@rya-online.net From: "Iain Hibbert" To: Guido Falsi X-Mailer: Quality Web Email v3.1b, http://netwinsite.com/refw.htm Date: Tue, 21 Oct 2008 19:34:03 GMT Message-id: <48fe2eab.261.35fd.334498095@rya-online.net> Cc: freebsd-bluetooth@freebsd.org Subject: Re: Need help with SDP interface X-BeenThere: freebsd-bluetooth@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: plunky@rya-online.net List-Id: Using Bluetooth in FreeBSD environments List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 21 Oct 2008 20:08:46 -0000 On Tue, 21 Oct 2008, Guido Falsi wrote: > With the new version the author added some code to automatically find > the rfcomm channel to talk with mobiles using AT commands. > > This function is very BlueZ specific and I'm trying to rewrite it to > work with FreeBSD's bluetooth stack. > > I can't really find some documentation I need about bluetooth, so I > thought I could ask for help here. all (most :) documents are at www.bluetooth.com > The function as written by Powell Kot (gnokii author) reads out the > SDP_ATTR_PRIMARY_LANGUAGE_BASE_ID + SDP_ATTR_SERVICE_NAME_OFFSET > attribute of all the RFCOMM enabed profiles, discards some based on this > descriptive name and select the first one not being discarded, > exctracting the channel attribute. What is it looking for (or discarding)? I'm not sure this is the right way to do it.. normally you look for a service class which is a specified number (look for some of these defined in /usr/include/sdp.h) I think you may be looking for 'Serial Port' profile. > What I can't find is the data structure of the NAME attribute, and hot > to read it using the SDP_DATA_* functions. I think it is just a SDP_STRING that you have to parse for that? iain From owner-freebsd-bluetooth@FreeBSD.ORG Tue Oct 21 22:00:13 2008 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 F3C761065683 for ; Tue, 21 Oct 2008 22:00:12 +0000 (UTC) (envelope-from mad@madpilot.net) Received: from megatron.madpilot.net (megatron.madpilot.net [88.149.173.206]) by mx1.freebsd.org (Postfix) with ESMTP id 99E898FC1F for ; Tue, 21 Oct 2008 22:00:12 +0000 (UTC) (envelope-from mad@madpilot.net) Received: from localhost (localhost [127.0.0.1]) by megatron.madpilot.net (Postfix) with ESMTP id 41175130C08; Wed, 22 Oct 2008 00:00:11 +0200 (CEST) X-Virus-Scanned: amavisd-new at madpilot.net Received: from megatron.madpilot.net ([127.0.0.1]) by localhost (megatron.madpilot.net [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id mr8fKHwNYsXR; Wed, 22 Oct 2008 00:00:09 +0200 (CEST) Received: from anakin.madpilot.net (anakin.madpilot.net [172.24.42.10]) by megatron.madpilot.net (Postfix) with ESMTP; Wed, 22 Oct 2008 00:00:09 +0200 (CEST) Message-ID: <48FE50E8.7010701@madpilot.net> Date: Wed, 22 Oct 2008 00:00:08 +0200 From: Guido Falsi User-Agent: Thunderbird 2.0.0.17 (X11/20080927) MIME-Version: 1.0 To: plunky@rya-online.net References: <48fe2eab.261.35fd.334498095@rya-online.net> In-Reply-To: <48fe2eab.261.35fd.334498095@rya-online.net> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: freebsd-bluetooth@freebsd.org Subject: Re: Need help with SDP interface 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 Oct 2008 22:00:13 -0000 Iain Hibbert wrote: > all (most :) documents are at www.bluetooth.com > The site is quite messy, and I get annoyed easily by that kind of website design, so it took a few days worth of tries to get to the docs :P Now I have the relevant PDF, I'll try to make something worth of it. > > What is it looking for (or discarding)? I'm not sure this > is the right > way to do it.. normally you look for a service class which > is a specified > number (look for some of these defined in > /usr/include/sdp.h) I don't like the idea too much either, the problem is that most mobile phones expose a mlot of services, most marked as RFCOMM, some of which are not working in any way or are just used for some proprietary protocoll, so the code discards that kind of crap. For example it is discarding: "Nokia PC Suite" "Bluetooth Serial Port" "m-Router Connectivity" all of which, if present, are marked as rfcomm, but don't take at commands(which the software uses to talk to the phone). I think some better way exists, but I thought it would be easier to clone the existing logic and then refine it, than reinvent it right away. I'd also like to ha ve feedback from the gnokii developer, if my code is ok he could include it in his project too. > > I think you may be looking for 'Serial Port' profile. > >> What I can't find is the data structure of the NAME > attribute, and hot >> to read it using the SDP_DATA_* functions. > > I think it is just a SDP_STRING that you have to parse for > that? Yes, the original code is using strstr() to check them. -- Guido Falsi From owner-freebsd-bluetooth@FreeBSD.ORG Tue Oct 21 22:03:23 2008 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 CBDC21065670 for ; Tue, 21 Oct 2008 22:03:23 +0000 (UTC) (envelope-from mad@madpilot.net) Received: from megatron.madpilot.net (megatron.madpilot.net [88.149.173.206]) by mx1.freebsd.org (Postfix) with ESMTP id 75BB38FC0A for ; Tue, 21 Oct 2008 22:03:23 +0000 (UTC) (envelope-from mad@madpilot.net) Received: from localhost (localhost [127.0.0.1]) by megatron.madpilot.net (Postfix) with ESMTP id 29F9A130C08; Wed, 22 Oct 2008 00:03:22 +0200 (CEST) X-Virus-Scanned: amavisd-new at madpilot.net Received: from megatron.madpilot.net ([127.0.0.1]) by localhost (megatron.madpilot.net [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 5vkNg0Gk4kHr; Wed, 22 Oct 2008 00:03:19 +0200 (CEST) Received: from anakin.madpilot.net (anakin.madpilot.net [172.24.42.10]) by megatron.madpilot.net (Postfix) with ESMTP; Wed, 22 Oct 2008 00:03:19 +0200 (CEST) Message-ID: <48FE51A7.8080400@madpilot.net> Date: Wed, 22 Oct 2008 00:03:19 +0200 From: Guido Falsi User-Agent: Thunderbird 2.0.0.17 (X11/20080927) MIME-Version: 1.0 To: Maksim Yevmenkin References: <20081021084239.GA80573@megatron.madpilot.net> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: freebsd-bluetooth@freebsd.org Subject: Re: Need help with SDP interface 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 Oct 2008 22:03:23 -0000 Maksim Yevmenkin wrote: > is it looking for serial port service? if so, you can use > rfcomm_sppd(1) source code as an example on how to find rfcomm channel > number. > Did not think about it...I'll have a look tomorrow. I'll see if I can get some ideas. >> I'm also doing a little cut & paste of code, so I wil need permission >> from Maksim before submitting the code to the gnokii project. > > do not need to ;) my code is under bsd license, so everything should > be fine as long as you comply with the term of the license > Well, even if the BSD license allows that I like asking anyway. I'll for sure insert a comment pointing to your code and license for what I took. first of all I need something which actually works though :) -- Guido Falsi