Skip to contentSkip to conversation

mystic AT-Command

Bluez-devel Sebastian Roth 4 participants 9 messages Feb 18, 2005 – Feb 21, 2005 Bluetooth drivers

lore
Share & tools
lore
#0 lore raw

Hi,

one of my bluetooth headsets has the talent to send back "AT+BVRA=1" just about one second after it has connected (pressing the button sends "AT+CKPD=200"). Because of this the SCO connection is canceled immediately.
Why is this behavior programmed into btsco?

Best regards,
Sebastian

-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users. Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
_______________________________________________
Bluez-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bluez-devel

#1 lore raw

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Looks like the wrong channel is selected.

Try enforcing another channel number by adding it after the bt address, i.e.

btsco <btaddr> 2

you can find out the channel numbers your headset provides using the usual hcitools. I forgot what tool, though... %)

hope this helps,
~ Lars

Sebastian Roth wrote:

| Hi,
|
| one of my bluetooth headsets has the talent to send back "AT+BVRA=1"
| just about one second after it has connected (pressing the button sends
| "AT+CKPD=200"). Because of this the SCO connection is canceled
| immediately.
| Why is this behavior programmed into btsco?
|
| Best regards,
| Sebastian
|
|
|
| -------------------------------------------------------
| SF email is sponsored by - The IT Product Guide
| Read honest & candid reviews on hundreds of IT Products from real users.
| Discover which products truly live up to the hype. Start reading now.
| http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
| _______________________________________________
| Bluez-devel mailing list
| [email protected]
| https://lists.sourceforge.net/lists/listinfo/bluez-devel
|

- --
Lars Grunewaldt
* software development
* multimedia design
skills: C/C++/Java/PHP/(X)HTML/Flash/audio/video
web: http://www.dark-reality.de
mail: [email protected]
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.3 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org

iD8DBQFCFfxKQWC6DTWkDAoRAshsAJwMt/k+c7vzCAZwXisyVNGDSzP8bwCghorF oeoqjN/H5G8F9ZJbwlLz26I=
=SGS+
-----END PGP SIGNATURE-----

-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users. Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
_______________________________________________
Bluez-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bluez-devel

#2 lore raw

Hi Lars,

thanks for your answer!

Quoted 1 line

Looks like the wrong channel is selected.

Can't imagine why this can be a problem with the RFCOMM channel. But let's give it a try!

# sdptool search --bdaddr 00:0B:2E:02:03:A2 0x1108
Class 0x1108
Searching for 0x1108 on 00:0B:2E:02:03:A2 ...
Service Name: Headset
Service RecHandle: 0x20000
Service Class ID List:
  "Headset" (0x1108)
  "Generic Audio" (0x1203)
Protocol Descriptor List:
  "L2CAP" (0x0100)
  "RFCOMM" (0x0003)
    Channel: 6
Language Base Attr List:
  code_ISO639: 0x656e
  encoding:    0x6a
  base_offset: 0x100

If I do not specify a channel to btsco it uses 6.
I tried to add channels to the commandline. It connects with channel 1 or 2. But if I tried to establish the SCO channel pressing the button the headset continuosly peeps, no SCO connection!

Best regards,
Sebastian

-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users. Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
_______________________________________________
Bluez-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bluez-devel

#3 lore raw

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Channel 6 seems to be OK for your headset, but the AT command that is send back is wrong, as far as I understood the SCO control channel.

the check in btsco.c for AT+BVRA=1 was only added because I had no understanding why my headset sometimes used this, and sometimes the expected AT+CKPD=200 - it was because btsco sometimes used the wrong channel. Now this should not happen any more as we have (hopefully) proper channel auto-detection.

You can try to remove AT+BVRA=1 from btsco.c:

