components/websocket/include/websocket_server.h

changeset 30
3cc32f97410c
parent 0
b74b0e4902c3
--- a/components/websocket/include/websocket_server.h	Mon Oct 29 12:16:37 2018 +0100
+++ b/components/websocket/include/websocket_server.h	Mon Oct 29 19:37:14 2018 +0100
@@ -13,14 +13,14 @@
 
 #include "websocket.h"
 
-#define WEBSOCKET_SERVER_MAX_CLIENTS CONFIG_WEBSOCKET_SERVER_MAX_CLIENTS
-#define WEBSOCKET_SERVER_QUEUE_SIZE CONFIG_WEBSOCKET_SERVER_QUEUE_SIZE
-#define WEBSOCKET_SERVER_QUEUE_TIMEOUT CONFIG_WEBSOCKET_SERVER_QUEUE_TIMEOUT
-#define WEBSOCKET_SERVER_TASK_STACK_DEPTH CONFIG_WEBSOCKET_SERVER_TASK_STACK_DEPTH
-#define WEBSOCKET_SERVER_TASK_PRIORITY CONFIG_WEBSOCKET_SERVER_TASK_PRIORITY
-#define WEBSOCKET_SERVER_PINNED CONFIG_WEBSOCKET_SERVER_PINNED
+#define WEBSOCKET_SERVER_MAX_CLIENTS CONFIG_WEBSOCKET_SERVER_MAX_CLIENTS		///< Maximum allowed clients
+#define WEBSOCKET_SERVER_QUEUE_SIZE CONFIG_WEBSOCKET_SERVER_QUEUE_SIZE			///< Webserver requests queue size
+#define WEBSOCKET_SERVER_QUEUE_TIMEOUT CONFIG_WEBSOCKET_SERVER_QUEUE_TIMEOUT		///< Queue timeout
+#define WEBSOCKET_SERVER_TASK_STACK_DEPTH CONFIG_WEBSOCKET_SERVER_TASK_STACK_DEPTH	///< Task stack size
+#define WEBSOCKET_SERVER_TASK_PRIORITY CONFIG_WEBSOCKET_SERVER_TASK_PRIORITY		///< Task priority
+#define WEBSOCKET_SERVER_PINNED CONFIG_WEBSOCKET_SERVER_PINNED				///< Pinned to a CPU
 #if WEBSOCKET_SERVER_PINNED
-#define WEBSOCKET_SERVER_PINNED_CORE CONFIG_WEBSOCKET_SERVER_PINNED_CORE
+#define WEBSOCKET_SERVER_PINNED_CORE CONFIG_WEBSOCKET_SERVER_PINNED_CORE		///< If pinned, which CPU
 #endif
 
 /**
@@ -104,8 +104,8 @@
  * @brief Send text to client with the set number.
  * @param num The client connection number.
  * @param msg The message to send.
- * @param The length of the message to send.
- * @retrun 1 if message 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,uint64_t len);
 int ws_server_send_text_client_from_callback(int num,char* msg,uint64_t len);
@@ -114,7 +114,7 @@
  * @brief Sends text to all clients with the set url.
  * @param url The clients url.
  * @param msg The message to send.
- * @param The length of the message to send.
+ * @param len The length of the message to send.
  * @return The number of clients the message was send to.
  */
 int ws_server_send_text_clients(char* url,char* msg,uint64_t len);
@@ -123,7 +123,7 @@
 /**
  * @brief Sends text to all clients.
  * @param msg The message to send.
- * @param The length of the message to send.
+ * @param len The length of the message to send.
  * @return The number of clients the message was send to.
  */
 int ws_server_send_text_all(char* msg,uint64_t len);
@@ -133,8 +133,8 @@
  * @brief Send binary message to client with the set number.
  * @param num The client connection number.
  * @param msg The message to send.
- * @param The length of the message to send.
- * @retrun 1 if message send.
+ * @param len The length of the message to send.
+ * @return 1 if message send.
  */
 int ws_server_send_bin_client(int num,char* msg,uint64_t len);
 int ws_server_send_bin_client_from_callback(int num,char* msg,uint64_t len);
@@ -143,7 +143,7 @@
  * @brief Sends binary message to all clients with the set url.
  * @param url The clients url.
  * @param msg The message to send.
- * @param The length of the message to send.
+ * @param len The length of the message to send.
  * @return The number of clients the message was send to.
  */
 int ws_server_send_bin_clients(char* url,char* msg,uint64_t len);
@@ -151,13 +151,17 @@
 /**
  * @brief Sends binary message to all clients.
  * @param msg The message to send.
- * @param The length of the message to send.
+ * @param len The length of the message to send.
  * @return The number of clients the message was send to.
  */
 int ws_server_send_bin_all(char* msg,uint64_t len);
 
-
-int ws_server_ping(int num); // sends a ping to client num
+/**
+ * @brief Websocket ping (not working yet)
+ * @param num The connection number
+ * @return 1 if succeeded.
+ */
+int ws_server_ping(int num);
 
 #endif
 

mercurial