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,
};
#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 {

View File

@ -1,4 +1,5 @@
#include <AP_HAL/AP_HAL_Boards.h>
#include <AP_SerialManager/AP_SerialManager_config.h>
#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

View File

@ -4,7 +4,7 @@
#include "AP_Networking_Config.h"
#if AP_NETWORKING_ENABLED
#if AP_NETWORKING_REGISTER_PORT_ENABLED
#include "AP_Networking.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;
}
#endif // AP_NETWORKING_ENABLED
#endif // AP_NETWORKING_REGISTER_PORT_ENABLED