Decouple filepaths from rcS/MTD

This commit is contained in:
Peter van der Perk
2023-07-26 18:55:38 +02:00
committed by Daniel Agar
parent 79e0e00d8c
commit 46e43ec725
13 changed files with 101 additions and 32 deletions
+2 -2
View File
@@ -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 {
+3 -3
View File
@@ -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;
}
+4 -4
View File
@@ -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