#include <serial_gateway.h>
Public Member Functions | |
virtual bool | connect () |
virtual bool | isConnected () |
virtual void | queue (const Message &msg) |
virtual bool | recv (Message *msg) |
virtual bool | sendAllQueued () |
SerialGateway (serial::Serial &serial) | |
Private Member Functions | |
void | encodeAndQueue (const uint8_t *data, uint8_t len) |
void | queue (uint8_t ch) |
bool | read (uint8_t *ch) |
bool | readAndDecode (uint8_t *data, uint8_t len) |
Private Attributes | |
uint8_t | read_buffer_ [1024] |
uint16_t | read_buffer_index_ |
uint16_t | read_buffer_len_ |
serial::Serial & | serial_ |
uint8_t | write_buffer_ [1024] |
uint16_t | write_buffer_index_ |
Definition at line 35 of file serial_gateway.h.
puma_motor_driver::SerialGateway::SerialGateway | ( | serial::Serial & | serial | ) | [explicit] |
Definition at line 31 of file serial_gateway.cpp.
bool puma_motor_driver::SerialGateway::connect | ( | ) | [virtual] |
Implements puma_motor_driver::Gateway.
Definition at line 39 of file serial_gateway.cpp.
void puma_motor_driver::SerialGateway::encodeAndQueue | ( | const uint8_t * | data, |
uint8_t | len | ||
) | [private] |
Definition at line 184 of file serial_gateway.cpp.
bool puma_motor_driver::SerialGateway::isConnected | ( | ) | [virtual] |
Implements puma_motor_driver::Gateway.
Definition at line 57 of file serial_gateway.cpp.
void puma_motor_driver::SerialGateway::queue | ( | const Message & | msg | ) | [virtual] |
Queue specified message to be sent on the bus.
Implements puma_motor_driver::Gateway.
Definition at line 62 of file serial_gateway.cpp.
void puma_motor_driver::SerialGateway::queue | ( | uint8_t | ch | ) | [private] |
Definition at line 128 of file serial_gateway.cpp.
bool puma_motor_driver::SerialGateway::read | ( | uint8_t * | ch | ) | [private] |
Definition at line 137 of file serial_gateway.cpp.
bool puma_motor_driver::SerialGateway::readAndDecode | ( | uint8_t * | data, |
uint8_t | len | ||
) | [private] |
Definition at line 204 of file serial_gateway.cpp.
bool puma_motor_driver::SerialGateway::recv | ( | Message * | msg | ) | [virtual] |
Receive the next available message from the bus, blocking for timeout_millis if nonzero.
Implements puma_motor_driver::Gateway.
Definition at line 73 of file serial_gateway.cpp.
bool puma_motor_driver::SerialGateway::sendAllQueued | ( | ) | [virtual] |
Send the queued messages on the bus.
Implements puma_motor_driver::Gateway.
Definition at line 159 of file serial_gateway.cpp.
uint8_t puma_motor_driver::SerialGateway::read_buffer_[1024] [private] |
Definition at line 59 of file serial_gateway.h.
uint16_t puma_motor_driver::SerialGateway::read_buffer_index_ [private] |
Definition at line 60 of file serial_gateway.h.
uint16_t puma_motor_driver::SerialGateway::read_buffer_len_ [private] |
Definition at line 61 of file serial_gateway.h.
Definition at line 48 of file serial_gateway.h.
uint8_t puma_motor_driver::SerialGateway::write_buffer_[1024] [private] |
Definition at line 56 of file serial_gateway.h.
uint16_t puma_motor_driver::SerialGateway::write_buffer_index_ [private] |
Definition at line 57 of file serial_gateway.h.