Skip to contentSkip to conversation

AT Commands

Bluez-users [email protected] 2 participants 3 messages Jul 17, 2007 – Jul 18, 2007 Bluetooth drivers

lore
Share & tools
lore
#0 lore raw

Hello,

I'm currently trying to write a program that would allow me to send SMS via bluetooth through my mobile phone. The problem that I have is that I'm not able to receive and decode correctly the responses from the mobile. Here is a sample of the code I'm using, which should retrieve the IMSI of the mobile:

s = socket(AF_BLUETOOTH, SOCK_STREAM, BTPROTO_RFCOMM);
status = connect(s, (struct sockaddr *)&addr, sizeof(addr); // addr being the address of my mobile

char remote[1024] = {0};

status = write(s, "AT+CIMI\r", 8);
read(s,remote,1024) // s being the socket
printf("received [%s]\n", remote);

All what I get is
]eceived [AT+CIMI

Does anyone have an idea of what I'm doing wrong ?

Thanks in advance

Best Regards

-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Bluez-users mailing list [email protected]
https://lists.sourceforge.net/lists/listinfo/bluez-users

#1 lore raw
Quoted 16 lines · [email protected] wrote:

I'm currently trying to write a program that would allow me to send SMS via bluetooth through my mobile phone. The problem that I have is that I'm not able to receive and decode correctly the responses from the mobile. Here is a sample of the code I'm using, which should retrieve the IMSI of the mobile:

s = socket(AF_BLUETOOTH, SOCK_STREAM, BTPROTO_RFCOMM);
status = connect(s, (struct sockaddr *)&addr, sizeof(addr); // addr being the address of my mobile

char remote[1024] = {0};

status = write(s, "AT+CIMI\r", 8);
read(s,remote,1024) // s being the socket
printf("received [%s]\n", remote);

Quoted 5 lines

All what I get is
]eceived [AT+CIMI

Does anyone have an idea of what I'm doing wrong ?

I've no idea,
but have you thought of looking at gnokii?

Signature · 15 lines
Timothy Murphy  
e-mail (<80k only): tim /at/ birdsnest.maths.tcd.ie
tel: +353-86-2336090, +353-1-2842366
s-mail: School of Mathematics, Trinity College, Dublin 2, Ireland


-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Bluez-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bluez-users
#2 lore raw

Thank you I'll take a look to that

Quoted 34 lines
Quoted 16 lines · [email protected] wrote:

I'm currently trying to write a program that would allow me to send SMS via bluetooth through my mobile phone. The problem that I have is that I'm not able to receive and decode correctly the responses from the mobile. Here is a sample of the code I'm using, which should retrieve the IMSI of the mobile:

s = socket(AF_BLUETOOTH, SOCK_STREAM, BTPROTO_RFCOMM);
status = connect(s, (struct sockaddr *)&addr, sizeof(addr); // addr being the address of my mobile

char remote[1024] = {0};

status = write(s, "AT+CIMI\r", 8);
read(s,remote,1024) // s being the socket
printf("received [%s]\n", remote);

Quoted 5 lines

All what I get is
]eceived [AT+CIMI

Does anyone have an idea of what I'm doing wrong ?

I've no idea,
but have you thought of looking at gnokii?

--
Timothy Murphy
e-mail (<80k only): tim /at/ birdsnest.maths.tcd.ie
tel: +353-86-2336090, +353-1-2842366
s-mail: School of Mathematics, Trinity College, Dublin 2, Ireland

Quoted 10 lines

-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Bluez-users mailing list [email protected]
https://lists.sourceforge.net/lists/listinfo/bluez-users

-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Bluez-users mailing list [email protected]
https://lists.sourceforge.net/lists/listinfo/bluez-users