Я не уверен что ПиСишное железо эти константы поддерживает ![Грустный](https://forum.homedistiller.ru/Smileys/default/sad.gif)
стандартное железо не должно!
Kotische, 23 Июля 08, 17:45
Должно, но проверить стоит.
Инициализирую порт с:
dcb.fDtrControl = DTR_CONTROL_ENABLE; => +12V
dcb.fRtsControl = RTS_CONTROL_DISABLE; => -12V
Kotische, 23 Июля 08, 17:45
Ты не правильно понимаешь этот параметр. Это не установка и снятие сигнала, а разрешение автоматического управления им. Его нужно запретить, а, потом, установить эти сигналы ручками в нужное состояние командой EscapeCommFunction(...).
Команда:
BOOL EscapeCommFunction(
HANDLE hFile, // handle to communications device
DWORD dwFunc // extended function to perform
);
Параметры:
hFile
Handle to the communications device. The CreateFile function returns this handle.
dwFunc
Specifies the code of the extended function to perform. This parameter can be one of the following values: Value Meaning
CLRDTR Clears the DTR (data-terminal-ready) signal.
CLRRTS Clears the RTS (request-to-send) signal.
SETDTR Sends the DTR (data-terminal-ready) signal.
SETRTS Sends the RTS (request-to-send) signal.
SETXOFF Causes transmission to act as if an XOFF character has been received.
SETXON Causes transmission to act as if an XON character has been received.
SETBREAK Suspends character transmission and places the transmission line in a break state until the ClearCommBreak function is called (or EscapeCommFunction is called with the CLRBREAK extended function code). The SETBREAK extended function code is identical to the SetCommBreak function. Note that this extended function does not flush data that has not been transmitted.
CLRBREAK Restores character transmission and places the transmission line in a nonbreak state. The CLRBREAK extended function code is identical to the ClearCommBreak function.