22 #ifndef DYNAMIXEL_SDK_INCLUDE_DYNAMIXEL_SDK_ARDUINO_PORTHANDLERARDUINO_H_ 23 #define DYNAMIXEL_SDK_INCLUDE_DYNAMIXEL_SDK_ARDUINO_PORTHANDLERARDUINO_H_ 25 #if defined(ARDUINO) || defined(__OPENCR__) || defined (__OPENCM904__) 48 #if defined(__OPENCM904__) 49 UARTClass *p_dxl_serial;
145 int readPort(uint8_t *packet,
int length);
157 int writePort(uint8_t *packet,
int length);
int writePort(uint8_t *packet, int length)
The function that writes bytes on the port buffer The function writes bytes on the port buffer...
bool setupPort(const int cflag_baud)
void setPacketTimeout(uint16_t packet_length)
The function that sets and starts stopwatch for watching packet timeout The function sets the stopwa...
int checkBaudrateAvailable(int baudrate)
int readPort(uint8_t *packet, int length)
The function that reads bytes from the port buffer The function gets bytes from the port buffer...
double getTimeSinceStart()
int getBaudRate()
The function that returns current baudrate set into the port handler The function returns current ba...
void closePort()
The function that closes the port The function closes the port.
The class for control port in Arduino.
bool setBaudRate(const int baudrate)
The function that sets baudrate into the port handler The function sets baudrate into the port handl...
PortHandlerArduino(const char *port_name)
The function that initializes instance of PortHandler and gets port_name The function initializes in...
The class for port control that inherits PortHandlerLinux, PortHandlerWindows, PortHandlerMac, or PortHandlerArduino.
bool openPort()
The function that opens the port The function calls PortHandlerArduino::setBaudRate() to open the po...
int getBytesAvailable()
The function that checks how much bytes are able to be read from the port buffer The function checks...
virtual ~PortHandlerArduino()
The function that closes the port The function calls PortHandlerArduino::closePort() to close the po...
void clearPort()
The function that clears the port The function clears the port.
char * getPortName()
The function that returns port name set into the port handler The function returns current port name...
double packet_start_time_
void setPortName(const char *port_name)
The function that sets port name into the port handler The function sets port name into the port han...
bool isPacketTimeout()
The function that checks whether packet timeout is occurred The function checks whether current time...