Galaxis Codebase  1.0.0
Team Galaxis software stack for the Carolo Cup 2023 - ROS2 based software
UART.hpp
Go to the documentation of this file.
1 #pragma once
2 
3 #include "com/ICommunication.h"
4 #include <cstddef> // for size_t
5 
6 class UART : public ICommunication {
7 public:
8  /*
9  * Defaulted default constructor: the compiler will define the implicit
10  * default constructor even if other constructors are present
11  */
12  UART() = default;
13 
14  ~UART() override;
15 
16  /*
17  * Establish connection with peer
18  * using the current communication protocol
19  */
20  void VConnect() override;
21 
22  /*
23  * Closes the communication to the device
24  * the software is connected to
25  */
26  void VDisconnect() override;
27 
28  /*
29  * Transfer the gi ven data using the
30  * current communication protocol
31  */
32  size_t VSendData(void*, const size_t) override;
33 
34  /*
35  * Reads from the device and provides the data read
36  */
37  size_t VReceiveData(void*, const size_t) override;
38 
39 protected:
40  /*
41  * tty file descriptor
42  */
43  int tty_fd;
44 };
45 /*vim:set et sw=2 ts=2 tw=80:*/
UART
Definition: UART.hpp:6
UART::UART
UART()=default
UART::VConnect
void VConnect() override
Definition: UART.cpp:22
ICommunication.h
UART::VSendData
size_t VSendData(void *, const size_t) override
Definition: UART.cpp:118
UART::tty_fd
int tty_fd
Definition: UART.hpp:43
UART::VDisconnect
void VDisconnect() override
Definition: UART.cpp:109
ICommunication
Definition: ICommunication.h:5
UART::~UART
~UART() override
Definition: UART.cpp:19
UART::VReceiveData
size_t VReceiveData(void *, const size_t) override
Definition: UART.cpp:123