Aruna
Link.h
Go to the documentation of this file.
1 //
2 // Created by noeel on 14-1-19.
3 //
4 
5 #ifndef ARUNA_COMMLINK_H
6 #define ARUNA_COMMLINK_H
7 
8 #include "aruna/arunaTypes.h"
9 #include <aruna/comm/commTypes.h>
10 
11 namespace aruna::comm {
12  class Link {
13  private:
20  virtual size_t _write(uint8_t *data, size_t data_size) = 0;
21 
28  virtual size_t _read(uint8_t *buffer, size_t buffer_size) = 0;
29 
30  public:
32 
39  size_t transmit(uint8_t *package, size_t package_size);
40 
47  size_t receive(uint8_t *buffer, size_t buffer_size);
48 
49 // TODO allow to receive and transmit comm_package directly.
50 // TODO write IO abstraction driver for all read an write functionality so I2C_Master, UART an Link can all inherit from it.
51 
56  virtual uint32_t get_speed() = 0;
57 
62  bool is_connected();
63 
64  };
65 
66 }
67 #endif //ARUNA_COMMLINK_H