From 2cb177ef7260d5877bbe6c79c8112c677a076c3b Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Sun, 10 Dec 2023 07:11:24 +1100 Subject: [PATCH] AP_SerialManager: added PPP serial type --- libraries/AP_SerialManager/AP_SerialManager.cpp | 9 ++++++++- libraries/AP_SerialManager/AP_SerialManager.h | 1 + libraries/AP_SerialManager/AP_SerialManager_config.h | 5 +++++ 3 files changed, 14 insertions(+), 1 deletion(-) diff --git a/libraries/AP_SerialManager/AP_SerialManager.cpp b/libraries/AP_SerialManager/AP_SerialManager.cpp index 24a694e2d0..3d2ed06f5a 100644 --- a/libraries/AP_SerialManager/AP_SerialManager.cpp +++ b/libraries/AP_SerialManager/AP_SerialManager.cpp @@ -580,7 +580,14 @@ void AP_SerialManager::init() uart->set_unbuffered_writes(true); break; #endif - +#if AP_NETWORKING_BACKEND_PPP + case SerialProtocol_PPP: + uart->begin(state[i].baudrate(), + AP_SERIALMANAGER_PPP_BUFSIZE_RX, + AP_SERIALMANAGER_PPP_BUFSIZE_TX); + break; +#endif + default: uart->begin(state[i].baudrate()); } diff --git a/libraries/AP_SerialManager/AP_SerialManager.h b/libraries/AP_SerialManager/AP_SerialManager.h index 30bae549f6..d569d1f066 100644 --- a/libraries/AP_SerialManager/AP_SerialManager.h +++ b/libraries/AP_SerialManager/AP_SerialManager.h @@ -81,6 +81,7 @@ public: SerialProtocol_DDS_XRCE = 45, SerialProtocol_IMUOUT = 46, // Reserving Serial Protocol 47 for SerialProtocol_IQ + SerialProtocol_PPP = 48, SerialProtocol_NumProtocols // must be the last value }; diff --git a/libraries/AP_SerialManager/AP_SerialManager_config.h b/libraries/AP_SerialManager/AP_SerialManager_config.h index 88bf3ccaa3..a09a2995a0 100644 --- a/libraries/AP_SerialManager/AP_SerialManager_config.h +++ b/libraries/AP_SerialManager/AP_SerialManager_config.h @@ -137,6 +137,11 @@ #define AP_SERIALMANAGER_IMUOUT_BUFSIZE_RX 128 #define AP_SERIALMANAGER_IMUOUT_BUFSIZE_TX 2048 +// PPP protocol +#define AP_SERIALMANAGER_PPP_BAUD 921600 +#define AP_SERIALMANAGER_PPP_BUFSIZE_RX 4096 +#define AP_SERIALMANAGER_PPP_BUFSIZE_TX 4096 + #ifndef HAL_HAVE_SERIAL0 #define HAL_HAVE_SERIAL0 HAL_NUM_SERIAL_PORTS > 0 #endif