-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathPX4.h
45 lines (37 loc) · 1.45 KB
/
PX4.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
/************************************************************/
/* NAME: David Battle */
/* ORGN: Mission Systems Pty Ltd */
/* (based on ArduSubComms by Muthukumaran Chandrasekaran)*/
/* FILE: PX4.cpp */
/* DATE: 14 Dec 2018 */
/************************************************************/
#ifndef PX4_HEADER
#define PX4_HEADER
#include "MOOS/libMOOS/MOOSLib.h"
#include <boost/asio.hpp>
using boost::asio::ip::udp;
class PX4 : public CMOOSApp
{
public:
PX4();
~PX4();
protected: // Standard MOOSApp functions to overload
bool OnNewMail(MOOSMSG_LIST &NewMail);
bool Iterate();
bool OnConnectToServer();
bool OnStartUp();
protected:
void RegisterVariables();
private: // State variables
bool m_udp_mode;
unsigned char* m_buf;
std::string m_udp_host;
std::string m_udp_port;
std::string m_serial_name;
unsigned int m_serial_baud;
boost::asio::io_service m_io;
boost::shared_ptr<boost::asio::serial_port> m_serial;
boost::shared_ptr<udp::socket> m_udp;
udp::endpoint m_sender_endpoint;
};
#endif