AP_Networking: fixed network bootloader without serial manager

This commit is contained in:
Andrew Tridgell 2024-01-24 15:43:53 +11:00
parent 967af533b9
commit 1be9c79e35
3 changed files with 12 additions and 2 deletions

View File

@ -205,6 +205,7 @@ private:
TCP_SERVER = 4, TCP_SERVER = 4,
}; };
#if AP_NETWORKING_REGISTER_PORT_ENABLED
// class for NET_Pn_* parameters // class for NET_Pn_* parameters
class Port : public AP_SerialManager::RegisteredPort { class Port : public AP_SerialManager::RegisteredPort {
public: public:
@ -270,6 +271,7 @@ private:
HAL_Semaphore sem; HAL_Semaphore sem;
}; };
#endif // AP_NETWORKING_REGISTER_PORT_ENABLED
private: private:
uint32_t announce_ms; uint32_t announce_ms;
@ -286,8 +288,10 @@ private:
void test_TCP_discard(void); void test_TCP_discard(void);
#endif // AP_NETWORKING_TESTS_ENABLED #endif // AP_NETWORKING_TESTS_ENABLED
#if AP_NETWORKING_REGISTER_PORT_ENABLED
// ports for registration with serial manager // ports for registration with serial manager
Port ports[AP_NETWORKING_NUM_PORTS]; Port ports[AP_NETWORKING_NUM_PORTS];
#endif
// support for sendfile() // support for sendfile()
struct SendFile { struct SendFile {

View File

@ -1,4 +1,5 @@
#include <AP_HAL/AP_HAL_Boards.h> #include <AP_HAL/AP_HAL_Boards.h>
#include <AP_SerialManager/AP_SerialManager_config.h>
#if defined(AP_NETWORKING_BACKEND_PPP) && !defined(AP_NETWORKING_ENABLED) #if defined(AP_NETWORKING_BACKEND_PPP) && !defined(AP_NETWORKING_ENABLED)
// allow --enable-ppp to enable networking // allow --enable-ppp to enable networking
@ -133,3 +134,6 @@
#define AP_NETWORKING_REMOTE_PPP_IP "0.0.0.0" #define AP_NETWORKING_REMOTE_PPP_IP "0.0.0.0"
#endif #endif
#ifndef AP_NETWORKING_REGISTER_PORT_ENABLED
#define AP_NETWORKING_REGISTER_PORT_ENABLED AP_NETWORKING_ENABLED && AP_SERIALMANAGER_REGISTER_ENABLED
#endif

View File

@ -4,7 +4,7 @@
#include "AP_Networking_Config.h" #include "AP_Networking_Config.h"
#if AP_NETWORKING_ENABLED #if AP_NETWORKING_REGISTER_PORT_ENABLED
#include "AP_Networking.h" #include "AP_Networking.h"
#include <AP_HAL/utility/Socket.h> #include <AP_HAL/utility/Socket.h>
@ -476,4 +476,6 @@ enum AP_HAL::UARTDriver::flow_control AP_Networking::Port::get_flow_control(void
return AP_HAL::UARTDriver::FLOW_CONTROL_DISABLE; return AP_HAL::UARTDriver::FLOW_CONTROL_DISABLE;
} }
#endif // AP_NETWORKING_ENABLED #endif // AP_NETWORKING_REGISTER_PORT_ENABLED