WriteFile returns Success(Nonzero Value) NumberofBytesWritten is 0
-
Hi, I am running a WinCE6.0 Stream interface Driver on a DTE device which will open a handle to Serial port which is connected to a modem.WriteFile API returns non-zero Value, but NumberofbytesWritten parameters is coming as Zero. The Windows CE 6.0 device is a DTE terminal and when connected to PC (Another DTE)) over NULL Modem cable with hyperterminal, all the data from the are seen on the hyperterminal, and WriteFile API fills the NumberofbytesWritten is exactly the same as the bytestoWrite. When the CE6.0 DTE device is connected to DCE Modemdevice using a Straight serial cable, WriteFile API is succedding by returning Non-Zero Value, but NumberofbytesWritten parameters is coming as Zero. The following is the DCB in the driver: dcb.BaudRate = m_BaudRate;(115200) dcb.fBinary = TRUE; dcb.fParity = TRUE; dcb.fOutxCtsFlow = TRUE; dcb.fOutxDsrFlow = FALSE; dcb.fDtrControl = DTR_CONTROL_ENABLE; dcb.fDsrSensitivity = FALSE; dcb.fTXContinueOnXoff = TRUE; dcb.fOutX = FALSE; dcb.fInX = FALSE; dcb.fErrorChar = FALSE; dcb.fNull = FALSE; dcb.fRtsControl = RTS_CONTROL_HANDSHAKE; dcb.fAbortOnError = FALSE; dcb.ByteSize = 8; dcb.Parity = NOPARITY; dcb.StopBits = ONESTOPBIT; Also, I am setting EscapeCommFunction(m_hCOMHandle,SETDTR); On the hyperteminal I have the following setting: baudrate = 115200 Data bit = 8 Parity=None StopBit=1 FlowControl=None Also, with the same hyperterminal setting with PC(Hyperterminal) connected to Modem over Straight SErial cable, I am able to fire the AT Commands from the PC(hyperterminal) to the modem. Also CommTimeout, I have set the following: CT.ReadIntervalTimeout = MAXDWORD; CT.ReadTotalTimeoutMultiplier = 0; CT.ReadTotalTimeoutConstant = 0; CT.WriteTotalTimeoutMultiplier = 0; CT.WriteTotalTimeoutConstant = 100; -Can a timeout issue cause WriteFile Still succeed and Numberof Bytes Written as zero? - In hyperterminal Flow Control None, what are the Flow control affected in the DCB? Can somebody give me some hints on the same. Thanks..