mirror of
https://github.com/ArduPilot/ardupilot
synced 2025-01-03 22:48:29 -04:00
a057a8a009
very simple protocol to receive RC cmds via UDP Add support for it on the bebop
25 lines
533 B
C++
25 lines
533 B
C++
|
|
#ifndef _AP_HAL_LINUX_RCINPUT_UDP_H
|
|
#define _AP_HAL_LINUX_RCINPUT_UDP_H
|
|
|
|
#include "RCInput.h"
|
|
#include <AP_HAL/utility/Socket.h>
|
|
#include "RCInput_UDP_Protocol.h"
|
|
|
|
#define RCINPUT_UDP_DEF_PORT 777
|
|
|
|
class Linux::LinuxRCInput_UDP : public Linux::LinuxRCInput
|
|
{
|
|
public:
|
|
LinuxRCInput_UDP();
|
|
void init(void*);
|
|
void _timer_tick(void);
|
|
private:
|
|
SocketAPM _socket{true};
|
|
uint16_t _port;
|
|
struct rc_udp_packet _buf;
|
|
uint64_t _last_buf_ts;
|
|
uint16_t _last_buf_seq;
|
|
};
|
|
#endif // _AP_HAL_LINUX_RCINPUT_UDP_H
|