CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutSign UpSign In
Ardupilot

Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place. Commercial Alternative to JupyterHub.

GitHub Repository: Ardupilot/ardupilot
Path: blob/master/Tools/AP_Periph/networking.h
Views: 1798
1
#pragma once
2
3
#include <AP_HAL/AP_HAL_Boards.h>
4
5
#ifdef HAL_PERIPH_ENABLE_NETWORKING
6
7
#include <AP_Networking/AP_Networking.h>
8
9
#ifndef HAL_PERIPH_NETWORK_NUM_PASSTHRU
10
#define HAL_PERIPH_NETWORK_NUM_PASSTHRU 2
11
#endif
12
13
#ifndef AP_PERIPH_NET_PPP_PORT_DEFAULT
14
#define AP_PERIPH_NET_PPP_PORT_DEFAULT -1
15
#endif
16
17
#ifndef AP_PERIPH_NET_PPP_BAUD_DEFAULT
18
#define AP_PERIPH_NET_PPP_BAUD_DEFAULT 12500000
19
#endif
20
21
class Networking_Periph {
22
public:
23
Networking_Periph() {
24
AP_Param::setup_object_defaults(this, var_info);
25
}
26
27
static const struct AP_Param::GroupInfo var_info[];
28
29
void init();
30
void update();
31
32
private:
33
34
#if HAL_PERIPH_NETWORK_NUM_PASSTHRU > 0
35
class Passthru {
36
public:
37
friend class Networking_Periph;
38
39
CLASS_NO_COPY(Passthru);
40
41
Passthru() {
42
AP_Param::setup_object_defaults(this, var_info);
43
}
44
45
void init();
46
void update();
47
48
static const struct AP_Param::GroupInfo var_info[];
49
50
private:
51
AP_Int8 enabled;
52
AP_Int8 ep1;
53
AP_Int8 ep2;
54
AP_Int32 baud1;
55
AP_Int32 baud2;
56
AP_Int32 options1;
57
AP_Int32 options2;
58
59
AP_HAL::UARTDriver *port1;
60
AP_HAL::UARTDriver *port2;
61
} passthru[HAL_PERIPH_NETWORK_NUM_PASSTHRU];
62
#endif // HAL_PERIPH_NETWORK_NUM_PASSTHRU
63
64
AP_Networking networking_lib;
65
bool got_addresses;
66
67
#if AP_NETWORKING_BACKEND_PPP
68
AP_Int8 ppp_port;
69
AP_Int32 ppp_baud;
70
#endif
71
};
72
73
#endif // HAL_PERIPH_ENABLE_NETWORKING
74
75