From owner-freebsd-bluetooth@FreeBSD.ORG Mon Apr 24 10:06:18 2006 Return-Path: X-Original-To: freebsd-bluetooth@freebsd.org Delivered-To: freebsd-bluetooth@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 8E0DA16A405 for ; Mon, 24 Apr 2006 10:06:18 +0000 (UTC) (envelope-from marcel@holtmann.org) Received: from mail.holtmann.net (coyote.holtmann.net [217.160.111.169]) by mx1.FreeBSD.org (Postfix) with ESMTP id 59E7E43D58 for ; Mon, 24 Apr 2006 10:06:13 +0000 (GMT) (envelope-from marcel@holtmann.org) Received: from blade (p5487D4AA.dip.t-dialin.net [84.135.212.170]) by mail.holtmann.net (8.13.4/8.13.4/Debian-3sarge1) with ESMTP id k3OAC7hp011290 (version=TLSv1/SSLv3 cipher=RC4-MD5 bits=128 verify=NOT); Mon, 24 Apr 2006 12:12:08 +0200 From: Marcel Holtmann To: Carlos =?ISO-8859-1?Q?Fern=E1ndez?= Herranz In-Reply-To: <444C9BBA.4010206@udc.es> References: <4423D096.2010205@udc.es> <44248823.3040907@savvis.net> <44291782.8010003@udc.es> <1143546159.980113.1641.nullmailer@galant.ukfsn.org> <44292470.5020803@udc.es> <1143547703.630752.2338.nullmailer@galant.ukfsn.org> <44294D1D.4010901@udc.es> <1143558548.478651.3242.nullmailer@galant.ukfsn.org> <4447A36C.8070201@udc.es> <4447BB29.906@savvis.net> <444C9BBA.4010206@udc.es> Content-Type: text/plain Date: Mon, 24 Apr 2006 12:07:06 +0200 Message-Id: <1145873226.21987.12.camel@localhost> Mime-Version: 1.0 X-Mailer: Evolution 2.6.1 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=0.3 required=5.0 tests=BAYES_00, DATE_IN_FUTURE_96_XX autolearn=no version=3.0.3 X-Spam-Checker-Version: SpamAssassin 3.0.3 (2005-04-27) on coyote.holtmann.net X-Virus-Scanned: ClamAV 0.84/1423/Mon Apr 24 10:24:11 2006 on coyote.holtmann.net X-Virus-Status: Clean Cc: freebsd-bluetooth@freebsd.org Subject: Re: About Inquiry_with_RSSI 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, 24 Apr 2006 10:06:18 -0000 Hi Carlos, > Firsly, the command packets and constants: > > #define NG_HCI_EVENT_INQUIRY_RESULT_WITH_RSSI 0x22 > > *typedef* *struct* { > u_int8_t num_responses; //* number of responses *// > } __attribute__ ((packed)) ng_hci_inquiry_result_with_rssi_ep; > > *typedef* *struct* { > bdaddr_t bdaddr; > u_int8_t pagescan_rep_mode; > u_int8_t pagescan_period_mode; > u_int8_t uclass[NG_HCI_CLASS_SIZE]; > u_int16_t clock_offset; > char rssi; > } __attribute__ ((packed)) ng_hci_inquiry_response_with_rssi; and don't forget ng_hci_inquiry_response_with_rssi_and_pagescan_mode. There exists buggy Bluetooth 1.2 devices from some companies that also return the pagescan_mode field with this response even if it has been removed from the specification. To differentiate between these two events, you need to check the length of the event and the num_responses. Use BlueZ as a reference on how to do it. Regards Marcel