Home
Forums
New posts
Search forums
Articles
Latest reviews
Search resources
Members
Current visitors
Newsgroups
Log in
Register
What's new
Search
Search
Search titles only
By:
New posts
Search forums
Menu
Log in
Register
Install the app
Install
Home
Forums
Newsgroups
Microsoft DotNet
Microsoft Dot NET Compact Framework
OpenNETCF Serial not working in my WinCE 5.0 device
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Reply to thread
Message
[QUOTE="Guest, post: 7537715"] Hi, can I know how can I get the port settings at the point before sending out the data as the port is an IntPtr type? I checked the settings I sent out when I open the device: bool bReturn = CommAPI.SetupComm(hPort, rxBufferSize, txBufferSize); // transfer the port settings to a DCB structure dcb.BaudRate = (uint)portSettings.BasicSettings.BaudRate; dcb.ByteSize = portSettings.BasicSettings.ByteSize; dcb.EofChar = (sbyte)portSettings.EOFChar; dcb.ErrorChar = (sbyte)portSettings.ErrorChar; dcb.EvtChar = (sbyte)portSettings.EVTChar; dcb.fAbortOnError = portSettings.AbortOnError; dcb.fBinary = true; dcb.fDsrSensitivity = portSettings.DSRSensitive; dcb.fDtrControl = (DCB.DtrControlFlags)portSettings.DTRControl; dcb.fErrorChar = portSettings.ReplaceErrorChar; dcb.fInX = portSettings.InX; dcb.fNull = portSettings.DiscardNulls; dcb.fOutX = portSettings.OutX; dcb.fOutxCtsFlow = portSettings.OutCTS; dcb.fOutxDsrFlow = portSettings.OutDSR; dcb.fParity = (portSettings.BasicSettings.Parity == Parity.none) ? false : true; dcb.fRtsControl = (DCB.RtsControlFlags)portSettings.RTSControl; dcb.fTXContinueOnXoff = portSettings.TxContinueOnXOff; dcb.Parity = (byte)portSettings.BasicSettings.Parity; dcb.StopBits = (byte)portSettings.BasicSettings.StopBits; dcb.XoffChar = (sbyte)portSettings.XoffChar; dcb.XonChar = (sbyte)portSettings.XonChar; dcb.XonLim = dcb.XoffLim = (ushort)(rxBufferSize / 10); CommAPI.SetCommState(hPort, dcb); and I am sure the settings is correct because when I tested on HyperTerminal using the same setting, it works. Any idea? [/QUOTE]
Verification
Post reply
Home
Forums
Newsgroups
Microsoft DotNet
Microsoft Dot NET Compact Framework
OpenNETCF Serial not working in my WinCE 5.0 device
Top