The class for port control that inherits PortHandlerLinux, PortHandlerWindows, PortHandlerMac, or PortHandlerArduino. More...
#include <port_handler.h>
Public Member Functions | |
virtual void | clearPort ()=0 |
The function that clears the port The function clears the port. More... | |
virtual void | closePort ()=0 |
The function that closes the port The function closes the port. More... | |
virtual int | getBaudRate ()=0 |
The function that returns current baudrate set into the port handler The function returns current baudrate set into the port handler. More... | |
virtual int | getBytesAvailable ()=0 |
The function that checks how much bytes are able to be read from the port buffer The function checks how much bytes are able to be read from the port buffer and returns the number. More... | |
virtual char * | getPortName ()=0 |
The function that returns port name set into the port handler The function returns current port name set into the port handler. More... | |
virtual bool | isPacketTimeout ()=0 |
The function that checks whether packet timeout is occurred The function checks whether current time is passed by the time of packet timeout from the time set by PortHandlerLinux::setPacketTimeout(). More... | |
virtual bool | openPort ()=0 |
The function that opens the port The function calls PortHandlerLinux::setBaudRate() to open the port. More... | |
virtual int | readPort (uint8_t *packet, int length)=0 |
The function that reads bytes from the port buffer The function gets bytes from the port buffer, and returns a number of bytes read. More... | |
virtual bool | setBaudRate (const int baudrate)=0 |
The function that sets baudrate into the port handler The function sets baudrate into the port handler. More... | |
virtual void | setPacketTimeout (uint16_t packet_length)=0 |
The function that sets and starts stopwatch for watching packet timeout The function sets the stopwatch by getting current time and the time of packet timeout with packet_length. More... | |
virtual void | setPacketTimeout (double msec)=0 |
The function that sets and starts stopwatch for watching packet timeout The function sets the stopwatch by getting current time and the time of packet timeout with msec. More... | |
virtual void | setPortName (const char *port_name)=0 |
The function that sets port name into the port handler The function sets port name into the port handler. More... | |
virtual int | writePort (uint8_t *packet, int length)=0 |
The function that writes bytes on the port buffer The function writes bytes on the port buffer, and returns a number of bytes which are successfully written. More... | |
virtual | ~PortHandler () |
Static Public Member Functions | |
static PortHandler * | getPortHandler (const char *port_name) |
The function that gets PortHandler class inheritance The function gets class inheritance (PortHandlerLinux / PortHandlerWindows / PortHandlerMac / PortHandlerArduino. More... | |
Public Attributes | |
bool | is_using_ |
shows whether the port is in use More... | |
Static Public Attributes | |
static const int | DEFAULT_BAUDRATE_ = 57600 |
Default Baudrate. More... | |
The class for port control that inherits PortHandlerLinux, PortHandlerWindows, PortHandlerMac, or PortHandlerArduino.
Definition at line 56 of file port_handler.h.
|
inlinevirtual |
Definition at line 69 of file port_handler.h.
|
pure virtual |
The function that clears the port The function clears the port.
Implemented in dynamixel::PortHandlerArduino, dynamixel::PortHandlerWindows, dynamixel::PortHandlerLinux, and dynamixel::PortHandlerMac.
|
pure virtual |
The function that closes the port The function closes the port.
Implemented in dynamixel::PortHandlerArduino, dynamixel::PortHandlerWindows, dynamixel::PortHandlerLinux, and dynamixel::PortHandlerMac.
|
pure virtual |
The function that returns current baudrate set into the port handler The function returns current baudrate set into the port handler.
Implemented in dynamixel::PortHandlerArduino, dynamixel::PortHandlerMac, dynamixel::PortHandlerWindows, and dynamixel::PortHandlerLinux.
|
pure virtual |
The function that checks how much bytes are able to be read from the port buffer The function checks how much bytes are able to be read from the port buffer and returns the number.
Implemented in dynamixel::PortHandlerArduino, dynamixel::PortHandlerMac, dynamixel::PortHandlerWindows, and dynamixel::PortHandlerLinux.
|
static |
The function that gets PortHandler class inheritance The function gets class inheritance (PortHandlerLinux / PortHandlerWindows / PortHandlerMac / PortHandlerArduino.
Definition at line 36 of file port_handler.cpp.
|
pure virtual |
The function that returns port name set into the port handler The function returns current port name set into the port handler.
Implemented in dynamixel::PortHandlerArduino, dynamixel::PortHandlerWindows, dynamixel::PortHandlerLinux, and dynamixel::PortHandlerMac.
|
pure virtual |
The function that checks whether packet timeout is occurred The function checks whether current time is passed by the time of packet timeout from the time set by PortHandlerLinux::setPacketTimeout().
Implemented in dynamixel::PortHandlerArduino, dynamixel::PortHandlerMac, dynamixel::PortHandlerWindows, and dynamixel::PortHandlerLinux.
|
pure virtual |
The function that opens the port The function calls PortHandlerLinux::setBaudRate() to open the port.
Implemented in dynamixel::PortHandlerArduino, dynamixel::PortHandlerWindows, dynamixel::PortHandlerLinux, and dynamixel::PortHandlerMac.
|
pure virtual |
The function that reads bytes from the port buffer The function gets bytes from the port buffer, and returns a number of bytes read.
packet | Buffer for the packet received |
length | Length of the buffer for read |
Implemented in dynamixel::PortHandlerArduino, dynamixel::PortHandlerMac, dynamixel::PortHandlerWindows, and dynamixel::PortHandlerLinux.
|
pure virtual |
The function that sets baudrate into the port handler The function sets baudrate into the port handler.
baudrate | Baudrate |
Implemented in dynamixel::PortHandlerArduino, dynamixel::PortHandlerWindows, dynamixel::PortHandlerLinux, and dynamixel::PortHandlerMac.
|
pure virtual |
The function that sets and starts stopwatch for watching packet timeout The function sets the stopwatch by getting current time and the time of packet timeout with packet_length.
packet_length | Length of the packet expected to be received |
Implemented in dynamixel::PortHandlerArduino, dynamixel::PortHandlerMac, dynamixel::PortHandlerWindows, and dynamixel::PortHandlerLinux.
|
pure virtual |
The function that sets and starts stopwatch for watching packet timeout The function sets the stopwatch by getting current time and the time of packet timeout with msec.
packet_length | Length of the packet expected to be received |
Implemented in dynamixel::PortHandlerArduino, dynamixel::PortHandlerMac, dynamixel::PortHandlerWindows, and dynamixel::PortHandlerLinux.
|
pure virtual |
The function that sets port name into the port handler The function sets port name into the port handler.
port_name | Port name |
Implemented in dynamixel::PortHandlerArduino, dynamixel::PortHandlerWindows, dynamixel::PortHandlerLinux, and dynamixel::PortHandlerMac.
|
pure virtual |
The function that writes bytes on the port buffer The function writes bytes on the port buffer, and returns a number of bytes which are successfully written.
packet | Buffer which would be written on the port buffer |
length | Length of the buffer for write |
Implemented in dynamixel::PortHandlerArduino, dynamixel::PortHandlerMac, dynamixel::PortHandlerWindows, and dynamixel::PortHandlerLinux.
|
static |
Default Baudrate.
Definition at line 59 of file port_handler.h.
bool dynamixel::PortHandler::is_using_ |
shows whether the port is in use
Definition at line 67 of file port_handler.h.