Skip to contentSkip to conversation

At commands not available

Bluez-devel Dirk Vanden Boer 4 participants 8 messages Jul 16, 2005 – Jul 19, 2005 Bluetooth drivers

lore
Share & tools
lore
#0 lore raw

Hi,
I'm trying to send AT commands to my mobile phone using an rfcomm connection. The connection seems to work because I can exectute some commands (like manufacturer name). But a whole bunch of commands are not available (eg. battery charge: "AT+CBC\r" returns ERROR). I can run the AT* command which lists the available commands but a lot of common commands are not in the list. Could it be that there is something wrong with my connection?

Minimilistic testing code:
//necessary includes
#include ...

#define BTADDR "00:0E:07:2D:85:C7"
#define CHANNEL 4
#define BUFSIZE 1024

using namespace std;
string ATCommand(int sock, string atcmd);

int main()
{
=09int sock;
=09struct sockaddr_rc laddr, raddr;
=09struct hci_dev_info di;
=09=09
=09if(hci_devinfo(0, &di) < 0) {
=09=09perror("HCI device info failed"); exit(1);
=09}
=09
=09laddr.rc_family =3D AF_BLUETOOTH;
=09laddr.rc_bdaddr =3D di.bdaddr;
=09laddr.rc_channel =3D 0;
=09
=09raddr.rc_family =3D AF_BLUETOOTH; =09str2ba(BTADDR,&raddr.rc_bdaddr);
=09raddr.rc_channel =3D htobs(CHANNEL);
=09
=09if((sock =3D socket(AF_BLUETOOTH, SOCK_STREAM, BTPROTO_RFCOMM)) < 0) { =09=09perror("socket"); exit(1);
=09}
=09if(bind(sock, (struct sockaddr *)&laddr, sizeof(laddr)) < 0) { =09=09perror("bind"); exit(1);
=09}
=09if(connect(sock, (struct sockaddr *)&raddr, sizeof(raddr)) < 0) { =09=09perror("connect"); exit(1);
=09}
=09
=09cout << "Response:\n" << ATCommand(sock, "AT+CBC\r");
=09
=09close (sock);
=09return 0;
}

string ATCommand(int sock, string atcmd)
{
=09char buf[BUFSIZE];
=09int nbytes;
=09string response =3D "";
=09
=09if(send(sock, atcmd.c_str(), atcmd.length(), 0) =3D=3D -1){ =09=09perror("send"); exit(1);
=09}
=09
=09for(;;)
=09{
=09=09if((nbytes =3D recv(sock, buf, sizeof (buf), 0)) > 0) =09=09{
=09=09=09response.append(buf);
=09=09=09if (strstr(buf, "\r\nOK") !=3D NULL) =09=09=09=09break;
=09=09=09if (strstr(buf, "\r\nERROR") !=3D NULL) =09=09=09=09break;
=09=09}
=09}
=09return response;
}

results in:
AT+CBC
ERROR

Did I forget something that activates the extra commands?

Thanks in advance,
Dirk

-------------------------------------------------------
SF.Net email is sponsored by: Discover Easy Linux Migration Strategies from IBM. Find simple to follow Roadmaps, straightforward articles, informative Webcasts and more! Get everything you need to get up to speed, fast. http://ads.osdn.com/?ad_id=7477&alloc_id=16492&op=click
_______________________________________________
Bluez-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bluez-devel

#1 lore raw
Quoted 8 lines · Dirk Vanden Boer

Hi,
I'm trying to send AT commands to my mobile phone using an rfcomm connection. The connection seems to work because I can exectute some commands (like manufacturer name). But a whole bunch of commands are not available (eg. battery charge: "AT+CBC\r" returns ERROR). I can run the AT* command which lists the available commands but a lot of common commands are not in the list. Could it be that there is something wrong with my connection?

Are you sure that this command should be supported at all? If you are connecting to the handsfree service, then the phone probably does not have to support it. At least I can't find +CBC in the handsfree spec. Phones are free to support additional commands though, or at least they do support more in practice. It works with a Nokia 6230 for instance, without any special initialization.

Fred

Signature · 13 lines
Fred Schaettgen
[email protected]


-------------------------------------------------------
SF.Net email is sponsored by: Discover Easy Linux Migration Strategies
from IBM. Find simple to follow Roadmaps, straightforward articles,
informative Webcasts and more! Get everything you need to get up to
speed, fast. http://ads.osdn.com/?ad_id=7477&alloc_id=16492&op=click
_______________________________________________
Bluez-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bluez-devel
#2 lore raw
Quoted 9 lines · Fred Schaettgen
Quoted 8 lines · Dirk Vanden Boer

Hi,
I'm trying to send AT commands to my mobile phone using an rfcomm connection. The connection seems to work because I can exectute some commands (like manufacturer name). But a whole bunch of commands are not available (eg. battery charge: "AT+CBC\r" returns ERROR). I can run the AT* command which lists the available commands but a lot of common commands are not in the list. Could it be that there is something wrong with my connection?

Quoted 3 lines

=20
Are you sure that this command should be supported at all? If you are connecting to the handsfree service, then the phone probably does not hav=

e to

Quoted 1 line

support it. At least I can't find +CBC in the handsfree spec. Phones are =

free

Quoted 1 line

to support additional commands though, or at least they do support more i=

n

Quoted 4 lines

practice. It works with a Nokia 6230 for instance, without any special initialization.
=20
Fred

The CBC command is listed in the developers guidelines document of the ericsson t68 phone, so I guess it should be available.

Dirk

-------------------------------------------------------
SF.Net email is sponsored by: Discover Easy Linux Migration Strategies from IBM. Find simple to follow Roadmaps, straightforward articles, informative Webcasts and more! Get everything you need to get up to speed, fast. http://ads.osdn.com/?ad_id=7477&alloc_id=16492&op=click
_______________________________________________
Bluez-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bluez-devel

#3 lore raw

Hi Dirk,

which service you are connecting to ??? If you connect to the wrong service (channel) the phone may (shall !) only make available the AT commands belonging to this service.

Ciao,

Peter

Quoted 5 lines · Dirk Vanden Boer
Quoted 4 lines · Fred Schaettgen
Quoted 3 lines · Dirk Vanden Boer

Hi,
I'm trying to send AT commands to my mobile phone using an rfcomm connection. The connection seems to work because I can exectute som=

e

Quoted 1 line
Quoted 1 line
Quoted 1 line

commands (like manufacturer name). But a whole bunch of commands ar=

e

Quoted 7 lines
Quoted 7 lines
Quoted 4 lines

not available (eg. battery charge: "AT+CBC\r" returns ERROR). I can run the AT* command which lists the available commands but a lot of common commands are not in the list. Could it be that there is something wrong with my connection?

Are you sure that this command should be supported at all? If you are connecting to the handsfree service, then the phone probably does not=

have to

Quoted 1 line
Quoted 1 line

support it. At least I can't find +CBC in the handsfree spec. Phones =

are free

Quoted 1 line
Quoted 1 line

to support additional commands though, or at least they do support mo=

re in

Quoted 1 line
Quoted 1 line

practice. It works with a Nokia 6230 for instance, without any specia=

l

Quoted 10 lines
Quoted 3 lines

initialization.

Fred

The CBC command is listed in the developers guidelines document of the ericsson t68 phone, so I guess it should be available.

Dirk

Quoted 10 lines

-------------------------------------------------------
SF.Net email is sponsored by: Discover Easy Linux Migration Strategies from IBM. Find simple to follow Roadmaps, straightforward articles, informative Webcasts and more! Get everything you need to get up to speed, fast. http://ads.osdn.com/?ad_idt77&alloc_id=16492&op=CCk
_______________________________________________
Bluez-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bluez-devel

|	Peter Wippich 			Voice: +49 30 46776411		|
|	G&W Instruments GmbH		fax:   +49 30 46776419		|
|	Gustav-Meyer-Allee 25, Geb. 12	Email: [email protected]	|
|	D-13355 Berlin  / Germany					|

