AP_FileSystem_Sys: allow sending stats via mavftp on AP_Periph

This commit is contained in:
bugobliterator 2021-07-24 00:16:29 +05:30 committed by Andrew Tridgell
parent e8c4b99a99
commit 6b64cfd6c1
1 changed files with 7 additions and 2 deletions

View File

@ -38,6 +38,8 @@ static const SysFileList sysfs_file_list[] = {
{"uarts.txt"}, {"uarts.txt"},
#if HAL_MAX_CAN_PROTOCOL_DRIVERS #if HAL_MAX_CAN_PROTOCOL_DRIVERS
{"can_log.txt"}, {"can_log.txt"},
#endif
#if HAL_NUM_CAN_IFACES > 0
{"can0_stats.txt"}, {"can0_stats.txt"},
{"can1_stats.txt"}, {"can1_stats.txt"},
#endif #endif
@ -105,10 +107,13 @@ int AP_Filesystem_Sys::open(const char *fname, int flags)
hal.util->uart_info(*r.str); hal.util->uart_info(*r.str);
} }
#if HAL_CANMANAGER_ENABLED #if HAL_CANMANAGER_ENABLED
int8_t can_stats_num = -1;
if (strcmp(fname, "can_log.txt") == 0) { if (strcmp(fname, "can_log.txt") == 0) {
AP::can().log_retrieve(*r.str); AP::can().log_retrieve(*r.str);
} else if (strcmp(fname, "can0_stats.txt") == 0) { }
#endif
#if HAL_NUM_CAN_IFACES > 0
int8_t can_stats_num = -1;
if (strcmp(fname, "can0_stats.txt") == 0) {
can_stats_num = 0; can_stats_num = 0;
} else if (strcmp(fname, "can1_stats.txt") == 0) { } else if (strcmp(fname, "can1_stats.txt") == 0) {
can_stats_num = 1; can_stats_num = 1;