From owner-freebsd-bluetooth@FreeBSD.ORG Sun Oct 4 04:57:00 2009 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 848B91065670 for ; Sun, 4 Oct 2009 04:57:00 +0000 (UTC) (envelope-from masoom.shaikh@gmail.com) Received: from mail-pz0-f202.google.com (mail-pz0-f202.google.com [209.85.222.202]) by mx1.freebsd.org (Postfix) with ESMTP id 57F1C8FC0A for ; Sun, 4 Oct 2009 04:56:59 +0000 (UTC) Received: by pzk40 with SMTP id 40so2116817pzk.7 for ; Sat, 03 Oct 2009 21:56:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:cc:content-type; bh=AdDP8yBZ1h5x/J4XnoXLFQwMlzvo45q7zAosmM2Wbko=; b=HTbjBE9T+vrv0i0cgNPLlAUFwu/wDahnKQe40VYVUb0G+zHc91vfdGTD6ZD8YTJnW1 ucw8VppxlDog5w9j5n/qLq8NqW2+hMNuIxIxW64AXRhxZXQzMbURfECue+hH0ZtD63nd K8W4hgPn/Q4b0FH66elfpP9yTuTffMFJ27fio= 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; b=fGMfSPO0xymxlYUEMn87diBx+/GkpYQp7HF5JRvF3urruyOfNFwNS1QIRDeJlQK2zW 1qtGeJQcPbEoHE8jQsQzaO5ndgSdgzSIwDNZaWrFPWz76XASIqXsWoC5s07CJqGXnN+m 1n8pO2pqcUuAx1j2fV/SmOaWm9i5SCp8hbf0I= MIME-Version: 1.0 Received: by 10.115.117.39 with SMTP id u39mr6533525wam.116.1254632219680; Sat, 03 Oct 2009 21:56:59 -0700 (PDT) In-Reply-To: <1254600808.002635.1652.nullmailer@galant.ukfsn.org> References: <1254600808.002635.1652.nullmailer@galant.ukfsn.org> Date: Sun, 4 Oct 2009 04:56:59 +0000 Message-ID: From: Masoom Shaikh To: Iain Hibbert Content-Type: text/plain; charset=ISO-8859-1 X-Content-Filtered-By: Mailman/MimeDel 2.1.5 Cc: freebsd-bluetooth@freebsd.org Subject: Re: remote_name_request, using libbluetooth 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: Sun, 04 Oct 2009 04:57:00 -0000 On Sat, Oct 3, 2009 at 8:13 PM, Iain Hibbert wrote: > On Sat, 3 Oct 2009, Masoom Shaikh wrote: > > > Hi, > > > > today i spent ages hacking hccontrol to do something similar it does when > > invoked as below > > > > hccontrol remote_name_request > > > > somehow i couldn't succeed ;-( > > you didn't say exactly the failure you have reached, did you use hcidump > to check the actions? > > > what really i want is to search for devices and request their names > > i have a ruby script which does the same by using hccontrol and > manipulating > > it console output > > but am interested in C version. > > > > pasted below is full source. > > > > #include > > #include > > #include > > #include > > #include > > > > /* > > * removes duplicate entries from result and returns the new size > > * free()'s the original array, result is calloc()ed > > * TODO: implement in a better way > > */ > > int do_uniq( const int size, struct bt_devinquiry** result) > > { > > struct bt_devinquiry* newResult = (struct bt_devinquiry*)calloc( > size, > > sizeof(struct bt_devinquiry)); > > > > struct bt_devinquiry* srcCurr = *result; > > struct bt_devinquiry* dstCurr = newResult; > > > > int count = 0; > > int index = 0; > > for ( ; index < size; ++index) > > { > > int j = 0; > > int found = 0; > > while ( j < count) > > { > > if ( bdaddr_same( &( newResult[j++].bdaddr), &( > > srcCurr->bdaddr))) > > { > > found = 1; > > break; > > } > > } > > > > if ( !found) > > { > > *dstCurr = *srcCurr; > > ++dstCurr; > > ++count; > > } > > ++srcCurr; > > } > > free(*result); > > *result = newResult; > > return count; > > } > > > > int main( int argc, char* argv[]) > > { > > /* search devices */ > > struct bt_devinquiry* result = 0; > > int num = bt_devinquiry( 0, 0, 0, &result); > > if ( num <= 0) > > { > > if ( h_errno) > > what is h_errno? I think these checks are uninvolved with the code at > hand.. > > > herror( "no devices found"); > > else > > printf( "no devices found\n"); > > return num; > > } > > /* remove duplicate entries */ > > num = do_uniq( num, &result); > > printf( "%d device(s) found\n", num); > > also, I don't think the do_uniq() step should be necessary -- we did > discuss it at least and in the version i wrote for NetBSD it doesn't > return duplicate results > > > /* try to query device's name */ > > int s = bt_devopen( "ubt0hci"); > > if ( s == -1) > > { > > if ( h_errno) > > herror( "bt_devopen error\n"); > > else > > printf( "bt_devopen error\n"); > > return -1; > > } > > int i = 0; > > for ( ; i < num; ++i) > > { > > struct bt_devreq request; > > memset( &request, 0, sizeof(request)); > > request.opcode = NG_HCI_OPCODE(NG_HCI_OGF_LINK_CONTROL, > > NG_HCI_OCF_REMOTE_NAME_REQ); > > request.event = NG_HCI_EVENT_REMOTE_NAME_REQ_COMPL; > > > > ng_hci_remote_name_req_cp cp; > > memset(&cp, 0, sizeof(cp)); > > bdaddr_copy( &cp.bdaddr, &result->bdaddr); > > cp.page_scan_rep_mode = NG_HCI_SCAN_REP_MODE0; > > cp.page_scan_mode = NG_HCI_MANDATORY_PAGE_SCAN_MODE; > > request.cparam = (void*)&cp; > > request.clen = sizeof(cp); > > > > char buffer[512]; > > memset( buffer, 0, 512); > > request.rparam = (void*)buffer; > > request.rlen = 512; > > > > int status = bt_devreq( s, &request, 0); > > if ( status == 0) > > { > > ng_hci_event_pkt_t *e = (ng_hci_event_pkt_t*)buffer; > > ng_hci_remote_name_req_compl_ep *ep = > > (ng_hci_remote_name_req_compl_ep*)(e + 1); > > printf( "status: %d\n", ep->status); > > printf( "name: %s\n", ep->name); > > } > > I think your problem might be here. The event header is not returned, only > the remote_name_req_compl_ep event packet.. (I would have used that > directly in the rparam field rather than a separate buffer -- bt_devreq > will not overflow the given space) > > > else if (status == -1) > > { > > if ( h_errno) > > herror( "bt_devreq error\n"); > > else > > printf( "bt_devreq error\n"); > > } > > else > > { > > printf("bt_devreq unknown return value\n"); > > } > > } > > bt_devclose(s); > > return 0; > > } > > iain > > > thanks for replying yes, i did forgot to say where it failed, devices are inquired properly no issues there but bt_devreq() fails with status == -1 comment taken i will remove the separate buffer, thank you again here is the hcidump output HCIDump - HCI packet analyzer ver 1.5 device: any snap_len: 65535 filter: 0xffffffffffffffff < HCI Command: Inquiry(0x01|0x0001) plen 5 > HCI Event: Command Status(0x0f) plen 4 > HCI Event: Inquiry Result(0x02) plen 15 > HCI Event: Inquiry Result(0x02) plen 15 > HCI Event: Inquiry Complete(0x01) plen 1 < HCI Command: Remote Name Request(0x01|0x0019) plen 10 > HCI Event: Command Status(0x0f) plen 4 > HCI Event: Remote Name Req Complete(0x07) plen 255 i guess the last line indicates that we does receive device name but some how bt_devreq() returns fails i will poke around bt_devreq() for clues From owner-freebsd-bluetooth@FreeBSD.ORG Sun Oct 4 14:39:43 2009 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 9A9AA1065676 for ; Sun, 4 Oct 2009 14:39:43 +0000 (UTC) (envelope-from masoom.shaikh@gmail.com) Received: from mail-vw0-f171.google.com (mail-vw0-f171.google.com [209.85.212.171]) by mx1.freebsd.org (Postfix) with ESMTP id 4D2D68FC0C for ; Sun, 4 Oct 2009 14:39:43 +0000 (UTC) Received: by vws1 with SMTP id 1so1483794vws.27 for ; Sun, 04 Oct 2009 07:39:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:cc:content-type; bh=Q7l/rbSd8C9oYx0t1mEsqxhwk9VniZN4kt0b9FLpNAQ=; b=PpSaFYlKtgJWq8sLgZmrM1iy2VB3iKkenQNC34f1cM3AY/UFqUttoJ/g7OZAGw82Ry S5mcxMUa6N5R+weY0vkaYYd9PJm/v8qrMC1oLVC8Arh+7p8tOBIhsazjtIjd4XAZN2iQ 4jQwDuePBYu4mWoFBT9sz1oUehgDpduQlBA/E= 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; b=wq67sFsyQcI5xSmE06UykNnQMLcLIv6SQnny42thUF0P7C5rhoM4oas8E9OS/AaqO/ +PVMVNSLTE6u9d4/JzUn/nc3wH/Gvogi/SMWDy+QzB0eptyPsXmnrzT8UXs71zM/czZr 84axJf/AVt3+Te+tPZtc4CIUbY1COeccbr18M= MIME-Version: 1.0 Received: by 10.220.15.68 with SMTP id j4mr8283707vca.18.1254667182683; Sun, 04 Oct 2009 07:39:42 -0700 (PDT) In-Reply-To: <1254643032.101648.162.nullmailer@galant.ukfsn.org> References: <1254600808.002635.1652.nullmailer@galant.ukfsn.org> <1254643032.101648.162.nullmailer@galant.ukfsn.org> Date: Sun, 4 Oct 2009 14:39:42 +0000 Message-ID: From: Masoom Shaikh To: Iain Hibbert Content-Type: text/plain; charset=ISO-8859-1 X-Content-Filtered-By: Mailman/MimeDel 2.1.5 Cc: freebsd-bluetooth@freebsd.org Subject: Re: remote_name_request, using libbluetooth 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: Sun, 04 Oct 2009 14:39:43 -0000 On Sun, Oct 4, 2009 at 7:57 AM, Iain Hibbert wrote: > On Sun, 4 Oct 2009, Masoom Shaikh wrote: > > > > On Sat, 3 Oct 2009, Masoom Shaikh wrote: > > > > > > > int status = bt_devreq( s, &request, 0); > > > > yes, i did forgot to say where it failed, devices are inquired properly > no > > issues there > > but bt_devreq() fails with status == -1 > > ah, I see.. you should put a non-zero timeout value there (waiting for 0 > seconds will not leave enough time for the response :) > > if you use eg > > if (status == -1) > err(1, "bt_devreq (RemoteNameRequest)") > > then you would see an "Operation timed out" message.. I should think 5 > seconds would be reasonable.. > > regards, > iain > > > u got the bug by neck, and i would have slit its neck by the time this mail is in your inbox ;-) that was the exact error, timeout value of 5 didn't work for me, thus am using 60, and it works thanks Iain From owner-freebsd-bluetooth@FreeBSD.ORG Sun Oct 4 17:42:07 2009 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 5F5771065696 for ; Sun, 4 Oct 2009 17:42:07 +0000 (UTC) (envelope-from masoom.shaikh@gmail.com) Received: from mail-pz0-f201.google.com (mail-pz0-f201.google.com [209.85.222.201]) by mx1.freebsd.org (Postfix) with ESMTP id 3538D8FC08 for ; Sun, 4 Oct 2009 17:42:07 +0000 (UTC) Received: by mail-pz0-f201.google.com with SMTP id 39so424259pzk.15 for ; Sun, 04 Oct 2009 10:42:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type; bh=Zt5PeO8DqqklGx3HBpRoRxs4yk/HLYznX+q/9KjCKJs=; b=XFyOS0L8DIMarMkT/jx6R7Xo+h/3/9kHy+EwnzOQzISDXLt7E0JG9fCfbZTxY1FKvE kFnWYUxcudyAn9jOM458PnVKoQUKF7HXLz8SHm961rxiNXcYdLAYJIY/v0ckl5HGZhWj mGe3SCk08K8ZY74+YN3zJf/qTtowm+D5Ihwms= 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 :content-type; b=DrN7UeP7I5ZZUvaJ953xtKknKWAUkm6AvjwSe+UhSDogGyOhueslrGE8L8iCLEF2Pw +uVUTrnrjTdQmRtxNTNj2kziCtelq+Yog0w7kFS3IrtGoa9ZKkwYL1ElmTXS2hktekFG mSup+MYS8G/MvWGWrS1xLjBOe6LwSU1HJTpuY= MIME-Version: 1.0 Received: by 10.114.188.8 with SMTP id l8mr7461346waf.146.1254678127119; Sun, 04 Oct 2009 10:42:07 -0700 (PDT) In-Reply-To: References: Date: Sun, 4 Oct 2009 17:42:07 +0000 Message-ID: From: Masoom Shaikh To: freebsd-bluetooth@freebsd.org Content-Type: text/plain; charset=ISO-8859-1 X-Content-Filtered-By: Mailman/MimeDel 2.1.5 Subject: bluetooth.h, c++ include error 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: Sun, 04 Oct 2009 17:42:07 -0000 posting here after @current and @questions ignored Hello, while going through bluetooth.h, I observed int bt_devfilter(int s, struct bt_devfilter const *new, struct bt_devfilter *old); this line appears in bluetooth.h @ line # 166, rv197571 see ? the variable named 'new' will cause trouble to c++ source files i honestly believe this is not intentional, c++ programmers will have to perform some acrobats to get past this thanks, Masoom Shaikh From owner-freebsd-bluetooth@FreeBSD.ORG Sun Oct 4 18:26:57 2009 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 50E99106566B for ; Sun, 4 Oct 2009 18:26:57 +0000 (UTC) (envelope-from maksim.yevmenkin@gmail.com) Received: from mail-px0-f192.google.com (mail-px0-f192.google.com [209.85.216.192]) by mx1.freebsd.org (Postfix) with ESMTP id 27AC08FC12 for ; Sun, 4 Oct 2009 18:26:56 +0000 (UTC) Received: by pxi30 with SMTP id 30so3544787pxi.7 for ; Sun, 04 Oct 2009 11:26:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:cc:content-type; bh=oOJS+BCOfKk9uEGzZYuwZcs8ETF+QUEK8kigRqSAXao=; b=cPxEdUAgnpofow5KgkWRLL0Gv4mudyuxhZOqMvyfr7pwgXVerwqznmOMyhrI1IdN+K WPGnz/ToUbU3RSHOkq7A2/kedD58Qm65TtESz0IhbmjT7SlozGwIoLH5lceqCu93ZPB9 87Wxb4zDczOt/oZuwD3I/BmyU7MS770kllz2U= 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; b=YnoFUgmYQ7DYuqJK+WcRnsDPPzrW1PXuAsoYnNkp72dbvuT7Svt3EJ4pXLvZNSWNq5 /EK7vmKjiDUuCM7zM9WC9pwg719erNt3T/TCt54u821UDIeZE0bw/K0vJB8UR+UGFJZD UgxfqN+pce7dleOBNp0l+MCiJ98xvJvUXyUGQ= MIME-Version: 1.0 Received: by 10.115.80.14 with SMTP id h14mr4999608wal.133.1254680816606; Sun, 04 Oct 2009 11:26:56 -0700 (PDT) In-Reply-To: References: Date: Sun, 4 Oct 2009 11:26:56 -0700 Message-ID: From: Maksim Yevmenkin To: Masoom Shaikh Content-Type: text/plain; charset=ISO-8859-1 Cc: freebsd-bluetooth@freebsd.org Subject: Re: bluetooth.h, c++ include error 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: Sun, 04 Oct 2009 18:26:57 -0000 On Sun, Oct 4, 2009 at 10:42 AM, Masoom Shaikh wrote: > posting here after @current and @questions ignored > > Hello, > > while going through bluetooth.h, I observed > > int bt_devfilter(int s, struct bt_devfilter const *new, struct bt_devfilter > *old); > > this line appears in bluetooth.h @ line # 166, rv197571 > > see ? the variable named 'new' will cause trouble to c++ source files > i honestly believe this is not intentional, c++ programmers will have to > perform some acrobats to get past this patches are welcome thanks, max From owner-freebsd-bluetooth@FreeBSD.ORG Mon Oct 5 16:58:12 2009 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 5BFB41065788 for ; Mon, 5 Oct 2009 16:58:12 +0000 (UTC) (envelope-from masoom.shaikh@gmail.com) Received: from mail-pz0-f202.google.com (mail-pz0-f202.google.com [209.85.222.202]) by mx1.freebsd.org (Postfix) with ESMTP id 2D82F8FC17 for ; Mon, 5 Oct 2009 16:58:11 +0000 (UTC) Received: by pzk40 with SMTP id 40so3234033pzk.7 for ; Mon, 05 Oct 2009 09:58:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:cc:content-type; bh=4FSS5VA9IBw1DeYSt9+I2pHJoKtz+tDqZg+A7SQsCRo=; b=r3JLoO/y0EbjFs3z/65K27h3e6i5CZf/OOHmBZLssfC9X1tjK6TEgrxA0rvpvMd0gQ F1eqAjtv0GYQEQ9yiQoxpO2OVTVR/QV5z2jPWKPezlb0cAubx2iTCS+pphKhrohf0lbj e1dY7eU18J8i6k+vxbXwTqt81tm7CEAd6wbaA= 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; b=l0XEy+9GLVkYJHFSGpc3ZPscguiEtapiaElkwVfT0/Zyvv9SOWb/G3g1T0/FAOtB8B QgjPfcs2v//nPWcwUEbyr+XljDs0xk8LiLNT7tDjHul6DxFJzutEcsw0os5z3C+QQJJW 2aX1hyynPLl95ej0VeiGg/2ZzqWAmxNPlI/CU= MIME-Version: 1.0 Received: by 10.114.2.34 with SMTP id 34mr341643wab.213.1254761890833; Mon, 05 Oct 2009 09:58:10 -0700 (PDT) In-Reply-To: References: Date: Mon, 5 Oct 2009 16:58:10 +0000 Message-ID: From: Masoom Shaikh To: Maksim Yevmenkin Content-Type: text/plain; charset=ISO-8859-1 X-Content-Filtered-By: Mailman/MimeDel 2.1.5 Cc: freebsd-bluetooth@freebsd.org Subject: Re: bluetooth.h, c++ include error 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: Mon, 05 Oct 2009 16:58:12 -0000 On Sun, Oct 4, 2009 at 6:26 PM, Maksim Yevmenkin wrote: > On Sun, Oct 4, 2009 at 10:42 AM, Masoom Shaikh > wrote: > > posting here after @current and @questions ignored > > > > Hello, > > > > while going through bluetooth.h, I observed > > > > int bt_devfilter(int s, struct bt_devfilter const *new, struct > bt_devfilter > > *old); > > > > this line appears in bluetooth.h @ line # 166, rv197571 > > > > see ? the variable named 'new' will cause trouble to c++ source files > > i honestly believe this is not intentional, c++ programmers will have to > > perform some acrobats to get past this > > > patches are welcome > > thanks, > max > what i am requesting is just variable name change ;-) my tree is at revision 197571, thus the patch i am presenting is also generated against it reject this if you want patch against latest revision renamed second argument of bt_devfilter() from 'new' to 'dfnew'. df for device filter to maintain uniformity renamed third argument from 'old' to 'dfold'. the patch follows Index: bluetooth.h =================================================================== --- bluetooth.h (revision 197571) +++ bluetooth.h (working copy) @@ -28,7 +28,7 @@ * SUCH DAMAGE. * * $Id: bluetooth.h,v 1.5 2003/09/14 23:28:42 max Exp $ - * $FreeBSD$ + * $FreeBSD: stable/8/lib/libbluetooth/bluetooth.h 191388 2009-04-22 15:50:03Z emax $ */ #ifndef _BLUETOOTH_H_ @@ -163,8 +163,8 @@ int bt_devsend (int s, uint16_t opcode, void *param, size_t plen); ssize_t bt_devrecv (int s, void *buf, size_t size, time_t to); int bt_devreq (int s, struct bt_devreq *r, time_t to); -int bt_devfilter(int s, struct bt_devfilter const *new, - struct bt_devfilter *old); +int bt_devfilter(int s, struct bt_devfilter const *dfnew, + struct bt_devfilter *dfold); void bt_devfilter_pkt_set(struct bt_devfilter *filter, uint8_t type); void bt_devfilter_pkt_clr(struct bt_devfilter *filter, uint8_t type); int bt_devfilter_pkt_tst(struct bt_devfilter const *filter, uint8_t type); From owner-freebsd-bluetooth@FreeBSD.ORG Mon Oct 5 17:25:25 2009 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 C82641065696 for ; Mon, 5 Oct 2009 17:25:25 +0000 (UTC) (envelope-from plunky@rya-online.net) Received: from smtp6.freeserve.com (smtp5.freeserve.com [193.252.22.151]) by mx1.freebsd.org (Postfix) with ESMTP id 84D9C8FC1A for ; Mon, 5 Oct 2009 17:25:25 +0000 (UTC) Received: from me-wanadoo.net (localhost [127.0.0.1]) by mwinf3537.me.freeserve.com (SMTP Server) with ESMTP id B57EB1C00088; Mon, 5 Oct 2009 19:25:23 +0200 (CEST) Received: from me-wanadoo.net (localhost [127.0.0.1]) by mwinf3537.me.freeserve.com (SMTP Server) with ESMTP id A80F81C00089; Mon, 5 Oct 2009 19:25:23 +0200 (CEST) Received: from rya-online.net (unknown [89.194.138.132]) by mwinf3537.me.freeserve.com (SMTP Server) with SMTP id C7AAA1C00088; Mon, 5 Oct 2009 19:25:22 +0200 (CEST) X-ME-UUID: 20091005172522817.C7AAA1C00088@mwinf3537.me.freeserve.com Received: (nullmailer pid 629 invoked by uid 1000); Mon, 05 Oct 2009 17:26:37 -0000 Date: Mon, 5 Oct 2009 18:26:37 +0100 (BST) To: Masoom Shaikh In-Reply-To: References: User-Agent: Alpine 2.00 (NEB 1167 2008-08-23) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Message-Id: <1254763597.419838.805.nullmailer@galant.ukfsn.org> From: Iain Hibbert Cc: freebsd-bluetooth@freebsd.org Subject: Re: bluetooth.h, c++ include error 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: Mon, 05 Oct 2009 17:25:25 -0000 On Mon, 5 Oct 2009, Masoom Shaikh wrote: > what i am requesting is just variable name change ;-) my tree is at > revision 197571, thus the patch i am presenting is also generated > against it reject this if you want patch against latest revision > > renamed second argument of bt_devfilter() from 'new' to 'dfnew'. df for > device filter to maintain uniformity renamed third argument from 'old' > to 'dfold'. style(9) mentions that for kernel include files exposed to userland (technically, this is always in userland but perhaps the same rules apply) the prototype tag arguments should be made safe, eg starting with a _ perhaps for much this reason.. so, my suggestion would be to use _new and _old etc.. iain (or, just don't use them, they are not especially required :) From owner-freebsd-bluetooth@FreeBSD.ORG Tue Oct 6 15:48:04 2009 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 8CF901065679 for ; Tue, 6 Oct 2009 15:48:04 +0000 (UTC) (envelope-from masoom.shaikh@gmail.com) Received: from mail-pz0-f185.google.com (mail-pz0-f185.google.com [209.85.222.185]) by mx1.freebsd.org (Postfix) with ESMTP id 5D3AD8FC14 for ; Tue, 6 Oct 2009 15:48:04 +0000 (UTC) Received: by pzk15 with SMTP id 15so3606329pzk.3 for ; Tue, 06 Oct 2009 08:48:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:cc:content-type; bh=Eg4ZAM5/B//wayCPJQFR2x2jZi7YwOsMzgwCdGEC48U=; b=I5zeuOd2JGihSdV0NL/F2yPhukDfStraBbomXlMbuyJQcaYbiir3S13sbLwNdcaa17 qADxaZjqhzfV+3WZKUsiaujFTluqulQ4qo/RxLjHZkMw+Hnqj9Xxmjxk3LVeZIXLLiFC jKTN+SBW0K9WI0GCiJ4ef6zrIr9ksKLgdeb4w= 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; b=uADqpCucKojUdZkdSYxNCx0SQa4pIdN0VabaoJulCfzH6g2bHsOmrTUBgfjyqVH2Qc ERmyIqB+qytzcUfMKnBq/SR9MX0Ufb4iZ7x6Yu9ZIvDeZnrQXtgKt0jj28/iarGN2DvO uM17lXxaxbEC0zuWR6tXH9jka93ighQpLVQUw= MIME-Version: 1.0 Received: by 10.115.100.14 with SMTP id c14mr2509015wam.219.1254844082992; Tue, 06 Oct 2009 08:48:02 -0700 (PDT) In-Reply-To: <1254763597.419838.805.nullmailer@galant.ukfsn.org> References: <1254763597.419838.805.nullmailer@galant.ukfsn.org> Date: Tue, 6 Oct 2009 15:48:02 +0000 Message-ID: From: Masoom Shaikh To: Iain Hibbert Content-Type: text/plain; charset=ISO-8859-1 X-Content-Filtered-By: Mailman/MimeDel 2.1.5 Cc: freebsd-bluetooth@freebsd.org Subject: Re: bluetooth.h, c++ include error 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, 06 Oct 2009 15:48:04 -0000 On Mon, Oct 5, 2009 at 5:26 PM, Iain Hibbert wrote: > On Mon, 5 Oct 2009, Masoom Shaikh wrote: > > > what i am requesting is just variable name change ;-) my tree is at > > revision 197571, thus the patch i am presenting is also generated > > against it reject this if you want patch against latest revision > > > > renamed second argument of bt_devfilter() from 'new' to 'dfnew'. df for > > device filter to maintain uniformity renamed third argument from 'old' > > to 'dfold'. > > style(9) mentions that for kernel include files exposed to userland > (technically, this is always in userland but perhaps the same rules apply) > the prototype tag arguments should be made safe, eg starting with a _ > perhaps for much this reason.. > > so, my suggestion would be to use _new and _old etc.. > > iain > > (or, just don't use them, they are not especially required :) > > > > > so this shall work i just renamed bt_devfilter() variable names, because it was the one which caused trouble will someone commit this ? Index: bluetooth.h =================================================================== --- bluetooth.h (revision 197804) +++ bluetooth.h (working copy) @@ -163,8 +163,8 @@ int bt_devsend (int s, uint16_t opcode, void *param, size_t plen); ssize_t bt_devrecv (int s, void *buf, size_t size, time_t to); int bt_devreq (int s, struct bt_devreq *r, time_t to); -int bt_devfilter(int s, struct bt_devfilter const *new, - struct bt_devfilter *old); +int bt_devfilter(int s, struct bt_devfilter const *_new, + struct bt_devfilter *_old); void bt_devfilter_pkt_set(struct bt_devfilter *filter, uint8_t type); void bt_devfilter_pkt_clr(struct bt_devfilter *filter, uint8_t type); int bt_devfilter_pkt_tst(struct bt_devfilter const *filter, uint8_t type);