-------------------------------------------------------
SF.Net email is sponsored by: Discover Easy Linux Migration Strategies from IBM. Find simple to follow Roadmaps, straightforward articles, informative Webcasts and more! Get everything you need to get up to speed, fast. http://ads.osdn.com/?ad_id=7477&alloc_id=16492&op=click
_______________________________________________
Bluez-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bluez-devel

#4 lore raw

Thanks for pointing me to that. I was connecting to channel 4 (heaset service) which was wrong, I think I should be connecting to the serial port service (channel 1). But the CBC command is still not available. In fact the available commands listed with AT* are the same for channel 1 and 4.

Dirk

Quoted 6 lines · Peter Wippich

=20
Hi Dirk,
=20
which service you are connecting to ??? If you connect to the wrong service (channel) the phone may (shall !) only make available the AT commands belonging to this service.

Quoted 13 lines

=20
Ciao,
=20
Peter
=20
=20
On Sat, 16 Jul 2005, Dirk Vanden Boer wrote:
=20

Quoted 5 lines · Fred Schaettgen
Quoted 4 lines · Dirk Vanden Boer
Quoted 3 lines

Hi,
I'm trying to send AT commands to my mobile phone using an rfcomm connection. The connection seems to work because I can exectute som=

e

Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

commands (like manufacturer name). But a whole bunch of commands ar=

e

Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 4 lines

not available (eg. battery charge: "AT+CBC\r" returns ERROR). I can run the AT* command which lists the available commands but a lot of common commands are not in the list. Could it be that there is something wrong with my connection?

Are you sure that this command should be supported at all? If you are connecting to the handsfree service, then the phone probably does not=

have to

Quoted 1 line
Quoted 1 line
Quoted 1 line

support it. At least I can't find +CBC in the handsfree spec. Phones =

are free

Quoted 1 line
Quoted 1 line
Quoted 1 line

to support additional commands though, or at least they do support mo=

re in

Quoted 1 line
Quoted 1 line
Quoted 1 line

practice. It works with a Nokia 6230 for instance, without any specia=

l

Quoted 10 lines
Quoted 10 lines
Quoted 3 lines

initialization.

Fred

The CBC command is listed in the developers guidelines document of the ericsson t68 phone, so I guess it should be available.

Dirk

-------------------------------------------------------
SF.Net email is sponsored by: Discover Easy Linux Migration Strategies from IBM. Find simple to follow Roadmaps, straightforward articles, informative Webcasts and more! Get everything you need to get up to speed, fast. http://ads.osdn.com/?ad_id=7477&alloc_id=16492&op=click
_______________________________________________
Bluez-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bluez-devel

#5 lore raw

Try DUN. But maybe the CBC command is only available on the physical port.

Ciao,

Peter

Quoted 6 lines · Dirk Vanden Boer

Thanks for pointing me to that. I was connecting to channel 4 (heaset service) which was wrong, I think I should be connecting to the serial port service (channel 1). But the CBC command is still not available. In fact the available commands listed with AT* are the same for channel 1 and 4.

Quoted 22 lines

Dirk

Quoted 18 lines · Peter Wippich

Hi Dirk,

which service you are connecting to ??? If you connect to the wrong service (channel) the phone may (shall !) only make available the AT commands belonging to this service.

Ciao,

Peter

Quoted 4 lines · Dirk Vanden Boer
Quoted 3 lines · Fred Schaettgen
Quoted 2 lines · Dirk Vanden Boer

Hi,
I'm trying to send AT commands to my mobile phone using an rfco=

mm

Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

connection. The connection seems to work because I can exectute=

some

Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

commands (like manufacturer name). But a whole bunch of command=

s are

Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

not available (eg. battery charge: "AT+CBC\r" returns ERROR). I=

can

Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

run the AT* command which lists the available commands but a lo=

t of

Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 2 lines

common commands are not in the list. Could it be that there is something wrong with my connection?

