APM:Libraries
libraries
AP_HAL_Linux
RCInput_SoloLink.h
Go to the documentation of this file.
1
/*
2
* Copyright (C) 2017 Intel Corporation. All rights reserved.
3
*
4
* This file is free software: you can redistribute it and/or modify it
5
* under the terms of the GNU General Public License as published by the
6
* Free Software Foundation, either version 3 of the License, or
7
* (at your option) any later version.
8
*
9
* This file is distributed in the hope that it will be useful, but
10
* WITHOUT ANY WARRANTY; without even the implied warranty of
11
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
12
* See the GNU General Public License for more details.
13
*
14
* You should have received a copy of the GNU General Public License along
15
* with this program. If not, see <http://www.gnu.org/licenses/>.
16
*/
17
#pragma once
18
19
#include <unistd.h>
20
21
#include <
AP_HAL/utility/Socket.h
>
22
#include <
AP_HAL/utility/sparse-endian.h
>
23
24
#include "
RCInput.h
"
25
26
namespace
Linux
{
27
28
class
RCInput_SoloLink
:
public
RCInput
29
{
30
public
:
31
RCInput_SoloLink
();
32
33
void
init
();
34
void
_timer_tick
();
35
36
private
:
37
static
const
unsigned
int
PACKET_LEN
= 26;
38
static
const
unsigned
int
PORT
= 5005;
39
40
union
packet
{
41
struct
PACKED
{
42
uint64_t
timestamp_usec
;
43
le16_t
seq
;
44
le16_t
channel
[8];
45
};
46
uint8_t
buf
[
PACKET_LEN
];
47
};
48
49
bool
_check_hdr
(ssize_t len);
50
51
SocketAPM
_socket
{
true
};
52
uint64_t
_last_usec
= 0;
53
uint16_t
_last_seq
= 0;
54
union
packet
_packet
;
55
};
56
57
}
Linux::RCInput
Definition:
RCInput.h:11
Linux::RCInput_SoloLink::_last_seq
uint16_t _last_seq
Definition:
RCInput_SoloLink.h:53
Linux::RCInput_SoloLink::packet::buf
uint8_t buf[PACKET_LEN]
Definition:
RCInput_SoloLink.h:46
Linux::RCInput_SoloLink::RCInput_SoloLink
RCInput_SoloLink()
Definition:
RCInput_SoloLink.cpp:36
Linux::RCInput_SoloLink::packet::PACKED::channel
le16_t channel[8]
Definition:
RCInput_SoloLink.h:44
Linux::RCInput_SoloLink::packet::PACKED::timestamp_usec
uint64_t timestamp_usec
Definition:
RCInput_SoloLink.h:42
Linux::RCInput_SoloLink::_socket
SocketAPM _socket
Definition:
RCInput_SoloLink.h:51
Linux::RCInput_SoloLink
Definition:
RCInput_SoloLink.h:28
Linux::RCInput_SoloLink::_packet
union packet _packet
Definition:
RCInput_SoloLink.h:54
Linux::RCInput_SoloLink::_last_usec
uint64_t _last_usec
Definition:
RCInput_SoloLink.h:52
Linux::RCInput_SoloLink::packet::PACKED::seq
le16_t seq
Definition:
RCInput_SoloLink.h:43
Linux::RCInput_SoloLink::PACKET_LEN
static const unsigned int PACKET_LEN
Definition:
RCInput_SoloLink.h:37
Linux::RCInput_SoloLink::packet::PACKED
Definition:
RCInput_SoloLink.h:41
RCInput.h
Linux::RCInput_SoloLink::_timer_tick
void _timer_tick()
Definition:
RCInput_SoloLink.cpp:79
Linux::RCInput_SoloLink::init
void init()
Definition:
RCInput_SoloLink.cpp:41
Linux::RCInput_SoloLink::packet
Definition:
RCInput_SoloLink.h:40
le16_t
uint16_t __ap_bitwise le16_t
Definition:
sparse-endian.h:35
Linux::RCInput_SoloLink::_check_hdr
bool _check_hdr(ssize_t len)
Definition:
RCInput_SoloLink.cpp:53
Linux
Definition:
CameraSensor.h:19
sparse-endian.h
Linux::RCInput_SoloLink::PORT
static const unsigned int PORT
Definition:
RCInput_SoloLink.h:38
Socket.h
Generated on Sun Jun 17 2018 14:18:49 for APM:Libraries by
1.8.13