diff --git a/components/audio_client/audio_client.cpp b/components/audio_client/audio_client.cpp index 3e2f523..bd725f4 100644 --- a/components/audio_client/audio_client.cpp +++ b/components/audio_client/audio_client.cpp @@ -295,7 +295,8 @@ bool audio_client_send_pending_request(void) { if (!s_need_request_image || !s_client) return false; s_need_request_image = false; - int ret = esp_websocket_client_send_text(s_client, "{\"type\":\"request_image\"}", 23, pdMS_TO_TICKS(1000)); + static const char REQUEST_IMG_JSON[] = "{\"type\":\"request_image\"}"; + int ret = esp_websocket_client_send_text(s_client, REQUEST_IMG_JSON, strlen(REQUEST_IMG_JSON), pdMS_TO_TICKS(1000)); if (ret < 0) { ESP_LOGE(TAG, "Failed to send image request: %d", ret); return false;