Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

WinApi for serial to cellular

Status
Not open for further replies.

Guest_imported

New member
Jan 1, 1970
0
0
0
I'm connecting to a cell phone with a serial cable, and when I connect via Hyper terminal I receive the respond from the phone, but when I connect via code with the same settings, the phone does not respond.

Please ASAP...

 
Unfortunately, there is not enough information to even hazard a guess at the problem.

For instance, what serial settings are you using?

What code are you using (e.g. API calls, summary of the algorithm etc.)

What symptoms are you experiencing?

Have you used a serial analyzer? There are software versions available that you can download for free. Here is a link to one available in source code from Windows Developer Magazine from October 1999:


That is the link to the article and the source code is downloadable from here:

ftp://ftp.wdj.com/pub/1999/oct99.zip

There are compiled versions of the code included in the archive.
 
I'm using c, with WinApi CreteFile, WriteFile, ReadFile.
The following are the settings. I'm trying to communicate to a 6210 Nokia phone.

// Change the DCB structure settings.
PortDCB.BaudRate = 9600; // Current baud
PortDCB.fBinary = TRUE; // Binary mode; no EOF check
PortDCB.fParity = TRUE; // Enable parity checking
PortDCB.fOutxCtsFlow = FALSE; // No CTS output flow control
PortDCB.fOutxDsrFlow = FALSE; // No DSR output flow control
// DTR flow control type
PortDCB.fDtrControl = DTR_CONTROL_DISABLE ;
PortDCB.fDsrSensitivity = FALSE; // DSR sensitivity
PortDCB.fTXContinueOnXoff = FALSE; // XOFF continues Tx
PortDCB.fOutX = FALSE; // No XON/XOFF out flow control
PortDCB.fInX = FALSE; // No XON/XOFF in flow control
PortDCB.fErrorChar = TRUE; // Enable error replacement
PortDCB.fNull = TRUE; // Enable null stripping
// RTS flow control
PortDCB.fRtsControl = RTS_CONTROL_DISABLE ;
PortDCB.fAbortOnError = FALSE; // Do not abort reads/writes on error
PortDCB.ByteSize = 8; // Number of bits/byte
PortDCB.Parity = NOPARITY;
PortDCB.StopBits = ONESTOPBIT;

When I call Readfile, the function does not return an error but I receive 0 bytes read.
The scanner shows that the port responded with false (no data to be sent) to ReadFile.
As I wrote the phone responds only via Hyperterminal.
Please ASAP.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top