RCInput_UDP.h 441 B

12345678910111213141516171819202122232425
  1. #pragma once
  2. #include "RCInput.h"
  3. #include <AP_HAL/utility/Socket.h>
  4. #include "RCInput_UDP_Protocol.h"
  5. #define RCINPUT_UDP_DEF_PORT 777
  6. namespace Linux {
  7. class RCInput_UDP : public RCInput
  8. {
  9. public:
  10. RCInput_UDP();
  11. void init() override;
  12. void _timer_tick(void) override;
  13. private:
  14. SocketAPM _socket{true};
  15. uint16_t _port;
  16. struct rc_udp_packet _buf;
  17. uint64_t _last_buf_ts;
  18. uint16_t _last_buf_seq;
  19. };
  20. }