2016-02-17 21:25:26 -04:00
|
|
|
#pragma once
|
2015-09-04 13:37:09 -03:00
|
|
|
|
|
|
|
#include "RCInput.h"
|
2023-12-25 22:21:11 -04:00
|
|
|
#include <AP_HAL/utility/Socket_native.h>
|
2015-09-04 13:37:09 -03:00
|
|
|
#include "RCInput_UDP_Protocol.h"
|
|
|
|
|
|
|
|
#define RCINPUT_UDP_DEF_PORT 777
|
|
|
|
|
2016-07-29 16:14:02 -03:00
|
|
|
namespace Linux {
|
|
|
|
|
|
|
|
class RCInput_UDP : public RCInput
|
2015-09-04 13:37:09 -03:00
|
|
|
{
|
|
|
|
public:
|
2015-10-20 18:13:25 -03:00
|
|
|
RCInput_UDP();
|
2019-02-21 19:08:12 -04:00
|
|
|
void init() override;
|
|
|
|
void _timer_tick(void) override;
|
2015-09-04 13:37:09 -03:00
|
|
|
private:
|
|
|
|
SocketAPM _socket{true};
|
|
|
|
uint16_t _port;
|
2020-01-15 08:22:35 -04:00
|
|
|
struct rc_udp_packet_v3 _buf;
|
2015-09-04 13:37:09 -03:00
|
|
|
uint64_t _last_buf_ts;
|
|
|
|
uint16_t _last_buf_seq;
|
|
|
|
};
|
2016-07-29 16:14:02 -03:00
|
|
|
|
|
|
|
}
|