mirror of
https://github.com/ArduPilot/ardupilot.git
synced 2026-10-20 14:53:54 +08:00
AP_Bootloader: support CAN multicast server
allows for fw update of network peripheral devices
This commit is contained in:
@@ -8,6 +8,7 @@
|
||||
|
||||
#include <AP_Networking/AP_Networking.h>
|
||||
#include <AP_Networking/AP_Networking_ChibiOS.h>
|
||||
#include <AP_Networking/AP_Networking_CAN.h>
|
||||
|
||||
#include <lwip/ip_addr.h>
|
||||
#include <lwip/tcpip.h>
|
||||
@@ -29,6 +30,7 @@
|
||||
#include <stdio.h>
|
||||
#include <stdarg.h>
|
||||
#include <AP_HAL_ChibiOS/hwdef/common/flash.h>
|
||||
#include <AP_HAL_ChibiOS/CANIface.h>
|
||||
|
||||
#ifndef AP_NETWORKING_BOOTLOADER_DEFAULT_MAC_ADDR
|
||||
#define AP_NETWORKING_BOOTLOADER_DEFAULT_MAC_ADDR "C2:AF:51:03:CF:46"
|
||||
@@ -59,6 +61,8 @@
|
||||
|
||||
#define MIN(a,b) ((a)<(b)?(a):(b))
|
||||
|
||||
static AP_Networking_CAN mcast_server;
|
||||
|
||||
void BL_Network::link_up_cb(void *p)
|
||||
{
|
||||
auto *driver = (BL_Network *)p;
|
||||
@@ -67,6 +71,9 @@ void BL_Network::link_up_cb(void *p)
|
||||
#endif
|
||||
char ipstr[IP4_STR_LEN];
|
||||
can_printf("IP %s", SocketAPM::inet_addr_to_str(ntohl(driver->thisif->ip_addr.addr), ipstr, sizeof(ipstr)));
|
||||
|
||||
// start mcast CAN server
|
||||
mcast_server.start((1U<<HAL_NUM_CAN_IFACES)-1);
|
||||
}
|
||||
|
||||
void BL_Network::link_down_cb(void *p)
|
||||
|
||||
Reference in New Issue
Block a user