1#ifndef SERIAL_PORT_WINDOWS_H_
2#define SERIAL_PORT_WINDOWS_H_
6#include <serial_port/serial_port.h>
13 class SerialPortWindows final :
public Interface
17 using Interface::Interface;
20 SerialPortWindows(SerialPortWindows&&) =
default;
21 SerialPortWindows& operator=(SerialPortWindows&& other) =
default;
23 SerialPortWindows(
const SerialPortWindows&) =
delete;
24 SerialPortWindows& operator=(
const SerialPortWindows& other) =
delete;
27 ~SerialPortWindows()
override { SerialPortWindows::Close(); }
31 void Close()
override;
32 bool IsOpen()
override;
34 unsigned long NumBytesAvailable()
override;
35 void FlushBuffer()
const override;
37 unsigned long ReadData(
char* data,
unsigned long num_bytes)
override;
38 unsigned long WriteData(
const char* data,
unsigned long num_bytes)
override;
41 HANDLE handle_{ INVALID_HANDLE_VALUE };
42 COMMCONFIG comm_config_;