Skip to contentSkip to conversation

CreateBonding while periodic scanning

PATCH In review Manuel Naranjo 3 participants 6 messages Jul 2, 2008 – Jul 11, 2008 Bluetooth drivers

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 CreateBonding while periodic scanning

Hello everyone,

I've sent this patch before, but for some reason I didn't got either a positive or even negative response.

Problem is like this, when we're doing a periodic scan we should be able to do bonding, but according to the code we can't, so then something is wrong, either we can't do periodic scanning, or we need to fix a bug.

This patch tries to fix this bug, and applies against 3.35.

Thanks,
Manuel Naranjo
Wireless Cables Inc

adapter.c renamed from adapter.c.orig +1 -1
@@ -2792,7 +2792,7 @@
 	str2ba(address, &bdaddr);
 
 	/* check if there is a pending discover: requested by D-Bus/non clients */
-	if (adapter->discov_active || (adapter->pdiscov_active && !adapter->pinq_idle))
+	if (adapter->discov_active)
 		return in_progress(msg, "Discover in progress");
 
 	pending_remote_name_cancel(adapter);

-------------------------------------------------------------------------
Sponsored by: SourceForge.net Community Choice Awards: VOTE NOW! Studies have shown that voting for your favorite open source project, along with a healthy diet, reduces your potential for chronic lameness and boredom. Vote Now at http://www.sourceforge.net/community/cca08

_______________________________________________
Bluez-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bluez-devel

maintainer
#1 lore raw

Hi Manuel,

Quoted 6 lines

I've sent this patch before, but for some reason I didn't got either a positive or even negative response.

Problem is like this, when we're doing a periodic scan we should be able to do bonding, but according to the code we can't, so then something is wrong, either we can't do periodic scanning, or we need to fix a bug.

so in general you should be able to create an ACL link when even in inquiry phase. So in theory it should stop periodic inquiry and then create the ACL link and then continue. We might have hit some chip limitations here and this is why it was there. I removed it since it low risk. No so many applications use periodic inquiry :)

Regards

Marcel

-------------------------------------------------------------------------
Sponsored by: SourceForge.net Community Choice Awards: VOTE NOW! Studies have shown that voting for your favorite open source project, along with a healthy diet, reduces your potential for chronic lameness and boredom. Vote Now at http://www.sourceforge.net/community/cca08
_______________________________________________
Bluez-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bluez-devel

#2 lore raw

Hi Manuel, good to see you mate.

Quoted 7 lines
Quoted 6 lines

I've sent this patch before, but for some reason I didn't got either a positive or even negative response.

Problem is like this, when we're doing a periodic scan we should be able to do bonding, but according to the code we can't, so then something is wrong, either we can't do periodic scanning, or we need to fix a bug.

Quoted 5 lines

so in general you should be able to create an ACL link when even in inquiry phase. So in theory it should stop periodic inquiry and then create the ACL link and then continue. We might have hit some chip limitations here and this is why it was there. I removed it since it low risk. No so many applications use periodic inquiry :)

I've experienced this very same behaviour in the past and was always concerned that it was me using the mainloop inappropriately, I'm glad to see other people find the same issue.

When using period inquiry, it would seem that if I perform any other form of operation, such as an SDP enquiry, or creating an RFCOMM connection it halts the current 'period' of scanning and it doesn't start again until the start of the next 'period'.

This does cause a fair amount of frustration as it means if you're sdping nearby remote device as you find them that you're only ever really dealing with 1 remote device per scan period which is very inefficient.

I've noticed the exact same behaviour with a standard inquiry scan too, as soon as attempting to perform one of these other operations whilst scanning the scan stops and the 'discoverycomplete()' signal is emmited.

Manuel, I'm interested in the patch and will look at applying it to my local working copy to see how it behaves for me.

Marcel, Are you saying that this issue cannot be resolved by a patch and is a chip limitation? Is there likely to be any fix for this?

Marcel, for those of us that need a periodic enquiry, would you advocate the use of our own internal standard inquiry loops that restart a scan when discoverycomplete() signal is emitted? Or is this likely to crash the bluez deamon by putting too much strain on it?

Heston

-------------------------------------------------------------------------
Sponsored by: SourceForge.net Community Choice Awards: VOTE NOW! Studies have shown that voting for your favorite open source project, along with a healthy diet, reduces your potential for chronic lameness and boredom. Vote Now at http://www.sourceforge.net/community/cca08
_______________________________________________
Bluez-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bluez-devel

