mirror of
https://github.com/78/xiaozhi-esp32.git
synced 2026-02-27 22:36:35 +00:00
Add MCP server
This commit is contained in:
@@ -115,6 +115,11 @@ void Protocol::SendIotStates(const std::string& states) {
|
||||
SendText(message);
|
||||
}
|
||||
|
||||
void Protocol::SendMcpMessage(const std::string& payload) {
|
||||
std::string message = "{\"session_id\":\"" + session_id_ + "\",\"type\":\"mcp\",\"payload\":" + payload + "}";
|
||||
SendText(message);
|
||||
}
|
||||
|
||||
bool Protocol::IsTimeout() const {
|
||||
const int kTimeoutSeconds = 120;
|
||||
auto now = std::chrono::steady_clock::now();
|
||||
|
||||
Reference in New Issue
Block a user