484:

					if (strstr(buf, "AT+BVRA=")
					    || strstr(buf, "AT+CKPD=200")
					    || strstr(buf, "AT+CHUP")
					    || strstr(buf, "AT+CIND=?")) {

===
448:

					if (strstr(buf, "AT+CKPD=200")
					    || strstr(buf, "AT+CHUP")
					    || strstr(buf, "AT+CIND=?")) {

best regards,
~ Lars

Sebastian Roth wrote:

| Hi Lars,
|
| thanks for your answer!
|
|> Looks like the wrong channel is selected.
|
| Can't imagine why this can be a problem with the RFCOMM channel. But
| let's give it a try!
|
|
| # sdptool search --bdaddr 00:0B:2E:02:03:A2 0x1108
| Class 0x1108
| Searching for 0x1108 on 00:0B:2E:02:03:A2 ...
| Service Name: Headset
| Service RecHandle: 0x20000
| Service Class ID List:
|   "Headset" (0x1108)
|   "Generic Audio" (0x1203)
| Protocol Descriptor List:
|   "L2CAP" (0x0100)
|   "RFCOMM" (0x0003)
|     Channel: 6
| Language Base Attr List:
|   code_ISO639: 0x656e
|   encoding:    0x6a
|   base_offset: 0x100
|
| If I do not specify a channel to btsco it uses 6.
| I tried to add channels to the commandline. It connects with channel 1
| or 2. But if I tried to establish the SCO channel pressing the button
| the headset continuosly peeps, no SCO connection!
|
| Best regards,
| Sebastian
|
|
|
| -------------------------------------------------------
| SF email is sponsored by - The IT Product Guide
| Read honest & candid reviews on hundreds of IT Products from real users.
| Discover which products truly live up to the hype. Start reading now.
| http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
| _______________________________________________
| Bluez-devel mailing list
| [email protected]
| https://lists.sourceforge.net/lists/listinfo/bluez-devel
|

- --
Lars Grunewaldt
* software development
* multimedia design
skills: C/C++/Java/PHP/(X)HTML/Flash/audio/video
web: http://www.dark-reality.de
mail: [email protected]
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.3 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org

iD8DBQFCFhzGQWC6DTWkDAoRAi25AJ4sCLjgNSG9TrnVRz9OYX+u/c/FzQCcCUMu h/sO1UsKk7JE6i64M3RP2SE=
=aARN
-----END PGP SIGNATURE-----

-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users. Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
_______________________________________________
Bluez-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bluez-devel

#4 lore raw

Hi Lars,

google shows me that this AT command enables/disables voice recognition. So I think this behavior of the headset isn't wrong in principle. What do you think?

Quoted 5 lines

the check in btsco.c for AT+BVRA=1 was only added because I had no understanding why my headset sometimes used this, and sometimes the expected AT+CKPD=200 - it was because btsco sometimes used the wrong channel. Now this should not happen any more as we have (hopefully) proper channel auto-detection.

Thanks, this explains the check!

Quoted 1 line

You can try to remove AT+BVRA=1 from btsco.c:

Have done this already and it works! When initially asking this my idea was to have this change merged into the cvs.

Thanks for your great help.

Best regards,
Sebastian

-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users. Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
_______________________________________________
Bluez-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bluez-devel

#5 lore raw

Sebastian,

Quoted 3 lines
Quoted 1 line

You can try to remove AT+BVRA=1 from btsco.c:

Have done this already and it works! When initially asking this my idea was to have this change merged into the cvs.

ok, I made this change in cvs.

Brad

-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users. Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
_______________________________________________
Bluez-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bluez-devel

#6 lore raw

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

should be OK, because as I explained it was a misunderstanding of the BT docs by me.

best regards,
~ Lars

Brad Midgley wrote:

| Sebastian,
|
|>  > You can try to remove AT+BVRA=1 from btsco.c:
|> Have done this already and it works! When initially asking this my idea
|> was to have this change merged into the cvs.
|
|
| ok, I made this change in cvs.
|
| Brad
|
|
| -------------------------------------------------------
| SF email is sponsored by - The IT Product Guide
| Read honest & candid reviews on hundreds of IT Products from real users.
| Discover which products truly live up to the hype. Start reading now.
| http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
| _______________________________________________
| Bluez-devel mailing list
| [email protected]
| https://lists.sourceforge.net/lists/listinfo/bluez-devel
|

- --
Lars Grunewaldt
* software development
* multimedia design
skills: C/C++/Java/PHP/(X)HTML/Flash/audio/video
web: http://www.dark-reality.de
mail: [email protected]
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.3 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org

iD8DBQFCF/NRQWC6DTWkDAoRAn5tAKCb+/uiFaXhdxK6E5yd5mEXZJgglwCfRVyg uptdsIN6DV0qABtn5OvLD1A=
=/ORe
-----END PGP SIGNATURE-----

-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users. Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
_______________________________________________
Bluez-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bluez-devel

#7 lore raw
In reply to Brad Midgley

Hi Brad,

Quoted 1 line

ok, I made this change in cvs.

Thank you!

Can you please merge this in btsco2 too.

btsco2.c 21 Feb 2005 08:15:25 -0000 renamed from btsco2.c 1 Dec 2004 12:02:58 -0000 1.1 +3 -4
diff -u -r1.1 btsco2.c
@@ -387,10 +387,9 @@
                return 0;
        buf [rlen] = 0;
        fprintf(stderr, "recieved %s\n", buf);
-       if (strstr(buf, "AT+BVRA="   )) opdone = headset_button(headset);
-       else if (strstr(buf, "AT+CKPD=200")) opdone = headset_button(headset);
-       else if (strstr(buf, "AT+CHUP"    )) opdone = headset_button(headset);
-       else if (strstr(buf, "AT+CIND=?"  )) opdone = headset_button(headset);
+       if (strstr(buf, "AT+CKPD=200"   )) opdone = headset_button(headset);
+       else if (strstr(buf, "AT+CHUP"  )) opdone = headset_button(headset);
+       else if (strstr(buf, "AT+CIND=?")) opdone = headset_button(headset);
        else if (sscanf (buf, "AT+VGS=%d", &headset->volumes[0]) == 1) 
opdone = headset_speaker (headset);
        else if (sscanf (buf, "AT+VGM=%d", &headset->volumes[1]) == 1) 
opdone = headset_micro   (headset);
        if (opdone == 1)

Best regards,
Sebastian

-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users. Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
_______________________________________________
Bluez-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bluez-devel

#8 lore raw

Sebastian

I fixed btsco2 also.

Brad

Quoted 34 lines

Can you please merge this in btsco2 too.

diff -u -r1.1 btsco2.c

btsco2.c 21 Feb 2005 08:15:25 -0000 renamed from btsco2.c 1 Dec 2004 12:02:58 -0000 1.1 +1 -4
@@ -387,10 +387,9 @@
                return 0;
        buf [rlen] = 0;
        fprintf(stderr, "recieved %s\n", buf);
-       if (strstr(buf, "AT+BVRA="   )) opdone = headset_button(headset);
-       else if (strstr(buf, "AT+CKPD=200")) opdone = 
 headset_button(headset);
-       else if (strstr(buf, "AT+CHUP"    )) opdone = 
 headset_button(headset);
-       else if (strstr(buf, "AT+CIND=?"  )) opdone = 
 headset_button(headset);
+       if (strstr(buf, "AT+CKPD=200"   )) opdone = 

headset_button(headset);
+ else if (strstr(buf, "AT+CHUP" )) opdone =
headset_button(headset);
+ else if (strstr(buf, "AT+CIND=?")) opdone =

headset_button(headset);
        else if (sscanf (buf, "AT+VGS=%d", &headset->volumes[0]) == 1) 
opdone = headset_speaker (headset);
        else if (sscanf (buf, "AT+VGM=%d", &headset->volumes[1]) == 1) 
opdone = headset_micro   (headset);
        if (opdone == 1)

Best regards,
Sebastian

Quoted 9 lines

-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users. Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
_______________________________________________
Bluez-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bluez-devel

-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users. Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
_______________________________________________
Bluez-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bluez-devel