mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-07-07 09:00:34 +08:00
Decouple filepaths from rcS/MTD
This commit is contained in:
committed by
Daniel Agar
parent
79e0e00d8c
commit
46e43ec725
@@ -158,8 +158,8 @@ private:
|
||||
static constexpr int MAX_MISSION_TOPICS_NUM = 5; /**< Maximum number of mission topics */
|
||||
static constexpr unsigned MAX_NO_LOGFILE = 999; /**< Maximum number of log files */
|
||||
static constexpr const char *LOG_ROOT[(int)LogType::Count] = {
|
||||
PX4_STORAGEDIR "/log",
|
||||
PX4_STORAGEDIR "/mission_log"
|
||||
CONFIG_BOARD_ROOT_PATH "/log",
|
||||
CONFIG_BOARD_ROOT_PATH "/mission_log"
|
||||
};
|
||||
|
||||
struct LogFileName {
|
||||
|
||||
@@ -58,7 +58,7 @@ const char *default_sub_config = ""; //TODO maybe use YAML
|
||||
Zenoh_Config::Zenoh_Config()
|
||||
{
|
||||
bool correct_config = true;
|
||||
DIR *dir = opendir(ZENOH_SD_ROOT_PATH);
|
||||
DIR *dir = opendir(ZENOH_ROOT_PATH);
|
||||
fp_mapping = NULL;
|
||||
|
||||
if (dir) {
|
||||
@@ -342,14 +342,14 @@ void Zenoh_Config::generate_clean_config()
|
||||
printf("Generate clean\n");
|
||||
FILE *fp;
|
||||
|
||||
DIR *dir = opendir(ZENOH_SD_ROOT_PATH);
|
||||
DIR *dir = opendir(ZENOH_ROOT_PATH);
|
||||
|
||||
if (dir) {
|
||||
printf("Zenoh directory exists\n");
|
||||
|
||||
} else {
|
||||
/* Create zenoh dir. */
|
||||
if (mkdir(ZENOH_SD_ROOT_PATH, 0700) < 0) {
|
||||
if (mkdir(ZENOH_ROOT_PATH, 0700) < 0) {
|
||||
printf("Failed to create Zenoh directory\n");
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -49,10 +49,10 @@
|
||||
#include <zenoh-pico.h>
|
||||
|
||||
#define ZENOH_MAX_PATH_LENGTH (128 + 40)
|
||||
#define ZENOH_SD_ROOT_PATH CONFIG_ZENOH_CONFIG_PATH
|
||||
#define ZENOH_PUB_CONFIG_PATH ZENOH_SD_ROOT_PATH"/pub.csv"
|
||||
#define ZENOH_SUB_CONFIG_PATH ZENOH_SD_ROOT_PATH"/sub.csv"
|
||||
#define ZENOH_NET_CONFIG_PATH ZENOH_SD_ROOT_PATH"/net.txt"
|
||||
#define ZENOH_ROOT_PATH CONFIG_BOARD_ROOT_PATH"/zenoh"
|
||||
#define ZENOH_PUB_CONFIG_PATH ZENOH_ROOT_PATH"/pub.csv"
|
||||
#define ZENOH_SUB_CONFIG_PATH ZENOH_ROOT_PATH"/sub.csv"
|
||||
#define ZENOH_NET_CONFIG_PATH ZENOH_ROOT_PATH"/net.txt"
|
||||
|
||||
#define NET_MODE_SIZE sizeof("client")
|
||||
#define NET_LOCATOR_SIZE 64
|
||||
|
||||
Reference in New Issue
Block a user