Summary Files Commits Branches @commit @diff @stats
diff options
context:
space:
mode:
1 files changed, 8 insertions, 0 deletions
-rw-r--r--Year 3/Internet of things/goam/main/webserver.c8
diff --git a/Year 3/Internet of things/goam/main/webserver.c b/Year 3/Internet of things/goam/main/webserver.c
index b0ccbeb..5163647 100644
--- a/Year 3/Internet of things/goam/main/webserver.c
+++ b/Year 3/Internet of things/goam/main/webserver.c
@@ -199,6 +199,13 @@ void webserver_start()
ESP_LOGI(TAG, "Started server on port %d", config.httpd.server_port);
}
+static httpd_ws_frame_t empty_value = {
+ .fragmented = false,
+ .type = HTTPD_WS_TYPE_BINARY,
+ .payload = NULL,
+ .len = 0,
+};
+
void ws_send_bin(const char* msg, size_t size) {
httpd_ws_frame_t value = {
.fragmented = false,
@@ -215,5 +222,6 @@ void ws_send_bin(const char* msg, size_t size) {
ESP_LOGI(TAG, "Sending websocket data to fd:%d", client_fds[i]);
httpd_ws_send_data(server, client_fds[i], &value);
+ httpd_ws_send_data(server, client_fds[i], &empty_value);
}
}