mirror of
https://github.com/badaix/snapcast.git
synced 2025-08-06 10:09:33 +02:00
100 lines
1.8 KiB
C++
100 lines
1.8 KiB
C++
/***
|
|
This file is part of snapcast
|
|
Copyright (C) 2014-2016 Johannes Pohl
|
|
|
|
This program is free software: you can redistribute it and/or modify
|
|
it under the terms of the GNU General Public License as published by
|
|
the Free Software Foundation, either version 3 of the License, or
|
|
(at your option) any later version.
|
|
|
|
This program is distributed in the hope that it will be useful,
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
GNU General Public License for more details.
|
|
|
|
You should have received a copy of the GNU General Public License
|
|
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
***/
|
|
|
|
#ifndef HELLO_MSG_H
|
|
#define HELLO_MSG_H
|
|
|
|
#include "mapMessage.h"
|
|
#include "common/utils.h"
|
|
#include <string>
|
|
|
|
|
|
namespace msg
|
|
{
|
|
|
|
class Hello : public MapMessage
|
|
{
|
|
public:
|
|
Hello() : MapMessage(message_type::kHello)
|
|
{
|
|
}
|
|
|
|
Hello(const std::string& macAddress) : MapMessage(message_type::kHello)
|
|
{
|
|
add("MAC", macAddress);
|
|
add("HostName", ::getHostName());
|
|
add("Version", VERSION);
|
|
add("ClientName", "Snapclient");
|
|
add("OS", ::getOS());
|
|
add("Arch", ::getArch());
|
|
add("SnapControlProtocolVersion", "1");
|
|
add("SnapStreamProtocolVersion", "1");
|
|
}
|
|
|
|
virtual ~Hello()
|
|
{
|
|
}
|
|
|
|
std::string getMacAddress()
|
|
{
|
|
return get("MAC");
|
|
}
|
|
|
|
std::string getHostName()
|
|
{
|
|
return get("HostName");
|
|
}
|
|
|
|
std::string getVersion()
|
|
{
|
|
return get("Version");
|
|
}
|
|
|
|
std::string getClientName()
|
|
{
|
|
return get("ClientName");
|
|
}
|
|
|
|
std::string getOS()
|
|
{
|
|
return get("OS");
|
|
}
|
|
|
|
std::string getArch()
|
|
{
|
|
return get("Arch");
|
|
}
|
|
|
|
int getControlProtocolVersion()
|
|
{
|
|
return get("SnapControlProtocolVersion", 1);
|
|
}
|
|
|
|
int getStreamProtocolVersion()
|
|
{
|
|
return get("SnapStreamProtocolVersion", 1);
|
|
}
|
|
|
|
};
|
|
|
|
}
|
|
|
|
|
|
#endif
|
|
|
|
|