The class for control port in Windows.
More...
#include <port_handler_windows.h>
|
void | clearPort () |
| The function that clears the port @description The function clears the port. More...
|
|
void | closePort () |
| The function that closes the port @description The function closes the port. More...
|
|
int | getBaudRate () |
| The function that returns current baudrate set into the port handler @description The function returns current baudrate set into the port handler. More...
|
|
int | getBytesAvailable () |
| The function that checks how much bytes are able to be read from the port buffer @description The function checks how much bytes are able to be read from the port buffer @description and returns the number. More...
|
|
char * | getPortName () |
| The function that returns port name set into the port handler @description The function returns current port name set into the port handler. More...
|
|
bool | isPacketTimeout () |
| The function that checks whether packet timeout is occurred @description The function checks whether current time is passed by the time of packet timeout from the time set by PortHandlerWindows::setPacketTimeout(). More...
|
|
bool | openPort () |
| The function that opens the port @description The function calls PortHandlerWindows::setBaudRate() to open the port. More...
|
|
| PortHandlerWindows (const char *port_name) |
| The function that initializes instance of PortHandler and gets port_name @description The function initializes instance of PortHandler and gets port_name. More...
|
|
int | readPort (uint8_t *packet, int length) |
| The function that reads bytes from the port buffer @description The function gets bytes from the port buffer, @description and returns a number of bytes read. More...
|
|
bool | setBaudRate (const int baudrate) |
| The function that sets baudrate into the port handler @description The function sets baudrate into the port handler. More...
|
|
void | setPacketTimeout (double msec) |
| The function that sets and starts stopwatch for watching packet timeout @description The function sets the stopwatch by getting current time and the time of packet timeout with msec. More...
|
|
void | setPacketTimeout (uint16_t packet_length) |
| The function that sets and starts stopwatch for watching packet timeout @description The function sets the stopwatch by getting current time and the time of packet timeout with packet_length. More...
|
|
void | setPortName (const char *port_name) |
| The function that sets port name into the port handler @description The function sets port name into the port handler. More...
|
|
int | writePort (uint8_t *packet, int length) |
| The function that writes bytes on the port buffer @description The function writes bytes on the port buffer, @description and returns a number of bytes which are successfully written. More...
|
|
virtual | ~PortHandlerWindows () |
| The function that closes the port @description The function calls PortHandlerWindows::closePort() to close the port. More...
|
|
Public Member Functions inherited from dynamixel::PortHandler |
virtual | ~PortHandler () |
|
The class for control port in Windows.
Definition at line 35 of file port_handler_windows.h.
◆ PortHandlerWindows()
dynamixel::PortHandlerWindows::PortHandlerWindows |
( |
const char * |
port_name | ) |
|
The function that initializes instance of PortHandler and gets port_name @description The function initializes instance of PortHandler and gets port_name.
◆ ~PortHandlerWindows()
virtual dynamixel::PortHandlerWindows::~PortHandlerWindows |
( |
| ) |
|
|
inlinevirtual |
◆ clearPort()
void dynamixel::PortHandlerWindows::clearPort |
( |
| ) |
|
|
virtual |
The function that clears the port @description The function clears the port.
Implements dynamixel::PortHandler.
◆ closePort()
void dynamixel::PortHandlerWindows::closePort |
( |
| ) |
|
|
virtual |
The function that closes the port @description The function closes the port.
Implements dynamixel::PortHandler.
◆ getBaudRate()
int dynamixel::PortHandlerWindows::getBaudRate |
( |
| ) |
|
|
virtual |
The function that returns current baudrate set into the port handler @description The function returns current baudrate set into the port handler.
- Returns
- Baudrate
Implements dynamixel::PortHandler.
◆ getBytesAvailable()
int dynamixel::PortHandlerWindows::getBytesAvailable |
( |
| ) |
|
|
virtual |
The function that checks how much bytes are able to be read from the port buffer @description The function checks how much bytes are able to be read from the port buffer @description and returns the number.
- Returns
- Length of read-able bytes in the port buffer
Implements dynamixel::PortHandler.
◆ getCurrentTime()
double dynamixel::PortHandlerWindows::getCurrentTime |
( |
| ) |
|
|
private |
◆ getPortName()
char* dynamixel::PortHandlerWindows::getPortName |
( |
| ) |
|
|
virtual |
The function that returns port name set into the port handler @description The function returns current port name set into the port handler.
- Returns
- Port name
Implements dynamixel::PortHandler.
◆ getTimeSinceStart()
double dynamixel::PortHandlerWindows::getTimeSinceStart |
( |
| ) |
|
|
private |
◆ isPacketTimeout()
bool dynamixel::PortHandlerWindows::isPacketTimeout |
( |
| ) |
|
|
virtual |
◆ openPort()
bool dynamixel::PortHandlerWindows::openPort |
( |
| ) |
|
|
virtual |
◆ readPort()
int dynamixel::PortHandlerWindows::readPort |
( |
uint8_t * |
packet, |
|
|
int |
length |
|
) |
| |
|
virtual |
The function that reads bytes from the port buffer @description The function gets bytes from the port buffer, @description and returns a number of bytes read.
- Parameters
-
packet | Buffer for the packet received |
length | Length of the buffer for read |
- Returns
- -1
-
when error was occurred
-
or Length of bytes read
Implements dynamixel::PortHandler.
◆ setBaudRate()
bool dynamixel::PortHandlerWindows::setBaudRate |
( |
const int |
baudrate | ) |
|
|
virtual |
The function that sets baudrate into the port handler @description The function sets baudrate into the port handler.
- Parameters
-
- Returns
- false
-
when error was occurred during port opening
-
or true
Implements dynamixel::PortHandler.
◆ setPacketTimeout() [1/2]
void dynamixel::PortHandlerWindows::setPacketTimeout |
( |
double |
msec | ) |
|
|
virtual |
The function that sets and starts stopwatch for watching packet timeout @description The function sets the stopwatch by getting current time and the time of packet timeout with msec.
- Parameters
-
packet_length | Length of the packet expected to be received |
Implements dynamixel::PortHandler.
◆ setPacketTimeout() [2/2]
void dynamixel::PortHandlerWindows::setPacketTimeout |
( |
uint16_t |
packet_length | ) |
|
|
virtual |
The function that sets and starts stopwatch for watching packet timeout @description The function sets the stopwatch by getting current time and the time of packet timeout with packet_length.
- Parameters
-
packet_length | Length of the packet expected to be received |
Implements dynamixel::PortHandler.
◆ setPortName()
void dynamixel::PortHandlerWindows::setPortName |
( |
const char * |
port_name | ) |
|
|
virtual |
The function that sets port name into the port handler @description The function sets port name into the port handler.
- Parameters
-
Implements dynamixel::PortHandler.
◆ setupPort()
bool dynamixel::PortHandlerWindows::setupPort |
( |
const int |
baudrate | ) |
|
|
private |
◆ writePort()
int dynamixel::PortHandlerWindows::writePort |
( |
uint8_t * |
packet, |
|
|
int |
length |
|
) |
| |
|
virtual |
The function that writes bytes on the port buffer @description The function writes bytes on the port buffer, @description and returns a number of bytes which are successfully written.
- Parameters
-
packet | Buffer which would be written on the port buffer |
length | Length of the buffer for write |
- Returns
- -1
-
when error was occurred
-
or Length of bytes written
Implements dynamixel::PortHandler.
◆ baudrate_
int dynamixel::PortHandlerWindows::baudrate_ |
|
private |
◆ counter_
LARGE_INTEGER dynamixel::PortHandlerWindows::counter_ |
|
private |
◆ freq_
LARGE_INTEGER dynamixel::PortHandlerWindows::freq_ |
|
private |
◆ packet_start_time_
double dynamixel::PortHandlerWindows::packet_start_time_ |
|
private |
◆ packet_timeout_
double dynamixel::PortHandlerWindows::packet_timeout_ |
|
private |
◆ port_name_
char dynamixel::PortHandlerWindows::port_name_[100] |
|
private |
◆ serial_handle_
HANDLE dynamixel::PortHandlerWindows::serial_handle_ |
|
private |
◆ tx_time_per_byte_
double dynamixel::PortHandlerWindows::tx_time_per_byte_ |
|
private |
The documentation for this class was generated from the following file: