| 196 | } |
| 197 | |
| 198 | void SerialPortController::applyPin(PinFunction targetFn, bool active) |
| 199 | { |
| 200 | if (!isOpen()) return; |
| 201 | HANDLE hPort = static_cast<HANDLE>(m_hWin); |
| 202 | if (m_dtrFn == targetFn) { |
| 203 | bool level = m_dtrActiveHigh ? active : !active; |
| 204 | ::EscapeCommFunction(hPort, level ? SETDTR : CLRDTR); |
| 205 | } |
| 206 | if (m_rtsFn == targetFn) { |
| 207 | bool level = m_rtsActiveHigh ? active : !active; |
| 208 | ::EscapeCommFunction(hPort, level ? SETRTS : CLRRTS); |
| 209 | } |
| 210 | } |
| 211 | |
| 212 | void SerialPortController::updatePolling() |
| 213 | { |