| 84 | |
| 85 | #ifdef ENABLE_CMD_HANDLER |
| 86 | void 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 | |
| 99 | void processShutdownCommand(String commandLine, ReadWriteStream& commandOutput) |
| 100 | { |
nothing calls this directly
no test coverage detected