| 26 | } |
| 27 | |
| 28 | int OSSerial::open_serial_port () |
| 29 | { |
| 30 | this->port_descriptor = |
| 31 | CreateFile (this->port_name, GENERIC_READ | GENERIC_WRITE, 0, NULL, OPEN_EXISTING, 0, NULL); |
| 32 | if (this->port_descriptor == INVALID_HANDLE_VALUE) |
| 33 | { |
| 34 | return SerialExitCodes::OPEN_PORT_ERROR; |
| 35 | } |
| 36 | return SerialExitCodes::OK; |
| 37 | } |
| 38 | |
| 39 | int OSSerial::set_serial_port_settings (int ms_timeout, bool timeout_only) |
| 40 | { |