maintainer
#3 lore raw

Hi Heston,

Quoted 22 lines
Quoted 7 lines
Quoted 6 lines

I've sent this patch before, but for some reason I didn't got either a positive or even negative response.

Problem is like this, when we're doing a periodic scan we should be able to do bonding, but according to the code we can't, so then something is wrong, either we can't do periodic scanning, or we need to fix a bug.

Quoted 5 lines

so in general you should be able to create an ACL link when even in inquiry phase. So in theory it should stop periodic inquiry and then create the ACL link and then continue. We might have hit some chip limitations here and this is why it was there. I removed it since it low risk. No so many applications use periodic inquiry :)

I've experienced this very same behaviour in the past and was always concerned that it was me using the mainloop inappropriately, I'm glad to see other people find the same issue.

When using period inquiry, it would seem that if I perform any other form of operation, such as an SDP enquiry, or creating an RFCOMM connection it halts the current 'period' of scanning and it doesn't start again until the start of the next 'period'.

Quoted 7 lines

This does cause a fair amount of frustration as it means if you're sdping nearby remote device as you find them that you're only ever really dealing with 1 remote device per scan period which is very inefficient.

I've noticed the exact same behaviour with a standard inquiry scan too, as soon as attempting to perform one of these other operations whilst scanning the scan stops and the 'discoverycomplete()' signal is emmited.

with the normal inquiry it is this way. You have to cancel that before you can do anything else. Nothing you can do about it. The periodic inquiry is special since it is meant to cancel itself on connection attempts and then automatically resume.

Quoted 10 lines

Manuel, I'm interested in the patch and will look at applying it to my local working copy to see how it behaves for me.

Marcel, Are you saying that this issue cannot be resolved by a patch and is a chip limitation? Is there likely to be any fix for this?

Marcel, for those of us that need a periodic enquiry, would you advocate the use of our own internal standard inquiry loops that restart a scan when discoverycomplete() signal is emitted? Or is this likely to crash the bluez deamon by putting too much strain on it?

I applied that patch and it will be in bluez-utils-3.36 release.

Regards

Marcel

-------------------------------------------------------------------------
Sponsored by: SourceForge.net Community Choice Awards: VOTE NOW! Studies have shown that voting for your favorite open source project, along with a healthy diet, reduces your potential for chronic lameness and boredom. Vote Now at http://www.sourceforge.net/community/cca08
_______________________________________________
Bluez-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bluez-devel

#4 lore raw

Hi Marcel,

Quoted 4 lines

with the normal inquiry it is this way. You have to cancel that before you can do anything else. Nothing you can do about it. The periodic inquiry is special since it is meant to cancel itself on connection attempts and then automatically resume.

Ok, that's fair enough, at least I know what the score is now. Periodic sounds like my best solution then.

Quoted 1 line

I applied that patch and it will be in bluez-utils-3.36 release.

Excellent stuff.

Cheers Marcel,

Heston

-------------------------------------------------------------------------
Sponsored by: SourceForge.net Community Choice Awards: VOTE NOW! Studies have shown that voting for your favorite open source project, along with a healthy diet, reduces your potential for chronic lameness and boredom. Vote Now at http://www.sourceforge.net/community/cca08
_______________________________________________
Bluez-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bluez-devel

#5 lore raw
In reply to Marcel Holtmann

Hi Marcel,

Quoted 5 lines

with the normal inquiry it is this way. You have to cancel that before you can do anything else. Nothing you can do about it. The periodic inquiry is special since it is meant to cancel itself on connection attempts and then automatically resume.

Periodic scanning is bluetooth chip level right? Not something internal to bluez or I'm totally wrong?.

Anyway it makes sense to stop inquiry while doing connection attempts, not while broadcasting data, because the amount of power used for transmission and the amount of data required for it, it's just too much too keep scanning.

Quoted 2 lines

I applied that patch and it will be in bluez-utils-3.36 release.

Wow thanks, will this finally became the latest release of the 3.X branch? Who knows... hehe

Cheers,
Manuel Naranjo
Wireless Cables Inc.

-------------------------------------------------------------------------
Sponsored by: SourceForge.net Community Choice Awards: VOTE NOW! Studies have shown that voting for your favorite open source project, along with a healthy diet, reduces your potential for chronic lameness and boredom. Vote Now at http://www.sourceforge.net/community/cca08
_______________________________________________
Bluez-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bluez-devel