Skip to content

Commit

Permalink
add broadcastMessage
Browse files Browse the repository at this point in the history
  • Loading branch information
thijstriemstra authored Apr 7, 2024
1 parent f9a7faa commit 54667db
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/WebSocket.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -129,10 +129,15 @@ namespace WebSocket
m_socket.loop();
}

void broadcastMessage(String msg)
{
WebSocket::m_socket.broadcastTXT(msg.c_str());
}

void broadcastStatus()
{
String msg = "{\"status\": " + String((int)FastLEDHub.getStatus()) + ", \"currentAnimation\": \"" + FastLEDHub.getCurrentAnimationName() + "\"}";
WebSocket::m_socket.broadcastTXT(msg.c_str());
broadcastMessage(msg);
}

} // namespace WebSocket

0 comments on commit 54667db

Please sign in to comment.