Communication with BlueTooth Device over Serial Port
Hi
I have recently purchased a BlueTooth device from SparkFun, and have managed to get it to work using Hyperterminal.
I would like to use my own VC++ written program instead of Hyperterminal.
I have managed to read/ write RS232 serial data before, and the BlueTooth device communciates serially.
Right now I have managed to:
(a) Using Hyperterminal send commands to start up the BT device.
Commands such as "ATUCL<cr>", etc
(b) Once the connection is established- I close Hyperterminal and start up my own VC++ program.
(c) I can then send over the RS232 line a "start command" (not requiring a <cr> and a "stop command" (Also not requiering a <cr>)
I can receive data over the RS232 line and display it.
(d) What I CANNOT do is to send "ATUCL<cr>" type of commands over the RS232. It just does nothing.
Can someone please tell me how to send a
ATUCL<cr>
into the RS232 serial port?
(I have tried, using \n \r and both \n\r with no success).
Thank you in advance.
a.
Re: Communication with BlueTooth Device over Serial Port
have a look on this may be this one Help you
http://www.codeguru.com/forum/showth...09#post1377409
Thankyou
Re: Communication with BlueTooth Device over Serial Port
Have you tried "\r\n" instead of "\n\r" ?
Re: Communication with BlueTooth Device over Serial Port
Hi
Yes I have tried both combinations of "\r\n" and "\n\r"
What is the exact characters for:
AT<cr>
is it "AT\n\r"?
and is \n\r 2 characters or one?
Thank you
a.
Re: Communication with BlueTooth Device over Serial Port
You can refer to ASCII Chart in MSDN library for RS-232 communication.
If you send character '\x00D', it is equilvalent to <CR>.
\x mean Hexadecimal and 00D is the ASCII number equivalent to <CR>.
Re: Communication with BlueTooth Device over Serial Port
Hi zawthet
Thank you- that worked!
All the best
a.