Skip to contentSkip to conversation

Allow disable park state in main.conf

PATCH Bao Liang 1 participant 2 messages Feb 26, 2010 – Mar 5, 2010 Bluetooth drivers

lore
Share & tools
lore

Bao Liang

author
#0 lore raw

Thanks for your comment . The reason I do this is that only park mode makes=
trouble when used by certain models as far as I know . But I'm open to m=
ake this parameter an hex value if it make more sense .

----- =E5=8E=9F=E5=A7=8B=E9=82=AE=E4=BB=B6 ----- =E5=8F=91=E4=BB=B6=E4=BA=BA: Johan Hedberg <[email protected]> =E5=8F=91=E9=80=81=E6=97=B6=E9=97=B4: 2010=E5=B9=B42=E6=9C=8826=E6=97=A5 22= :38
=E6=94=B6=E4=BB=B6=E4=BA=BA: Liang Bao <[email protected]>; marcel@holtmann= .org
=E6=8A=84=E9=80=81: [email protected] =E4=B8=BB=E9=A2=98: Re: [PATCH] Allow disable park state in main.conf

Hi,

Quoted 11 lines · Liang Bao

Currently BlueZ is hard-coding the default link policy to include hold mode, role switch, sniff mode and park state. However, some device will have problem to maintain the connection or setup SCO if they are in park state. Making the park state configurable in main.conf improves flexibility so it can be disabled when needed. =20

---
 src/main.c    |   13 +++++++++----
 src/main.conf |    5 +++++
 2 files changed, 14 insertions(+), 4 deletions(-)

In principle the patch looks ok to me, however we might want to discuss a little bit about the naming of the parameter in the config file and its possible values. E.g. would it make sense to be able to define the link policy more flexibly than just toggling park mode on and off. Marcel, do you have any thoughts on this?

Johan

author
#1 lore raw

We've changed to a hex value as "DefaultLinkPolicy" as following:

src/main.conf +7 -0
index b03e169..196d703 100644
@@ -50,3 +50,10 @@ ReverseServiceDiscovery = true
 # Enable name resolving after inquiry. Set it to 'false' if you don't need
 # remote devices name and want shorter discovery cycle. Defaults to 'true'.
 NameResolving = true
+
+# The link policy for connections. By default it's set to 0x000f which is
+# a bitwise OR of role switch(0x0001), hold mode(0x0002), sniff mode(0x0004)
+# and park state(0x0008) are all enabled. However, some devices have
+# connection stability issue or fail to setup SCO when the link is in park
+# state, which requires park state bit cleared.
+DefaultLinkPolicy = 0x000f

Does this look better? If yes I can re-generate a patch and send in a separate thread.