mirror of
https://github.com/ArduPilot/ardupilot
synced 2025-02-10 01:44:00 -04:00
AP_HAL_Linux: add custom storage directory
This commit is contained in:
parent
9e538632b3
commit
ff6e76ea6a
@ -20,6 +20,7 @@ public:
|
||||
|
||||
virtual const char* get_custom_log_directory() const { return nullptr; }
|
||||
virtual const char* get_custom_terrain_directory() const { return nullptr; }
|
||||
virtual const char *get_custom_storage_directory() const { return nullptr; }
|
||||
|
||||
// get path to custom defaults file for AP_Param
|
||||
virtual const char* get_custom_defaults_file() const {
|
||||
|
@ -288,12 +288,13 @@ void HAL_Linux::run(int argc, char* const argv[], Callbacks* callbacks) const
|
||||
{"uartF", true, 0, 'F'},
|
||||
{"log-directory", true, 0, 'l'},
|
||||
{"terrain-directory", true, 0, 't'},
|
||||
{"storage-directory", true, 0, 's'},
|
||||
{"module-directory", true, 0, 'M'},
|
||||
{"help", false, 0, 'h'},
|
||||
{0, false, 0, 0}
|
||||
};
|
||||
|
||||
GetOptLong gopt(argc, argv, "A:B:C:D:E:F:l:t:he:SM:",
|
||||
GetOptLong gopt(argc, argv, "A:B:C:D:E:F:l:t:s:he:SM:",
|
||||
options);
|
||||
|
||||
/*
|
||||
@ -325,6 +326,9 @@ void HAL_Linux::run(int argc, char* const argv[], Callbacks* callbacks) const
|
||||
case 't':
|
||||
utilInstance.set_custom_terrain_directory(gopt.optarg);
|
||||
break;
|
||||
case 's':
|
||||
utilInstance.set_custom_storage_directory(gopt.optarg);
|
||||
break;
|
||||
#if AP_MODULE_SUPPORTED
|
||||
case 'M':
|
||||
module_path = gopt.optarg;
|
||||
|
@ -47,9 +47,13 @@ public:
|
||||
void set_system_clock(uint64_t time_utc_usec);
|
||||
const char *get_custom_log_directory() const override final { return custom_log_directory; }
|
||||
const char *get_custom_terrain_directory() const override final { return custom_terrain_directory; }
|
||||
const char *get_custom_storage_directory() const override final { return custom_storage_directory; }
|
||||
|
||||
void set_custom_log_directory(const char *_custom_log_directory) { custom_log_directory = _custom_log_directory; }
|
||||
void set_custom_terrain_directory(const char *_custom_terrain_directory) { custom_terrain_directory = _custom_terrain_directory; }
|
||||
void set_custom_storage_directory(const char *_custom_storage_directory) {
|
||||
custom_storage_directory = _custom_storage_directory;
|
||||
}
|
||||
|
||||
bool is_chardev_node(const char *path);
|
||||
void set_imu_temp(float current) override;
|
||||
@ -107,6 +111,7 @@ private:
|
||||
char *const *saved_argv;
|
||||
const char *custom_log_directory = nullptr;
|
||||
const char *custom_terrain_directory = nullptr;
|
||||
const char *custom_storage_directory = nullptr;
|
||||
static const char *_hw_names[UTIL_NUM_HARDWARES];
|
||||
};
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user