Re: Modem Commands out Virtual COM Port
- From: "jp2code" <poojo.com/mail>
- Date: Fri, 18 May 2007 14:17:35 -0500
Hello Mr. Grier.
I'm using native C++ with eVC4, and appending 0xA and 0xC to the strings
that I send.
Using HyperTerminal on a PC that the "Serial To Bluetooth" device is
physically attached to, here are what my commands would look like:
$$$ // my command, issues the "Enable Command Mode"
CMD // this is returned by the device
U,9600,N // my command, sets baud rate to 9600 bps
AOK // this is returned by the device
When I open HyperTerminal, it already has the serial port open and
"Connected."
If I send these commands via Bluetooth, would I need to issue an "AT"
command first to start the connection, or does CreateFile() take care of all
that?
To replicate what I'm doing on HyperTerminal, I've done something like this
on the Pocket PC to be sent via Bluetooth:
DWORD num;
DCB dcb;
char buf[20];
strcpy(buf, "$$$");
buf[3] = 0xA;
buf[4] = 0xC;
WriteFile(hPort, buf, 5, &num, NULL);
Sleep(100);
// no response from ReadFile threading loop
strcpy(buf, "U,9600,N");
buf[8] = 0xA;
buf[9] = 0xC;
WriteFile(hPort, buf, 10, &num, NULL);
Sleep(100);
dcb.BaudRate = CBR_9600;
SetCommState(hPort, &dcb);
I didn't show any of my error checking to keep it simple, but it seems like
this should work to me.
I'm guessing I don't receive responses on the Pocket PC's Bluetooth port
because the device on the PC keeps those responses internal. Either that, or
I'm not configured to receive HyperTerminal style responses.
Any thoughts? You? Unc? Mr. Tacke? Mr. Foot?
Regards,
Joe
"*** Grier" wrote:
Are you terminating your command with a carriage return character (vbCr in
VB, or \r in C#)?
The code that you are using might actually help. We are left guessing.
You should send your command as a String (or string).
***
.
- Follow-Ups:
- Re: Modem Commands out Virtual COM Port
- From: Uncle Marvo
- Re: Modem Commands out Virtual COM Port
- From: *** Grier
- Re: Modem Commands out Virtual COM Port
- References:
- Modem Commands out Virtual COM Port
- From: jp2code
- Re: Modem Commands out Virtual COM Port
- From: *** Grier
- Modem Commands out Virtual COM Port
- Prev by Date: where are BthGetMode & BthSetMode?
- Next by Date: Re: where are BthGetMode & BthSetMode?
- Previous by thread: Re: Modem Commands out Virtual COM Port
- Next by thread: Re: Modem Commands out Virtual COM Port
- Index(es):