Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AP_Periph: fix network build #25657

Merged
merged 2 commits into from
Nov 29, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion Tools/AP_Periph/AP_Periph.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@
#include <AP_Scripting/AP_Scripting.h>
#include <AP_HAL/CANIface.h>
#include <AP_Stats/AP_Stats.h>
#include <AP_Networking/AP_Networking.h>
#include <AP_RPM/AP_RPM.h>
#include <AP_SerialManager/AP_SerialManager.h>
#include <AP_ESC_Telem/AP_ESC_Telem_config.h>
Expand Down
4 changes: 3 additions & 1 deletion Tools/AP_Periph/networking.h
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
#pragma once

#include "AP_Periph.h"
#include <AP_HAL/AP_HAL_Boards.h>

#ifdef HAL_PERIPH_ENABLE_NETWORKING
magicrub marked this conversation as resolved.
Show resolved Hide resolved

#include <AP_Networking/AP_Networking.h>

#ifndef HAL_PERIPH_NETWORK_NUM_PASSTHRU
#define HAL_PERIPH_NETWORK_NUM_PASSTHRU 2
#endif
Expand Down
2 changes: 1 addition & 1 deletion Tools/AP_Periph/networking_passthru.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/

#include "networking.h"
#include "AP_Periph.h"

#if defined(HAL_PERIPH_ENABLE_NETWORKING) && HAL_PERIPH_NETWORK_NUM_PASSTHRU > 0

Expand Down
2 changes: 2 additions & 0 deletions libraries/AP_Networking/AP_Networking_port.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -353,9 +353,11 @@ bool AP_Networking::Port::send_receive(void)
// handle outgoing packets
uint32_t available = writebuffer->available();
available = MIN(300U, available);
#if HAL_GCS_ENABLED
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This'll do.

I should probably try to get my AP_MAVLINK_ENABLED branch working at some stage...

if (packetise) {
available = mavlink_packetise(*writebuffer, available);
}
#endif
if (available > 0) {
uint8_t buf[available];
auto n = writebuffer->peekbytes(buf, available);
Expand Down