Aruna
aruna::comm::Link Class Referenceabstract

#include <Link.h>

Inheritance diagram for aruna::comm::Link:

Public Member Functions

size_t transmit (uint8_t *package, size_t package_size)
 directly transmit a package on the link. More...
 
size_t receive (uint8_t *buffer, size_t buffer_size)
 Read data from the receive buffer. More...
 
virtual uint32_t get_speed ()=0
 Get speed of link (bits per second) More...
 
bool is_connected ()
 Does the link have an active connection with a client? More...
 

Public Attributes

err_t startup_error = err_t::NOT_STARTED
 

Private Member Functions

virtual size_t _write (uint8_t *data, size_t data_size)=0
 write data to the link/bus. More...
 
virtual size_t _read (uint8_t *buffer, size_t buffer_size)=0
 Read bytes and out them in the buffer. More...
 

Detailed Description

Definition at line 12 of file Link.h.

Member Function Documentation

◆ _read()

virtual size_t aruna::comm::Link::_read ( uint8_t *  buffer,
size_t  buffer_size 
)
privatepure virtual

Read bytes and out them in the buffer.

Parameters
bufferbuffer to read
buffer_sizeamount of bytes to read
Returns
amount of byte read

Implemented in aruna::driver::POSIX_UART, and aruna::driver::ESP32_UART.

Here is the caller graph for this function:

◆ _write()

virtual size_t aruna::comm::Link::_write ( uint8_t *  data,
size_t  data_size 
)
privatepure virtual

write data to the link/bus.

Parameters
databytes to write
data_sizelength of data
Returns
amount of bytes written.

Implemented in aruna::driver::POSIX_UART, and aruna::driver::ESP32_UART.

Here is the caller graph for this function:

◆ get_speed()

virtual uint32_t aruna::comm::Link::get_speed ( )
pure virtual

Get speed of link (bits per second)

Returns
unsigned int speed in Bytes per second.

Implemented in aruna::driver::UART.

Here is the caller graph for this function:

◆ is_connected()

bool aruna::comm::Link::is_connected ( )

Does the link have an active connection with a client?

Returns
true/false

Definition at line 17 of file Link.cpp.

17  {
18 // TODO implement
19  return true;
20  }
Here is the caller graph for this function:

◆ receive()

size_t aruna::comm::Link::receive ( uint8_t *  buffer,
size_t  buffer_size 
)

Read data from the receive buffer.

Parameters
bufferwrite received data to buffer
buffer_sizeamounts of bytes to read
Returns
amount of bytes received.

Definition at line 13 of file Link.cpp.

13  {
14  return _read(buffer, buffer_size);
15  }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ transmit()

size_t aruna::comm::Link::transmit ( uint8_t *  package,
size_t  package_size 
)

directly transmit a package on the link.

Parameters
packagepackage to be send
package_sizesize of the package
Returns

Definition at line 9 of file Link.cpp.

9  {
10  return _write(package, package_size);
11  }
Here is the call graph for this function:
Here is the caller graph for this function:

Member Data Documentation

◆ startup_error

err_t aruna::comm::Link::startup_error = err_t::NOT_STARTED

Definition at line 31 of file Link.h.


The documentation for this class was generated from the following files: