25 #ifndef MERCURY_SDK_INCLUDE_MERCURY_SDK_WINDOWS_PORTHANDLERWINDOWS_H_
26 #define MERCURY_SDK_INCLUDE_MERCURY_SDK_WINDOWS_PORTHANDLERWINDOWS_H_
41 HANDLE serial_handle_;
42 LARGE_INTEGER freq_, counter_;
47 double packet_start_time_;
48 double packet_timeout_;
49 double tx_time_per_byte_;
51 bool setupPort(
const int baudrate);
53 double getCurrentTime();
54 double getTimeSinceStart();
The class for port control that inherits PortHandlerLinux, PortHandlerWindows, PortHandlerMac,...
The class for control port in Windows.
void clearPort()
The function that clears the port @description The function clears the port.
virtual ~PortHandlerWindows()
The function that closes the port @description The function calls PortHandlerWindows::closePort() to ...
bool setBaudRate(const int baudrate)
The function that sets baudrate into the port handler @description The function sets baudrate into th...
int getBaudRate()
The function that returns current baudrate set into the port handler @description The function return...
int writePort(uint8_t *packet, int length)
The function that writes bytes on the port buffer @description The function writes bytes on the port ...
void closePort()
The function that closes the port @description The function closes the port.
int getBytesAvailable()
The function that checks how much bytes are able to be read from the port buffer @description The fun...
PortHandlerWindows(const char *port_name)
The function that initializes instance of PortHandler and gets port_name @description The function in...
void setPacketTimeout(uint16_t packet_length)
The function that sets and starts stopwatch for watching packet timeout @description The function set...
void setPortName(const char *port_name)
The function that sets port name into the port handler @description The function sets port name into ...
bool isPacketTimeout()
The function that checks whether packet timeout is occurred @description The function checks whether ...
void setPacketTimeout(double msec)
The function that sets and starts stopwatch for watching packet timeout @description The function set...
char * getPortName()
The function that returns port name set into the port handler @description The function returns curre...
bool openPort()
The function that opens the port @description The function calls PortHandlerWindows::setBaudRate() to...
int readPort(uint8_t *packet, int length)
The function that reads bytes from the port buffer @description The function gets bytes from the port...