Re: Enter at commands to mobile phone using bluetooth
Re: Enter at commands to mobile phone using bluetooth
- Subject: Re: Enter at commands to mobile phone using bluetooth
- From: Nicko van Someren <email@hidden>
- Date: Fri, 16 Apr 2004 16:15:47 +0100
On 16 Apr 2004, at 4:52, Nathanael P wrote:
... I am
going to write a program with xcode that could sends
at command using bluetooth and recieve response (like
hyper terminal in windows).
[mRFCOMMChannel writeSync:"at+cmgf=1/n" length:16];
Do I make mistakes? Thanks for your help.
There are three mistakes on that last line.
Firstly, the length of the data you are sending looks like it was
intended to be 10 bytes, so you need to set the length to that. Since
you are only sending strings rather than binary data I would recommend
using something like:
char *s;
...
s = "<your command to send>";
[mRFCOMMChannel writeSync: s length: strlen(s)];
Secondly, you have the slash the wrong way around; I'm pretty sure that
you meant to write "at+cmgf=1\n"
Thirdly, you shouldn't be using "\n" (new line) anyway, you should be
sending a "\r" (carriage return) instead.
Cheers,
Nicko
_______________________________________________
bluetooth-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/bluetooth-dev
Do not post admin requests to the list. They will be ignored.