diff --git a/libraries/AP_Networking/AP_Networking.h b/libraries/AP_Networking/AP_Networking.h index f5db359962..128e6c2c29 100644 --- a/libraries/AP_Networking/AP_Networking.h +++ b/libraries/AP_Networking/AP_Networking.h @@ -205,6 +205,7 @@ private: TCP_SERVER = 4, }; +#if AP_NETWORKING_REGISTER_PORT_ENABLED // class for NET_Pn_* parameters class Port : public AP_SerialManager::RegisteredPort { public: @@ -270,6 +271,7 @@ private: HAL_Semaphore sem; }; +#endif // AP_NETWORKING_REGISTER_PORT_ENABLED private: uint32_t announce_ms; @@ -286,8 +288,10 @@ private: void test_TCP_discard(void); #endif // AP_NETWORKING_TESTS_ENABLED +#if AP_NETWORKING_REGISTER_PORT_ENABLED // ports for registration with serial manager Port ports[AP_NETWORKING_NUM_PORTS]; +#endif // support for sendfile() struct SendFile { diff --git a/libraries/AP_Networking/AP_Networking_Config.h b/libraries/AP_Networking/AP_Networking_Config.h index d9d8532eef..5b66134957 100644 --- a/libraries/AP_Networking/AP_Networking_Config.h +++ b/libraries/AP_Networking/AP_Networking_Config.h @@ -1,4 +1,5 @@ #include +#include #if defined(AP_NETWORKING_BACKEND_PPP) && !defined(AP_NETWORKING_ENABLED) // allow --enable-ppp to enable networking @@ -133,3 +134,6 @@ #define AP_NETWORKING_REMOTE_PPP_IP "0.0.0.0" #endif +#ifndef AP_NETWORKING_REGISTER_PORT_ENABLED +#define AP_NETWORKING_REGISTER_PORT_ENABLED AP_NETWORKING_ENABLED && AP_SERIALMANAGER_REGISTER_ENABLED +#endif diff --git a/libraries/AP_Networking/AP_Networking_port.cpp b/libraries/AP_Networking/AP_Networking_port.cpp index 1074d89635..07c35ab070 100644 --- a/libraries/AP_Networking/AP_Networking_port.cpp +++ b/libraries/AP_Networking/AP_Networking_port.cpp @@ -4,7 +4,7 @@ #include "AP_Networking_Config.h" -#if AP_NETWORKING_ENABLED +#if AP_NETWORKING_REGISTER_PORT_ENABLED #include "AP_Networking.h" #include @@ -476,4 +476,6 @@ enum AP_HAL::UARTDriver::flow_control AP_Networking::Port::get_flow_control(void return AP_HAL::UARTDriver::FLOW_CONTROL_DISABLE; } -#endif // AP_NETWORKING_ENABLED +#endif // AP_NETWORKING_REGISTER_PORT_ENABLED + +