mirror of
https://github.com/ByteWelder/Tactility.git
synced 2026-02-19 03:13:14 +00:00
Fixes and updates
This commit is contained in:
parent
57164ad6c8
commit
d57b111f0e
1
Data/data/service/Wifi/wifi.properties
Normal file
1
Data/data/service/Wifi/wifi.properties
Normal file
@ -0,0 +1 @@
|
||||
enableOnBoot=false
|
||||
@ -2,8 +2,6 @@
|
||||
|
||||
## Higher Priority
|
||||
|
||||
- Store encrypted WiFi credentials in `/data/app/wifi/x.ap.properties` (fixes problem with long SSIDs)
|
||||
- Move WiFi settings from flash to `/data/apps/wifi/wifi.properties` (just the "start on boot")
|
||||
- Move Development settings from flash to `/data/apps/development/development.properties` (just the "start on boot")
|
||||
- Move Display settings from flash to `/data/apps/display/display.properties`
|
||||
- App data directory should be automatically created (and then we can remove the custom code from Notes.cpp)
|
||||
|
||||
@ -1,8 +1,10 @@
|
||||
#include "Tactility/BootProperties.h"
|
||||
|
||||
#include <Tactility/LogEsp.h>
|
||||
#include <Tactility/Log.h>
|
||||
#include <Tactility/file/PropertiesFile.h>
|
||||
|
||||
#include <cassert>
|
||||
|
||||
namespace tt {
|
||||
|
||||
constexpr auto* TAG = "BootProperties";
|
||||
|
||||
@ -5,7 +5,6 @@
|
||||
|
||||
#include <unordered_map>
|
||||
#include <Tactility/file/File.h>
|
||||
#include <sys/stat.h>
|
||||
|
||||
#define TAG "app"
|
||||
|
||||
@ -16,20 +15,12 @@ typedef std::unordered_map<std::string, std::shared_ptr<AppManifest>> AppManifes
|
||||
static AppManifestMap app_manifest_map;
|
||||
static Mutex hash_mutex(Mutex::Type::Normal);
|
||||
|
||||
void ensureAppPathsExist(const AppManifest& manifest) {
|
||||
std::string path = "/data/app/" + manifest.id;
|
||||
if (!file::findOrCreateDirectory(path, 0777)) {
|
||||
TT_LOG_E(TAG, "Failed to create app directory: %s", path.c_str());
|
||||
}
|
||||
}
|
||||
|
||||
void addApp(const AppManifest& manifest) {
|
||||
TT_LOG_I(TAG, "Registering manifest %s", manifest.id.c_str());
|
||||
|
||||
hash_mutex.lock();
|
||||
|
||||
if (!app_manifest_map.contains(manifest.id)) {
|
||||
ensureAppPathsExist(manifest);
|
||||
app_manifest_map[manifest.id] = std::make_shared<AppManifest>(manifest);
|
||||
} else {
|
||||
TT_LOG_E(TAG, "App id in use: %s", manifest.id.c_str());
|
||||
|
||||
@ -6,9 +6,6 @@
|
||||
#include <Tactility/Mutex.h>
|
||||
|
||||
#include <string>
|
||||
#include <unordered_map>
|
||||
#include <Tactility/app/AppInstance.h>
|
||||
#include <Tactility/file/File.h>
|
||||
|
||||
namespace tt::service {
|
||||
|
||||
@ -23,12 +20,6 @@ static ServiceInstanceMap service_instance_map;
|
||||
static Mutex manifest_mutex(Mutex::Type::Normal);
|
||||
static Mutex instance_mutex(Mutex::Type::Normal);
|
||||
|
||||
void ensureServerPathsExist(const ServiceManifest& manifest) {
|
||||
std::string path = "/data/service/" + manifest.id;
|
||||
if (!file::findOrCreateDirectory(path, 0777)) {
|
||||
TT_LOG_E(TAG, "Failed to create service directory: %s", path.c_str());
|
||||
}
|
||||
}
|
||||
void addService(std::shared_ptr<const ServiceManifest> manifest, bool autoStart) {
|
||||
assert(manifest != nullptr);
|
||||
// We'll move the manifest pointer, but we'll need to id later
|
||||
@ -38,7 +29,6 @@ void addService(std::shared_ptr<const ServiceManifest> manifest, bool autoStart)
|
||||
|
||||
manifest_mutex.lock();
|
||||
if (service_manifest_map[id] == nullptr) {
|
||||
ensureServerPathsExist(*manifest);
|
||||
service_manifest_map[id] = std::move(manifest);
|
||||
} else {
|
||||
TT_LOG_E(TAG, "Service id in use: %s", id.c_str());
|
||||
|
||||
@ -66,7 +66,7 @@ bool isScanning() {
|
||||
return wifi->scan_active;
|
||||
}
|
||||
|
||||
void connect(const settings::WifiApSettings* ap, bool remember) {
|
||||
void connect(const settings::WifiApSettings& ap, bool remember) {
|
||||
assert(wifi);
|
||||
// TODO: implement
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user