Fixes for paths

This commit is contained in:
Ken Van Hoeylandt 2026-08-19 21:55:34 +02:00
parent 45c796c7cd
commit ef4d0c6cdc
10 changed files with 24 additions and 19 deletions

View File

@ -72,7 +72,7 @@ bool delete_recursively(const std::string& path) {
bool get_app_install_directory(std::string& out_path) { bool get_app_install_directory(std::string& out_path) {
char root[192]; char root[192];
if (paths_get_user_data_path(root, sizeof(root)) != ERROR_NONE) { if (paths_get_data_path(root, sizeof(root)) != ERROR_NONE) {
return false; return false;
} }
out_path = std::string(root) + "/app"; out_path = std::string(root) + "/app";

View File

@ -11,7 +11,7 @@ extern "C" {
error_t app_paths_get_user_data_directory(const char* app_id, char* out_path, size_t out_path_size) { error_t app_paths_get_user_data_directory(const char* app_id, char* out_path, size_t out_path_size) {
char root[192]; char root[192];
error_t error = paths_get_user_data_path(root, sizeof(root)); error_t error = paths_get_data_path(root, sizeof(root));
if (error != ERROR_NONE) { if (error != ERROR_NONE) {
return error; return error;
} }

View File

@ -9,7 +9,7 @@ extern "C" {
error_t service_paths_get_user_data_directory(const char* service_id, char* out_path, size_t out_path_size) { error_t service_paths_get_user_data_directory(const char* service_id, char* out_path, size_t out_path_size) {
char root[192]; char root[192];
error_t error = paths_get_user_data_path(root, sizeof(root)); error_t error = paths_get_data_path(root, sizeof(root));
if (error != ERROR_NONE) { if (error != ERROR_NONE) {
return error; return error;
} }

View File

@ -1,18 +1,19 @@
#include <Tactility/app/i2cscanner/I2cHelpers.h>
#include <Tactility/app/i2cscanner/I2cScannerPrivate.h>
#include <Tactility/LogMessages.h> #include <Tactility/LogMessages.h>
#include <Tactility/RecursiveMutex.h> #include <Tactility/RecursiveMutex.h>
#include <Tactility/Timer.h> #include <Tactility/Timer.h>
#include <Tactility/app/i2cscanner/I2cHelpers.h>
#include <Tactility/app/i2cscanner/I2cScannerPrivate.h>
#include <app/event.h> #include <app/event.h>
#include <app/manager.h> #include <app/manager.h>
#include <app/manifest.h> #include <app/manifest.h>
#include <app/paths.h>
#include <lvgl_window_manager/window_manager.h> #include <lvgl_window_manager/window_manager.h>
#include <tactility/drivers/i2c_controller.h> #include <tactility/drivers/i2c_controller.h>
#include <tactility/log.h> #include <tactility/log.h>
#include <tactility/paths.h>
#include <tactility/preferences.h> #include <tactility/preferences.h>
#include <cassert> #include <cassert>
@ -55,7 +56,7 @@ struct Context {
bool getPreferencesPath(std::string& outPath) { bool getPreferencesPath(std::string& outPath) {
char root[128]; char root[128];
if (paths_get_user_data_path(root, sizeof(root)) != ERROR_NONE) { if (app_paths_get_user_data_directory(manifest.id, root, sizeof(root)) != ERROR_NONE) {
return false; return false;
} }
outPath = std::string(root) + "/i2c_scanner.properties"; outPath = std::string(root) + "/i2c_scanner.properties";

View File

@ -9,11 +9,11 @@
#include <app/event.h> #include <app/event.h>
#include <app/manager.h> #include <app/manager.h>
#include <app/manifest.h> #include <app/manifest.h>
#include <app/paths.h>
#include <lvgl_window_manager/window_manager.h> #include <lvgl_window_manager/window_manager.h>
#include <tactility/log.h> #include <tactility/log.h>
#include <tactility/paths.h>
#include <lvgl/fonts.h> #include <lvgl/fonts.h>
#include <lvgl/lvgl.h> #include <lvgl/lvgl.h>
@ -40,7 +40,7 @@ namespace {
bool getCompletedMarkerPath(std::string& outPath) { bool getCompletedMarkerPath(std::string& outPath) {
char root[128]; char root[128];
if (paths_get_user_data_path(root, sizeof(root)) != ERROR_NONE) { if (app_paths_get_user_data_directory(manifest.id, root, sizeof(root)) != ERROR_NONE) {
return false; return false;
} }
outPath = std::string(root) + "/.setup_complete"; outPath = std::string(root) + "/.setup_complete";

View File

@ -1,14 +1,15 @@
#include <service/paths.h>
#include <Tactility/network/NtpPrivate.h> #include <Tactility/network/NtpPrivate.h>
#include <tactility/log.h> #include <tactility/log.h>
#include <tactility/paths.h> #include <tactility/paths.h>
#include <tactility/preferences.h> #include <tactility/preferences.h>
#include <tactility/system_event.h>
#include <string> #include <string>
#ifdef ESP_PLATFORM #ifdef ESP_PLATFORM
#include <Tactility/TactilityCore.h>
#include <tactility/system_event.h>
#include <esp_netif_sntp.h> #include <esp_netif_sntp.h>
#include <esp_sntp.h> #include <esp_sntp.h>
#endif #endif
@ -23,7 +24,8 @@ static bool processedSyncEvent = false;
static bool getPreferencesPath(std::string& outPath) { static bool getPreferencesPath(std::string& outPath) {
char root[128]; char root[128];
if (paths_get_user_data_path(root, sizeof(root)) != ERROR_NONE) { // Not really a service, but this is the best way of organising it for now
if (service_paths_get_user_data_directory("tactility.ntp", root, sizeof(root)) != ERROR_NONE) {
return false; return false;
} }
outPath = std::string(root) + "/time.properties"; outPath = std::string(root) + "/time.properties";

View File

@ -1,5 +1,6 @@
#include <Tactility/settings/Time.h> #include <service/paths.h>
#include <Tactility/settings/Time.h>
#include <Tactility/settings/SystemSettings.h> #include <Tactility/settings/SystemSettings.h>
#include <tactility/paths.h> #include <tactility/paths.h>
@ -24,7 +25,8 @@ namespace {
// "syncTime" - matches the shared NVS namespace this used to be. // "syncTime" - matches the shared NVS namespace this used to be.
bool getPreferencesPath(std::string& outPath) { bool getPreferencesPath(std::string& outPath) {
char root[128]; char root[128];
if (paths_get_user_data_path(root, sizeof(root)) != ERROR_NONE) { // Not really a service, but this is the best way of organising it for now
if (service_paths_get_user_data_directory("tactility.time", root, sizeof(root)) != ERROR_NONE) {
return false; return false;
} }
outPath = std::string(root) + "/" + TIME_SETTINGS_NAMESPACE + ".properties"; outPath = std::string(root) + "/" + TIME_SETTINGS_NAMESPACE + ".properties";

View File

@ -17,7 +17,7 @@ extern "C" {
* @retval ERROR_BUFFER_OVERFLOW if out_path_size is too small * @retval ERROR_BUFFER_OVERFLOW if out_path_size is too small
* @retval ERROR_NONE on success * @retval ERROR_NONE on success
*/ */
error_t paths_get_user_data_path(char* out_path, size_t out_path_size); error_t paths_get_data_path(char* out_path, size_t out_path_size);
#ifdef __cplusplus #ifdef __cplusplus
} }

View File

@ -8,7 +8,7 @@
#include <cstdio> #include <cstdio>
#include <cstring> #include <cstring>
static error_t paths_get_user_data_root_path(char* out_path, size_t out_path_size) { static error_t paths_get_data_root_path(char* out_path, size_t out_path_size) {
#if defined(CONFIG_TT_USER_DATA_LOCATION_INTERNAL) #if defined(CONFIG_TT_USER_DATA_LOCATION_INTERNAL)
#ifdef ESP_PLATFORM #ifdef ESP_PLATFORM
const char* mount_point = "/data"; const char* mount_point = "/data";
@ -41,10 +41,10 @@ static error_t paths_get_user_data_root_path(char* out_path, size_t out_path_siz
extern "C" { extern "C" {
error_t paths_get_user_data_path(char* out_path, size_t out_path_size) { error_t paths_get_data_path(char* out_path, size_t out_path_size) {
#ifdef ESP_PLATFORM #ifdef ESP_PLATFORM
char root[64]; char root[64];
error_t error = paths_get_user_data_root_path(root, sizeof(root)); error_t error = paths_get_data_root_path(root, sizeof(root));
if (error != ERROR_NONE) { if (error != ERROR_NONE) {
return error; return error;
} }

View File

@ -249,7 +249,7 @@ const struct ModuleSymbol KERNEL_SYMBOLS[] = {
DEFINE_MODULE_SYMBOL(keyboard_read_key), DEFINE_MODULE_SYMBOL(keyboard_read_key),
DEFINE_MODULE_SYMBOL(KEYBOARD_TYPE), DEFINE_MODULE_SYMBOL(KEYBOARD_TYPE),
// drivers/paths // drivers/paths
DEFINE_MODULE_SYMBOL(paths_get_user_data_path), DEFINE_MODULE_SYMBOL(paths_get_data_path),
// drivers/pointer // drivers/pointer
DEFINE_MODULE_SYMBOL(pointer_enter_sleep), DEFINE_MODULE_SYMBOL(pointer_enter_sleep),
DEFINE_MODULE_SYMBOL(pointer_exit_sleep), DEFINE_MODULE_SYMBOL(pointer_exit_sleep),