Return-Path: MIME-Version: 1.0 In-Reply-To: <4D385855.2050709@iam.unibe.ch> References: <4D385855.2050709@iam.unibe.ch> Date: Fri, 21 Jan 2011 01:58:44 -0300 Message-ID: Subject: Re: Problem with inquiry result with rssi From: Vinicius Gomes To: =?UTF-8?Q?Ulrich_B=C3=BCrgi?= Cc: linux-bluetooth@vger.kernel.org Content-Type: text/plain; charset=UTF-8 Sender: linux-bluetooth-owner@vger.kernel.org List-ID: SGkgVWxyaWNoLAoKT24gVGh1LCBKYW4gMjAsIDIwMTEgYXQgMTI6NDQgUE0sIFVscmljaCBCw7xy Z2kgPGJ1ZXJnaUBpYW0udW5pYmUuY2g+IHdyb3RlOgo+IEhlbGxvIGV2ZXJ5b25lLAo+Cj4gSSdt IGVuY291bnRlcmluZyBhIHN0cmFuZ2UgYmVoYXZpb3IgcmVnYXJkaW5nIGlucXVpcnkgcmVzdWx0 cy4gSSdtIHdvcmtpbmcKPiBvbiBhIEMgcHJvZ3JhbSwgd2hpY2ggaGFzIGEgbWV0aG9kIGNhbGxl ZCAnc2Nhbm5lcl9zdGFydCcuIFRoaXMgbWV0aG9kCj4gcGVyZm9ybXMgYW4gaW5xdWlyeSBhbmQg cmVwb3J0cyB0aGUgY29ycmVzcG9uZGluZyBhZGRyZXNzZXMgYW5kIFJTU0kgdmFsdWVzCj4gb2Yg YWxsIHJlc3VsdHMuCj4gV2hlbiBJIGp1c3QgY2FsbCB0aGlzIG1ldGhvZCBhbmQgZG8gbm90aGlu ZyBlbHNlLCBpdCB3b3JrcyBhcyBpbnRlbmRlZC4KPiBIb3dldmVyLCBpZiBJIGRvIGFueXRoaW5n IHByaW9yIHRvIHRoYXQsIEkgb25seSBnZXQgJ25vcm1hbCcgaW5xdWlyeSByZXN1bHRzCj4gd2l0 aG91dCBSU1NJLgo+Cj4gQXMgZXhhbXBsZSwgdGhpcyB3b3JrczoKPiAvKiBkbyBub3RoaW5nIGhl cmUgKi8KPiBzY2FubmVyX3N0YXJ0KCk7Cj4gL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