Program Listing for File state_socket.hpp

Return to documentation for file (inc/state_socket.hpp)

#ifndef STATESOCKET_HPP
#define STATESOCKET_HPP

#include "base_socket.hpp"

class StateSocket : public BaseSocket{
public:

  StateSocket(asio::io_service& io_service, const std::string& drone_ip, const std::string& drone_port, const std::string& local_port);
  ~StateSocket();

private:

  virtual void handleResponseFromDrone(const std::error_code& error, size_t bytes_recvd) override;
  virtual void handleSendCommand(const std::error_code& error, size_t bytes_sent, std::string cmd) override;

  enum{ max_length_ = 1024 };
  bool received_response_ = true;
  char data_[max_length_];
  std::string response_;

};

#endif // STATESOCKET_HPP