MCPcopy Create free account
hub / github.com/SmingHub/Sming / wsCommandReceived

Function wsCommandReceived

samples/HttpServer_WebSockets/app/application.cpp:86–97  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

84
85#ifdef ENABLE_CMD_HANDLER
86void wsCommandReceived(WebsocketConnection& socket, const String& message)
87{
88 debug_i("%s(%s)", __FUNCTION__, message.c_str());
89 String response = commandHandler.processNow(message.c_str(), message.length());
90 socket.sendString(response);
91
92 // Normally you would use dynamic cast but just be careful not to convert to wrong object type!
93 auto user = static_cast<CUserData*>(socket.getUserData());
94 if(user != nullptr) {
95 user->printMessage(socket, message);
96 }
97}
98
99void processShutdownCommand(String commandLine, ReadWriteStream& commandOutput)
100{

Callers

nothing calls this directly

Calls 6

processNowMethod · 0.80
getUserDataMethod · 0.80
printMessageMethod · 0.80
c_strMethod · 0.45
lengthMethod · 0.45
sendStringMethod · 0.45

Tested by

no test coverage detected