mirror of
https://github.com/ByteWelder/Tactility.git
synced 2026-02-18 19:03:16 +00:00
Fix Wi-Fi provisioning from /data (#428)
- Import from `/data/settings` instead of `/data` - Removed unnecessary functions - Header syntax cleanup
This commit is contained in:
parent
76686e5c90
commit
776e3cd4c0
@ -1,5 +1,5 @@
|
|||||||
#include "Tactility/service/wifi/WifiBootSplashInit.h"
|
#include <Tactility/service/wifi/WifiBootSplashInit.h>
|
||||||
#include "Tactility/file/PropertiesFile.h"
|
#include <Tactility/file/PropertiesFile.h>
|
||||||
|
|
||||||
#include <Tactility/MountPoints.h>
|
#include <Tactility/MountPoints.h>
|
||||||
#include <Tactility/file/File.h>
|
#include <Tactility/file/File.h>
|
||||||
@ -115,25 +115,18 @@ static void importWifiApSettingsFromDir(const std::string& path) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void importWifiApSettings(std::shared_ptr<hal::sdcard::SdCardDevice> sdcard) {
|
|
||||||
const std::string settings_path = file::getChildPath(sdcard->getMountPath(), "settings");
|
|
||||||
importWifiApSettingsFromDir(settings_path);
|
|
||||||
}
|
|
||||||
|
|
||||||
static void importWifiApSettingsFromData() {
|
|
||||||
importWifiApSettingsFromDir(tt::file::MOUNT_POINT_DATA);
|
|
||||||
}
|
|
||||||
|
|
||||||
void bootSplashInit() {
|
void bootSplashInit() {
|
||||||
getMainDispatcher().dispatch([] {
|
getMainDispatcher().dispatch([] {
|
||||||
// First import any provisioning files placed on the system data partition.
|
// First import any provisioning files placed on the system data partition.
|
||||||
importWifiApSettingsFromData();
|
const std::string settings_path = file::getChildPath(file::MOUNT_POINT_DATA, "settings");
|
||||||
|
importWifiApSettingsFromDir(settings_path);
|
||||||
|
|
||||||
// Then scan attached SD cards as before.
|
// Then scan attached SD cards as before.
|
||||||
const auto sdcards = hal::findDevices<hal::sdcard::SdCardDevice>(hal::Device::Type::SdCard);
|
const auto sdcards = hal::findDevices<hal::sdcard::SdCardDevice>(hal::Device::Type::SdCard);
|
||||||
for (auto& sdcard : sdcards) {
|
for (auto& sdcard : sdcards) {
|
||||||
if (sdcard->isMounted()) {
|
if (sdcard->isMounted()) {
|
||||||
importWifiApSettings(sdcard);
|
const std::string settings_path = file::getChildPath(sdcard->getMountPath(), "settings");
|
||||||
|
importWifiApSettingsFromDir(settings_path);
|
||||||
} else {
|
} else {
|
||||||
TT_LOG_W(TAG, "Skipping unmounted SD card %s", sdcard->getMountPath().c_str());
|
TT_LOG_W(TAG, "Skipping unmounted SD card %s", sdcard->getMountPath().c_str());
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user