Run executables directly (#645)
- Apps can be launched directly from file paths (including Files app support) - Added executable detection to identify unsupported or invalid binaries before launch. - App startup is now streamlined through separate registered-app and direct-execution interfaces. - Existing app launch points were migrated to the updated startup APIs.
This commit is contained in:
committed by
GitHub
parent
643cbc3806
commit
a0b2ee7ebc
@@ -2,6 +2,7 @@
|
||||
|
||||
#include <app/install.h>
|
||||
#include <app/manager.h>
|
||||
#include <app/start.h>
|
||||
|
||||
#include <tactility/log.h>
|
||||
|
||||
@@ -113,7 +114,7 @@ esp_err_t DevelopmentService::handleAppRun(httpd_req_t* request) {
|
||||
}
|
||||
}
|
||||
|
||||
app_manager_start(id_key_pos->second.c_str(), &instance_id);
|
||||
app_start(id_key_pos->second.c_str(), 0, nullptr, &instance_id);
|
||||
|
||||
LOG_I(TAG, "[200] /app/run %s", id_key_pos->second.c_str());
|
||||
httpd_resp_send(request, nullptr, 0);
|
||||
|
||||
@@ -2,6 +2,8 @@
|
||||
|
||||
#include <Tactility/service/webserver/WebServerService.h>
|
||||
#include <Tactility/service/ServiceManifest.h>
|
||||
|
||||
#include <app/start.h>
|
||||
#include <Tactility/settings/WebServerSettings.h>
|
||||
#include <Tactility/MountPoints.h>
|
||||
#include <Tactility/file/File.h>
|
||||
@@ -1270,7 +1272,7 @@ esp_err_t WebServerService::handleApiAppsRun(httpd_req_t* request) {
|
||||
// Every app instance gets its own task now, so there's no "stop the existing one first" -
|
||||
// this just starts a fresh instance alongside whatever's already running.
|
||||
AppInstanceId instance_id = 0;
|
||||
app_manager_start(appId.c_str(), &instance_id);
|
||||
app_start(appId.c_str(), 0, nullptr, &instance_id);
|
||||
|
||||
LOG_I(TAG, "[200] /api/apps/run %s", appId.c_str());
|
||||
httpd_resp_sendstr(request, "ok");
|
||||
|
||||
Reference in New Issue
Block a user