mirror of
https://github.com/MrUnknownDE/OpenIris-ESPIDF.git
synced 2026-04-22 16:03:45 +02:00
Add get device name command for displaying the current name in the setup tool
This commit is contained in:
@@ -9,8 +9,6 @@
|
||||
#include <format>
|
||||
#include <string>
|
||||
|
||||
CommandResult setDeviceModeCommand(std::shared_ptr<DependencyRegistry> registry, std::string_view jsonPayload);
|
||||
|
||||
CommandResult updateOTACredentialsCommand(std::shared_ptr<DependencyRegistry> registry, std::string_view jsonPayload);
|
||||
|
||||
CommandResult updateLEDDutyCycleCommand(std::shared_ptr<DependencyRegistry> registry, std::string_view jsonPayload);
|
||||
|
||||
@@ -31,3 +31,12 @@ CommandResult setMDNSCommand(std::shared_ptr<DependencyRegistry> registry, std::
|
||||
|
||||
return CommandResult::getSuccessResult("Config updated");
|
||||
}
|
||||
|
||||
CommandResult getMDNSNameCommand(std::shared_ptr<DependencyRegistry> registry)
|
||||
{
|
||||
const auto projectConfig = registry->resolve<ProjectConfig>(DependencyType::project_config);
|
||||
auto mdnsConfig = projectConfig->getMDNSConfig();
|
||||
|
||||
auto result = std::format("{{ \"hostname\": \"{}\" }}", mdnsConfig.hostname);
|
||||
return CommandResult::getSuccessResult(result);
|
||||
}
|
||||
@@ -8,4 +8,5 @@
|
||||
#include "DependencyRegistry.hpp"
|
||||
|
||||
std::optional<MDNSPayload> parseMDNSCommandPayload(std::string_view jsonPayload);
|
||||
CommandResult setMDNSCommand(std::shared_ptr<DependencyRegistry> registry, std::string_view jsonPayload);
|
||||
CommandResult setMDNSCommand(std::shared_ptr<DependencyRegistry> registry, std::string_view jsonPayload);
|
||||
CommandResult getMDNSNameCommand(std::shared_ptr<DependencyRegistry> registry);
|
||||
Reference in New Issue
Block a user