mirror of
https://github.com/badaix/snapcast.git
synced 2025-05-10 07:36:41 +02:00
json rpc basics
This commit is contained in:
parent
1b579ed2a6
commit
6121fdceae
6 changed files with 120 additions and 73 deletions
|
@ -120,7 +120,7 @@ void StreamServer::onMessageReceived(ServerSession* connection, const msg::BaseM
|
|||
{
|
||||
msg::Command commandMsg;
|
||||
commandMsg.deserialize(baseMessage, buffer);
|
||||
if (commandMsg.command == "startStream")
|
||||
if (commandMsg.getCommand() == "startStream")
|
||||
{
|
||||
msg::Ack ackMsg;
|
||||
ackMsg.refersTo = commandMsg.id;
|
||||
|
@ -132,8 +132,8 @@ void StreamServer::onMessageReceived(ServerSession* connection, const msg::BaseM
|
|||
{
|
||||
msg::Hello helloMsg;
|
||||
helloMsg.deserialize(baseMessage, buffer);
|
||||
connection->macAddress = helloMsg.macAddress;
|
||||
logO << "Hello from " << connection->macAddress << "\n";
|
||||
connection->macAddress = helloMsg.getMacAddress();
|
||||
logO << "Hello from " << connection->macAddress << ", host: " << helloMsg.getHostName() << ", v" << helloMsg.getVersion() << "\n";
|
||||
json j = {
|
||||
{"event", "newConnection"},
|
||||
{"client", {
|
||||
|
@ -142,7 +142,6 @@ void StreamServer::onMessageReceived(ServerSession* connection, const msg::BaseM
|
|||
}}
|
||||
};
|
||||
controlServer->send(j.dump());
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue