main/task_http.h

Wed, 03 Jul 2024 20:01:31 +0200

author
Michiel Broek <mbroek@mbse.eu>
date
Wed, 03 Jul 2024 20:01:31 +0200
branch
idf 5.1
changeset 142
1f7069278fe7
parent 0
b74b0e4902c3
permissions
-rw-r--r--

Version 0.4.2. Removed the components/websocket server and switched to the official http and websockets server. This server will also recover if the wifi connection disconnects and reconnects.

/**
 * @file task_http.h
 * @brief HTTP and Websocket server functions.
 */

#ifndef	_TASK_HTTP_H
#define	_TASK_HTTP_H


/**
 * @brief Send text to client with the set number.
 * @param num The client connection number.
 * @param msg The message to send.
 * @param len The length of the message to send.
 * @return 1 if message send.
 */
int ws_server_send_text_client(int num, char* msg);


/**
 * @brief Sends text to all clients with the set url.
 * @param msg The message to send.
 * @return The number of clients the message was send to.
 */
int ws_server_send_text_clients(char* msg);


/**
 * @brief Install the HTTP/Websocket server.
 */
void install_http_server(void);

#endif

mercurial