Are you sure that this command should be supported at all? If you=

are

Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

connecting to the handsfree service, then the phone probably does=

not have to

Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

support it. At least I can't find +CBC in the handsfree spec. Pho=

nes are free

Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

to support additional commands though, or at least they do suppor=

t more in

Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

practice. It works with a Nokia 6230 for instance, without any sp=

ecial

Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 3 lines

initialization.

Fred

The CBC command is listed in the developers guidelines document of =

the

Quoted 7 lines
Quoted 5 lines
Quoted 5 lines

ericsson t68 phone, so I guess it should be available.

Dirk

Quoted 10 lines

-------------------------------------------------------
SF.Net email is sponsored by: Discover Easy Linux Migration Strategies from IBM. Find simple to follow Roadmaps, straightforward articles, informative Webcasts and more! Get everything you need to get up to speed, fast. http://ads.osdn.com/?ad_idt77&alloc_id=16492&op=CCk
_______________________________________________
Bluez-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bluez-devel

|	Peter Wippich 			Voice: +49 30 46776411		|
|	G&W Instruments GmbH		fax:   +49 30 46776419		|
|	Gustav-Meyer-Allee 25, Geb. 12	Email: [email protected]	|
|	D-13355 Berlin  / Germany					|

-------------------------------------------------------
SF.Net email is sponsored by: Discover Easy Linux Migration Strategies from IBM. Find simple to follow Roadmaps, straightforward articles, informative Webcasts and more! Get everything you need to get up to speed, fast. http://ads.osdn.com/?ad_id=7477&alloc_id=16492&op=click
_______________________________________________
Bluez-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bluez-devel

#6 lore raw

I believe DUN is channel 1, to be sure I tried every channel, nothing seems to work

Dirk

Quoted 2 lines · Peter Wippich

=20
Try DUN. But maybe the CBC command is only available on the physical port=

.

Quoted 36 lines

=20
Ciao,
=20
Peter
=20
=20
On Sat, 16 Jul 2005, Dirk Vanden Boer wrote:
=20

Quoted 28 lines

Thanks for pointing me to that. I was connecting to channel 4 (heaset service) which was wrong, I think I should be connecting to the serial port service (channel 1). But the CBC command is still not available. In fact the available commands listed with AT* are the same for channel 1 and 4.

Dirk

Quoted 18 lines · Peter Wippich

Hi Dirk,

which service you are connecting to ??? If you connect to the wrong service (channel) the phone may (shall !) only make available the AT commands belonging to this service.

Ciao,

Peter

Quoted 4 lines · Dirk Vanden Boer
Quoted 3 lines · Fred Schaettgen
Quoted 2 lines · Dirk Vanden Boer

Hi,
I'm trying to send AT commands to my mobile phone using an rfco=

mm

Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

connection. The connection seems to work because I can exectute=

some

Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

commands (like manufacturer name). But a whole bunch of command=

s are

Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

not available (eg. battery charge: "AT+CBC\r" returns ERROR). I=

can

Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

run the AT* command which lists the available commands but a lo=

t of

Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 2 lines

common commands are not in the list. Could it be that there is something wrong with my connection?

Are you sure that this command should be supported at all? If you=

are

Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

connecting to the handsfree service, then the phone probably does=

not have to

Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

support it. At least I can't find +CBC in the handsfree spec. Pho=

nes are free

Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

to support additional commands though, or at least they do suppor=

t more in

Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

practice. It works with a Nokia 6230 for instance, without any sp=

ecial

Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 3 lines

initialization.

Fred

The CBC command is listed in the developers guidelines document of =

the

Quoted 22 lines
Quoted 7 lines
Quoted 5 lines
Quoted 5 lines

ericsson t68 phone, so I guess it should be available.

Dirk

Quoted 10 lines

-------------------------------------------------------
SF.Net email is sponsored by: Discover Easy Linux Migration Strategies from IBM. Find simple to follow Roadmaps, straightforward articles, informative Webcasts and more! Get everything you need to get up to speed, fast. http://ads.osdn.com/?ad_idt77&alloc_id=16492&op=CCk
_______________________________________________
Bluez-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bluez-devel

