ric_interface.h
Go to the documentation of this file.
1 //
2 // Created by Eli Eli on 18/11/2017.
3 //
4 
5 #ifndef RIC_INTERFACE_BOARD_MANAGER_H
6 #define RIC_INTERFACE_BOARD_MANAGER_H
7 
8 #include "communicator.h"
9 #include "timer.h"
10 #include "protocol.h"
11 #include "sensors_state.h"
12 #include <math.h>
13 #include <string.h>
14 #include <iostream>
15 
16 namespace ric_interface
17 {
19  {
20  private:
21  const int SEND_KA_TIMEOUT = 300; //ms
22  const int GET_KA_TIMEOUT = 1500; //ms
23 
24  /* is board sent keep alive on time */
25  bool is_board_alive_ = true, got_keepalive_ = false;
30 
31  void readAndHandlePkg();
32  void checkKeepAliveFromRic();
33  void sendKeepAlive();
34  void clearBuffer();
35 
36  public:
37  RicInterface();
38  void connect(std::string port);
39  void loop();
40  bool isBoardAlive() { return is_board_alive_; }
42  void writeCmd(const protocol::actuator &actu_pkg, size_t size, protocol::Type type);
43  };
44 }
45 
46 
47 
48 #endif //RIC_INTERFACE_BOARD_MANAGER_H
uint8_t byte
Definition: communicator.h:18
byte pkg_buff_[protocol::MAX_PKG_SIZE]
Definition: ric_interface.h:29
const uint16_t MAX_PKG_SIZE
Definition: protocol.h:22
void connect(std::string port)
void writeCmd(const protocol::actuator &actu_pkg, size_t size, protocol::Type type)
Definition: timer.h:10
sensors_state getSensorsState()
Definition: ric_interface.h:41


ric_interface
Author(s):
autogenerated on Wed Jan 3 2018 03:48:20