Skip to content

Commit 38c7702

Browse files
committed
AP_Networking: handle PPP software flow control
1 parent 608d2fa commit 38c7702

9 files changed

Lines changed: 1072 additions & 17 deletions

libraries/AP_Networking/AP_Networking.cpp

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -81,8 +81,7 @@ const AP_Param::GroupInfo AP_Networking::var_info[] = {
8181
// @Param: TESTS
8282
// @DisplayName: Test enable flags
8383
// @Description: Enable/Disable networking tests
84-
// @Bitmask: 0:UDP echo test,1:TCP echo test, 2:TCP discard test, 3:TCP reflect test
85-
// @RebootRequired: True
84+
// @Bitmask: 0:UDP echo test,1:TCP echo test,2:TCP discard test,3:TCP reflect test,4:Connector loopback test,5:TCP discard server,6:15-second TCP discard test
8685
// @User: Advanced
8786
AP_GROUPINFO("TESTS", 7, AP_Networking, param.tests, 0),
8887

@@ -93,8 +92,8 @@ const AP_Param::GroupInfo AP_Networking::var_info[] = {
9392

9493
// @Param: OPTIONS
9594
// @DisplayName: Networking options
96-
// @Description: Networking options
97-
// @Bitmask: 0:EnablePPP Ethernet gateway, 1:Enable CAN1 multicast endpoint, 2:Enable CAN2 multicast endpoint, 3:Enable CAN1 multicast bridged, 4:Enable CAN2 multicast bridged, 5:DisablePPPTimeout, 6:DisablePPPEchoLimit, 7:Capture to file
95+
// @Description: Networking options. PPP software flow control must be enabled on both PPP endpoints
96+
// @Bitmask: 0:EnablePPP Ethernet gateway, 1:Enable CAN1 multicast endpoint, 2:Enable CAN2 multicast endpoint, 3:Enable CAN1 multicast bridged, 4:Enable CAN2 multicast bridged, 5:DisablePPPTimeout, 6:DisablePPPEchoLimit, 7:Capture to file, 8:Enable PPP software flow control
9897
// @RebootRequired: True
9998
// @User: Advanced
10099
AP_GROUPINFO("OPTIONS", 9, AP_Networking, param.options, 0),
@@ -267,6 +266,9 @@ void AP_Networking::update()
267266
}
268267
backend->update();
269268
announce_address_changes();
269+
#if AP_NETWORKING_TESTS_ENABLED
270+
start_tests();
271+
#endif
270272
}
271273

272274
uint32_t AP_Networking::convert_netmask_bitcount_to_ip(const uint32_t netmask_bitcount)

libraries/AP_Networking/AP_Networking.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -177,6 +177,7 @@ class AP_Networking
177177
#if AP_NETWORKING_CAPTURE_ENABLED
178178
CAPTURE_PACKETS=(1U<<7),
179179
#endif
180+
PPP_SOFTWARE_FLOW_CONTROL=(1U<<8),
180181
};
181182
bool option_is_set(OPTION option) const {
182183
return (param.options.get() & int32_t(option)) != 0;
@@ -330,12 +331,17 @@ class AP_Networking
330331
TEST_TCP_DISCARD = (1U<<2),
331332
TEST_TCP_REFLECT = (1U<<3),
332333
TEST_CONNECTOR_LOOPBACK = (1U<<4),
334+
TEST_TCP_DISCARD_SERVER = (1U<<5),
335+
TEST_TCP_DISCARD_ONESHOT = (1U<<6),
333336
};
337+
uint32_t tests_started = 0;
334338
void start_tests(void);
335339
void test_UDP_client(void);
336340
void test_TCP_client(void);
337341
void test_TCP_discard(void);
342+
void test_TCP_discard_oneshot(void);
338343
void test_TCP_reflect(void);
344+
void test_TCP_discard_server(void);
339345
void test_connector_loopback(void);
340346
#endif // AP_NETWORKING_TESTS_ENABLED
341347

0 commit comments

Comments
 (0)