=20

|       Peter Wippich                   Voice: +49 30 46776411          |
|       G&W Instruments GmbH            fax:   +49 30 46776419          |
|       Gustav-Meyer-Allee 25, Geb. 12  Email: [email protected]   |
|       D-13355 Berlin  / Germany                                       |
Quoted 14 lines

=20
=20
=20
=20
-------------------------------------------------------
SF.Net email is sponsored by: Discover Easy Linux Migration Strategies from IBM. Find simple to follow Roadmaps, straightforward articles, informative Webcasts and more! Get everything you need to get up to speed, fast. http://ads.osdn.com/?ad_idt77&alloc_id=16492&opclick
_______________________________________________
Bluez-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bluez-devel

-------------------------------------------------------
SF.Net email is sponsored by: Discover Easy Linux Migration Strategies from IBM. Find simple to follow Roadmaps, straightforward articles, informative Webcasts and more! Get everything you need to get up to speed, fast. http://ads.osdn.com/?ad_id=7477&alloc_id=16492&op=click
_______________________________________________
Bluez-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bluez-devel

#7 lore raw

Hi Dirk. I've tried your code on my system (bt dongle with i-mate SP3 phone), but my phone close the connection during receive. I'm subsantially sure that the channel is right. When I try DUN channel I obtain ERROR response, but when I use HF profile, the phone close the connection. I obtain the same behaviour with HS channel.

Someone could help me to solve this problem?

thx in advance.

Cheers,
Pizza

Quoted 68 lines · Dirk Vanden Boer

I believe DUN is channel 1, to be sure I tried every channel, nothing seems to work

Dirk

Quoted 61 lines · Peter Wippich

Try DUN. But maybe the CBC command is only available on the physical port.

Ciao,

Peter

Quoted 51 lines · Dirk Vanden Boer

Thanks for pointing me to that. I was connecting to channel 4 (heaset service) which was wrong, I think I should be connecting to the serial port service (channel 1). But the CBC command is still not available. In fact the available commands listed with AT* are the same for channel 1 and 4.

Dirk

Quoted 40 lines · Peter Wippich

Hi Dirk,

which service you are connecting to ??? If you connect to the wrong service (channel) the phone may (shall !) only make available the AT commands belonging to this service.

Ciao,

Peter

Quoted 26 lines · Dirk Vanden Boer
Quoted 11 lines · Fred Schaettgen
Quoted 8 lines · Dirk Vanden Boer

Hi,
I'm trying to send AT commands to my mobile phone using an rfcomm connection. The connection seems to work because I can exectute some commands (like manufacturer name). But a whole bunch of commands are not available (eg. battery charge: "AT+CBC\r" returns ERROR). I can run the AT* command which lists the available commands but a lot of common commands are not in the list. Could it be that there is something wrong with my connection?

Quoted 8 lines

Are you sure that this command should be supported at all? If you are connecting to the handsfree service, then the phone probably does not have to support it. At least I can't find +CBC in the handsfree spec. Phones are free to support additional commands though, or at least they do support more in practice. It works with a Nokia 6230 for instance, without any special initialization.

Fred

The CBC command is listed in the developers guidelines document of the ericsson t68 phone, so I guess it should be available.

Dirk

-------------------------------------------
Luca Pizzamiglio
CEFRIEL - Embedded Systems Design Unit
Via Fucini, 2 - 20133 MILANO (ITALY)
Phone: +39 02 23954 343
e-mail: [email protected]
ICQ: 5046978
-------------------------------------------

-------------------------------------------------------
SF.Net email is sponsored by: Discover Easy Linux Migration Strategies from IBM. Find simple to follow Roadmaps, straightforward articles, informative Webcasts and more! Get everything you need to get up to speed, fast. http://ads.osdn.com/?ad_id=7477&alloc_id=16492&op=click
_______________________________________________
Bluez-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bluez-devel