Click here to Skip to main content
15,896,154 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
In my VC++ code,

I have successful running on the 112300 bps of serial communications

But I try to SetCommState(Comm, &m_dcb) with baudrate 230400 bps, it fails with GetLastError() code = 87// ERROR_INVALID_PARAMETER
Is this cased from hardware?
Please let me know the causes and solution.

Thank you in advance.

What I have tried:

More one day wasted for this problem.
Posted
Updated 26-Oct-17 21:05pm

87 (decimal) is Invalid Parameter, so, what does the rest of the code look like that sets up the port? You could be setting other parameters that doesn't work together.

From just what you posted, does the hardware support that rate? 230400 isn't one of the standard rates I know of. The closest standard rate is 256000.
 
Share this answer
 
Quote:
Is this cased from hardware?
It might be. As Dave already noted, 230400 (as well 112300) is not a standard speed. The hardware couldn't possibly warrant the requested timing accuracy at such a speeed.
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900