mirror of
https://github.com/badaix/snapcast.git
synced 2025-05-15 18:16:44 +02:00
Host: added update function
This commit is contained in:
parent
5cc3c157a7
commit
cc057eef29
2 changed files with 9 additions and 1 deletions
|
@ -71,10 +71,17 @@ struct Volume
|
||||||
|
|
||||||
struct Host
|
struct Host
|
||||||
{
|
{
|
||||||
Host(const std::string& _macAddress = "") : name(getHostName()), mac(_macAddress), os(getOS()), arch(getArch()), ip("")
|
Host(const std::string& _macAddress = "") : name(""), mac(_macAddress), os(""), arch(""), ip("")
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void update()
|
||||||
|
{
|
||||||
|
name = getHostName();
|
||||||
|
os = getOS();
|
||||||
|
arch = getArch();
|
||||||
|
}
|
||||||
|
|
||||||
void fromJson(const json& j)
|
void fromJson(const json& j)
|
||||||
{
|
{
|
||||||
name = trim_copy(jGet<std::string>(j, "name", ""));
|
name = trim_copy(jGet<std::string>(j, "name", ""));
|
||||||
|
|
|
@ -147,6 +147,7 @@ void StreamServer::onMessageReceived(ControlSession* controlSession, const std::
|
||||||
jClient = Config::instance().getClientInfos();
|
jClient = Config::instance().getClientInfos();
|
||||||
|
|
||||||
Host host;
|
Host host;
|
||||||
|
host.update();
|
||||||
//TODO: Set MAC and IP
|
//TODO: Set MAC and IP
|
||||||
Snapserver snapserver("Snapserver", VERSION);
|
Snapserver snapserver("Snapserver", VERSION);
|
||||||
response = {
|
response = {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue