* Fwd: Short names on Extended Inquiry Result [not found] <CAGd9gwjaECWWRE+Ux4XenbUO9L-QSsjnP6wLHEvH5q3sasWWkg@mail.gmail.com> @ 2013-05-04 1:14 ` Alex Deymo 2013-05-04 1:55 ` Vinicius Gomes 0 siblings, 1 reply; 4+ messages in thread From: Alex Deymo @ 2013-05-04 1:14 UTC (permalink / raw) To: linux-bluetooth, keybuk Hi again! I'm having a problem while comparing the BlueZ 5 and BlueZ 4 behavior regarding the name/alias of a device during scanning. On BlueZ 4 (at least on 4.99), there was a two steps discovery process. During the first 10 seconds, the adapter will look for new devices, and during the second 30 seconds, it will ask each device for further information. I have here devices like the Monster ClarityHD speakers, or the Creative WP-350 headsets. Those devices announce a short name with the Inquiry Result. btmon reveals a "HCI Event: Extended Inquiry Result" for each one with a short name of 9 chars, respectively "Monster C" and "Creative " (with a space at the end). BlueZ 4 will show this name during the first 10 seconds as the name of the device, but when the adapter goes to the second step, it will issue a "HCI Command: Remote Name Request" and get the full name, like "Creative WP-350 Headset" and update the property on the device, still during discovery. In the other hand, BlueZ 5 will not issue a "Remote Name Request" until you attempt a pairing. This is not the best user experience since no matter how long you leave your scan session on, you will never get the right name of the device, until you attempt a connection or a pairing with it. Even worse, if you had connected to the device before (and you have the long name in the bluez cache for example), if you scan for new devices and this device shows up in that scan, bluez will change the name to the short version. I'm thinking about sending a Remote Name Request to the new devices between the "> HCI Event: Inquiry Complete" and the "< HCI Command: Inquiry". What do you think about this approach? Do you have a better idea to solve this? Thanks, Alex. ^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: Short names on Extended Inquiry Result 2013-05-04 1:14 ` Fwd: Short names on Extended Inquiry Result Alex Deymo @ 2013-05-04 1:55 ` Vinicius Gomes 2013-05-07 3:30 ` Alex Deymo 0 siblings, 1 reply; 4+ messages in thread From: Vinicius Gomes @ 2013-05-04 1:55 UTC (permalink / raw) To: Alex Deymo; +Cc: linux-bluetooth, keybuk Hi Alex, On Fri, May 3, 2013 at 10:14 PM, Alex Deymo <deymo@chromium.org> wrote: > Hi again! > > I'm having a problem while comparing the BlueZ 5 and BlueZ 4 behavior > regarding the name/alias of a device during scanning. > > On BlueZ 4 (at least on 4.99), there was a two steps discovery > process. During the first 10 seconds, the adapter will look for new > devices, and during the second 30 seconds, it will ask each device for > further information. > > I have here devices like the Monster ClarityHD speakers, or the > Creative WP-350 headsets. Those devices announce a short name with the > Inquiry Result. btmon reveals a "HCI Event: Extended Inquiry Result" > for each one with a short name of 9 chars, respectively "Monster C" > and "Creative " (with a space at the end). > > BlueZ 4 will show this name during the first 10 seconds as the name of > the device, but when the adapter goes to the second step, it will > issue a "HCI Command: Remote Name Request" and get the full name, like > "Creative WP-350 Headset" and update the property on the device, still > during discovery. > > In the other hand, BlueZ 5 will not issue a "Remote Name Request" > until you attempt a pairing. This is not the best user experience > since no matter how long you leave your scan session on, you will > never get the right name of the device, until you attempt a connection > or a pairing with it. > > Even worse, if you had connected to the device before (and you have > the long name in the bluez cache for example), if you scan for new > devices and this device shows up in that scan, bluez will change the > name to the short version. > > I'm thinking about sending a Remote Name Request to the new devices > between the "> HCI Event: Inquiry Complete" and the "< HCI Command: > Inquiry". What do you think about this approach? Do you have a better > idea to solve this? I don't know if this is what you already had in mind, but I would start on the userspace side, src/adapter.c:4052 (update_found_devices()), and make it send the confirm name command in the cases that we only have the short name. It should cause the remote name to be requested. > > Thanks, > Alex. > -- > To unsubscribe from this list: send the line "unsubscribe linux-bluetooth" in > the body of a message to majordomo@vger.kernel.org > More majordomo info at http://vger.kernel.org/majordomo-info.html Cheers, -- Vinicius ^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: Short names on Extended Inquiry Result 2013-05-04 1:55 ` Vinicius Gomes @ 2013-05-07 3:30 ` Alex Deymo 2013-05-08 7:26 ` Johan Hedberg 0 siblings, 1 reply; 4+ messages in thread From: Alex Deymo @ 2013-05-07 3:30 UTC (permalink / raw) To: Vinicius Gomes; +Cc: linux-bluetooth, keybuk Hi Vinicius, On Fri, May 3, 2013 at 6:55 PM, Vinicius Gomes <vinicius.gomes@openbossa.org> wrote: > Hi Alex, > > I don't know if this is what you already had in mind, but I would > start on the userspace side, src/adapter.c:4052 > (update_found_devices()), and make it send the confirm name command in > the cases that we only have the short name. It should cause the remote > name to be requested. Thanks for the pointer. I managed to solve the problem of updating the already known long name with the new short name in that function, and after some time debugging between the kernel module and the userland daemon I also found that the problem of the "Remote Name Request" not being sent is because confirm_name() is called with a known_name in TRUE since we already known "a name". I though about several options and finally choose tho consider the short name as an unknown name and thus calling the confirm_name() with known_name in FALSE, but also report the device with the short name, while we ask for the long name. This has the advantage of sending the device found signal earlier, but may have a problem in the following scenario: 1. We have a first call to update_found_devices() with a short name and report it to the user. 2. We request the full name. 3. The device doesn't reply to this request (for any reason) 4. We get a second call to update_found_devices() with a short name... but since we already know "a name" we don't request the long name. To avoid this I think the best should be to include the name_complete field in the struct btd_device together with the name. What do you think? I'm sending a proposed patch with this implementation. Thanks! Alex. ^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: Short names on Extended Inquiry Result 2013-05-07 3:30 ` Alex Deymo @ 2013-05-08 7:26 ` Johan Hedberg 0 siblings, 0 replies; 4+ messages in thread From: Johan Hedberg @ 2013-05-08 7:26 UTC (permalink / raw) To: Alex Deymo; +Cc: Vinicius Gomes, linux-bluetooth, keybuk Hi Alex, On Mon, May 06, 2013, Alex Deymo wrote: > I though about several options and finally choose tho consider the > short name as an unknown name and thus calling the confirm_name() with > known_name in FALSE, but also report the device with the short name, > while we ask for the long name. > > This has the advantage of sending the device found signal earlier, but > may have a problem in the following scenario: > 1. We have a first call to update_found_devices() with a short name > and report it to the user. > 2. We request the full name. > 3. The device doesn't reply to this request (for any reason) > 4. We get a second call to update_found_devices() with a short name... > but since we already know "a name" we don't request the long name. > > To avoid this I think the best should be to include the name_complete > field in the struct btd_device together with the name. What do you > think? I'm not completely sure about this. In theory you could have a (broken or malicious) device with page scan disabled but inquiry scan enabled and such a device would be causing us to block all other baseband activity while we wait for a page timeout to happen each time we request its name. Since we anyway re-request the name when connecting this might not be worth it. Johan ^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2013-05-08 7:26 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <CAGd9gwjaECWWRE+Ux4XenbUO9L-QSsjnP6wLHEvH5q3sasWWkg@mail.gmail.com>
2013-05-04 1:14 ` Fwd: Short names on Extended Inquiry Result Alex Deymo
2013-05-04 1:55 ` Vinicius Gomes
2013-05-07 3:30 ` Alex Deymo
2013-05-08 7:26 ` Johan Hedberg
This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.