]> granicus.if.org Git - esp-idf/commitdiff
protocomm : typos fixed and descriptions corrected
authorAnurag Kar <anurag.kar@espressif.com>
Fri, 8 Feb 2019 09:51:33 +0000 (15:21 +0530)
committerbot <bot@espressif.com>
Fri, 15 Feb 2019 10:45:34 +0000 (10:45 +0000)
13 files changed:
components/protocomm/include/common/protocomm.h
components/protocomm/include/security/protocomm_security.h
components/protocomm/include/security/protocomm_security1.h
components/protocomm/include/transports/protocomm_ble.h
components/protocomm/include/transports/protocomm_console.h
components/protocomm/include/transports/protocomm_httpd.h
components/protocomm/src/common/protocomm.c
components/protocomm/src/common/protocomm_priv.h
components/protocomm/src/simple_ble/simple_ble.c
components/protocomm/src/simple_ble/simple_ble.h
components/protocomm/src/transports/protocomm_ble.c
components/protocomm/src/transports/protocomm_console.c
components/protocomm/src/transports/protocomm_httpd.c

index 4ca65edf5c3cf53d63f350de46717637f756b033..239d71390b293ad3094454024bed5d1847d5675f 100644 (file)
@@ -46,7 +46,7 @@ typedef struct protocomm protocomm_t;
  * @brief   Create a new protocomm instance
  *
  * This API will return a new dynamically allocated protocomm instance
- * with all elements of the protocomm_t structure initialised to NULL.
+ * with all elements of the protocomm_t structure initialized to NULL.
  *
  * @return
  *  - protocomm_t* : On success
@@ -75,7 +75,8 @@ void protocomm_delete(protocomm_t *pc);
  *  - An endpoint must be bound to a valid protocomm instance,
  *    created using `protocomm_new()`.
  *  - This function internally calls the registered `add_endpoint()`
- *    function which is a member of the protocomm_t instance structure.
+ *    function of the selected transport which is a member of the
+ *    protocomm_t instance structure.
  *
  * @param[in] pc        Pointer to the protocomm instance
  * @param[in] ep_name   Endpoint identifier(name) string
@@ -85,7 +86,7 @@ void protocomm_delete(protocomm_t *pc);
  *                      Pass NULL if not needed.
  *
  * @return
- *  - ESP_OK : Added new endpoint succesfully
+ *  - ESP_OK : Success
  *  - ESP_FAIL : Error adding endpoint / Endpoint with this name already exists
  *  - ESP_ERR_NO_MEM : Error allocating endpoint resource
  *  - ESP_ERR_INVALID_ARG : Null instance/name/handler arguments
@@ -107,7 +108,7 @@ esp_err_t protocomm_add_endpoint(protocomm_t *pc, const char *ep_name,
  * @param[in] ep_name   Endpoint identifier(name) string
  *
  * @return
- *  - ESP_OK : Added new endpoint succesfully
+ *  - ESP_OK : Success
  *  - ESP_ERR_NOT_FOUND : Endpoint with specified name doesn't exist
  *  - ESP_ERR_INVALID_ARG : Null instance/name arguments
  */
@@ -115,12 +116,12 @@ esp_err_t protocomm_remove_endpoint(protocomm_t *pc, const char *ep_name);
 
 /**
  * @brief   Calls the registered handler of an endpoint session
- *          for processing incoming data and giving the output
+ *          for processing incoming data and generating the response
  *
  * @note
  *  - An endpoint must be bound to a valid protocomm instance,
  *    created using `protocomm_new()`.
- *  - Resulting output buffer must be deallocated by the user.
+ *  - Resulting output buffer must be deallocated by the caller.
  *
  * @param[in]  pc         Pointer to the protocomm instance
  * @param[in]  ep_name    Endpoint identifier(name) string
@@ -134,7 +135,7 @@ esp_err_t protocomm_remove_endpoint(protocomm_t *pc, const char *ep_name);
  * @param[out] outlen     Buffer length of the allocated output buffer
  *
  * @return
- *  - ESP_OK : Request handled succesfully
+ *  - ESP_OK : Request handled successfully
  *  - ESP_FAIL : Internal error in execution of registered handler
  *  - ESP_ERR_NO_MEM : Error allocating internal resource
  *  - ESP_ERR_NOT_FOUND : Endpoint with specified name doesn't exist
@@ -163,7 +164,7 @@ esp_err_t protocomm_req_handle(protocomm_t *pc, const char *ep_name, uint32_t se
  * @param[in] pop       Pointer to proof of possession for authenticating a client
  *
  * @return
- *  - ESP_OK : Added new security endpoint succesfully
+ *  - ESP_OK : Success
  *  - ESP_FAIL : Error adding endpoint / Endpoint with this name already exists
  *  - ESP_ERR_INVALID_STATE : Security endpoint already set
  *  - ESP_ERR_NO_MEM : Error allocating endpoint resource
@@ -183,7 +184,7 @@ esp_err_t protocomm_set_security(protocomm_t *pc, const char *ep_name,
  * @param[in] ep_name   Endpoint identifier(name) string
  *
  * @return
- *  - ESP_OK : Added new endpoint succesfully
+ *  - ESP_OK : Success
  *  - ESP_ERR_NOT_FOUND : Endpoint with specified name doesn't exist
  *  - ESP_ERR_INVALID_ARG : Null instance/name arguments
  */
@@ -193,7 +194,7 @@ esp_err_t protocomm_unset_security(protocomm_t *pc, const char *ep_name);
  * @brief   Set endpoint for version verification
  *
  * This API can be used for setting an application specific protocol
- * version which can be verfied by clients through the endpoint.
+ * version which can be verified by clients through the endpoint.
  *
  * @note
  *  - An endpoint must be bound to a valid protocomm instance,
@@ -204,7 +205,7 @@ esp_err_t protocomm_unset_security(protocomm_t *pc, const char *ep_name);
  * @param[in] version   Version identifier(name) string
  *
  * @return
- *  - ESP_OK : Added new security endpoint succesfully
+ *  - ESP_OK : Success
  *  - ESP_FAIL : Error adding endpoint / Endpoint with this name already exists
  *  - ESP_ERR_INVALID_STATE : Version endpoint already set
  *  - ESP_ERR_NO_MEM : Error allocating endpoint resource
@@ -223,7 +224,7 @@ esp_err_t protocomm_set_version(protocomm_t *pc, const char *ep_name,
  * @param[in] ep_name   Endpoint identifier(name) string
  *
  * @return
- *  - ESP_OK : Added new endpoint succesfully
+ *  - ESP_OK : Success
  *  - ESP_ERR_NOT_FOUND : Endpoint with specified name doesn't exist
  *  - ESP_ERR_INVALID_ARG : Null instance/name arguments
  */
index a97fb9ac8599e9b7cef8ad0c5ce85fd114dbd545..28f43a6574298dbafcbb43a1a644897d27024a0c 100644 (file)
@@ -46,12 +46,12 @@ typedef struct protocomm_security_pop {
  */
 typedef struct protocomm_security {
     /**
-     * Unique version number of security implmentation
+     * Unique version number of security implementation
      */
     int ver;
 
     /**
-     * Function for initialising/allocating security
+     * Function for initializing/allocating security
      * infrastructure
      */
     esp_err_t (*init)();
index 4d96f2cdea115c4e0929f105765d441177ebf492..12a05c322aa905ea023a9b635f7f98941744f4f9 100644 (file)
@@ -23,7 +23,7 @@ extern "C" {
 /**
  * @brief   Protocomm security version 1 implementation
  *
- * This is a full fledged security implmentation using
+ * This is a full fledged security implementation using
  * Curve25519 key exchange and AES-256-CTR encryption
  */
 extern const protocomm_security_t protocomm_security1;
index a6f4e64b402a0d2f18ede852f08f54af00e5d01f..562ea608cb2943ed29ec0b6176b7095812be3770 100644 (file)
@@ -67,10 +67,10 @@ typedef struct {
  * the initialization for characteristics/service for BLE.
  *
  * @param[in] pc        Protocomm instance pointer obtained from protocomm_new()
- * @param[in] config    Pointer to config structure for initialising BLE
+ * @param[in] config    Pointer to config structure for initializing BLE
  *
  * @return
- *  - ESP_OK : if successful
+ *  - ESP_OK : Success
  *  - ESP_FAIL : Simple BLE start error
  *  - ESP_ERR_NO_MEM : Error allocating memory for internal resources
  *  - ESP_ERR_INVALID_STATE : Error in ble config
@@ -89,7 +89,7 @@ esp_err_t protocomm_ble_start(protocomm_t *pc, const protocomm_ble_config_t *con
  * @param[in] pc    Same protocomm instance that was passed to protocomm_ble_start()
  *
  * @return
- *  - ESP_OK : For success or appropriate error code
+ *  - ESP_OK : Success
  *  - ESP_FAIL : Simple BLE stop error
  *  - ESP_ERR_INVALID_ARG : Null / incorrect protocomm instance
  */
index ffff72f65fd1ee9bcee3f46c136a71fe077a4933..767bcd7ca0170af43b51f8a0f992020602acc74a 100644 (file)
@@ -29,7 +29,7 @@ extern "C" {
  * @brief   Config parameters for protocomm console
  */
 typedef struct {
-    size_t   stack_size;        /*!< Stack size of console taks */
+    size_t   stack_size;        /*!< Stack size of console task */
     unsigned task_priority;     /*!< Priority of console task */
 } protocomm_console_config_t;
 
@@ -43,7 +43,7 @@ typedef struct {
  * @param[in] config Config param structure for protocomm console
  *
  * @return
- *  - ESP_OK : Server started succefully
+ *  - ESP_OK : Success
  *  - ESP_ERR_INVALID_ARG : Null arguments
  *  - ESP_ERR_NOT_SUPPORTED : Transport layer bound to another protocomm instance
  *  - ESP_ERR_INVALID_STATE : Transport layer already bound to this protocomm instance
@@ -57,7 +57,7 @@ esp_err_t protocomm_console_start(protocomm_t *pc, const protocomm_console_confi
  * @param[in] pc    Same protocomm instance that was passed to protocomm_console_start()
  *
  * @return
- *  - ESP_OK : Server stopped succefully
+ *  - ESP_OK : Success
  *  - ESP_ERR_INVALID_ARG : Null / incorrect protocomm instance pointer
  */
 esp_err_t protocomm_console_stop(protocomm_t *pc);
index cb7e88821fdfb662d471068331bf0404eacf6978..2baf75455123ce2c4a85ce69865fd3484c41dd6f 100644 (file)
@@ -31,7 +31,7 @@ extern "C" {
  */
 typedef struct {
 
-    uint16_t port;          /*!< Port on which the http server will listen */
+    uint16_t port;          /*!< Port on which the HTTP server will listen */
 
     /**
      * Stack size of server task, adjusted depending
@@ -41,11 +41,15 @@ typedef struct {
     unsigned task_priority; /*!< Priority of server task */
 } protocomm_http_server_config_t; /*!< HTTP Server Configuration, if HTTP Server has not been started already */
 
-/** Protocomm HTTPD Configuration Data */
+/** Protocomm HTTPD Configuration Data
+ */
 typedef union {
-    /** HTTP Server Handle, if ext_handle_provided is set to true */
+    /** HTTP Server Handle, if ext_handle_provided is set to true
+     */
     void *handle;
-    /** HTTP Server Configuration, if a server is not already active */
+
+    /** HTTP Server Configuration, if a server is not already active
+     */
     protocomm_http_server_config_t config;
 } protocomm_httpd_config_data_t;
 
@@ -72,10 +76,10 @@ typedef struct {
  *          one instance can be bound to an HTTP transport layer.
  *
  * @param[in] pc        Protocomm instance pointer obtained from protocomm_new()
- * @param[in] config    Pointer to config structure for initialising HTTP server
+ * @param[in] config    Pointer to config structure for initializing HTTP server
  *
  * @return
- *  - ESP_OK : Server started succefully
+ *  - ESP_OK : Success
  *  - ESP_ERR_INVALID_ARG : Null arguments
  *  - ESP_ERR_NOT_SUPPORTED : Transport layer bound to another protocomm instance
  *  - ESP_ERR_INVALID_STATE : Transport layer already bound to this protocomm instance
@@ -93,7 +97,7 @@ esp_err_t protocomm_httpd_start(protocomm_t *pc, const protocomm_httpd_config_t
  * @param[in] pc    Same protocomm instance that was passed to protocomm_httpd_start()
  *
  * @return
- *  - ESP_OK : Server stopped succefully
+ *  - ESP_OK : Success
  *  - ESP_ERR_INVALID_ARG : Null / incorrect protocomm instance pointer
  */
 esp_err_t protocomm_httpd_stop(protocomm_t *pc);
index b785d8e992c1192ac11b10b5950754ddfef353e9..687efdbab3cbb63e48a44d16332f7524f21bc5fc 100644 (file)
@@ -285,7 +285,7 @@ esp_err_t protocomm_set_security(protocomm_t *pc, const char *ep_name,
     if (sec->init) {
         ret = sec->init();
         if (ret != ESP_OK) {
-            ESP_LOGE(TAG, "Error initialising security");
+            ESP_LOGE(TAG, "Error initializing security");
             protocomm_remove_endpoint(pc, ep_name);
             return ret;
         }
index e956c3fd0630b66ccab03e647a21c249e8682067..895d1101510cd13f4edcfaa650bae51e164eeaa1 100644 (file)
@@ -62,7 +62,7 @@ struct protocomm {
     int (*remove_endpoint)(const char *ep_name);
 
     /* Pointer to security layer instance to be used internally for
-     * establising secure sessions */
+     * establishing secure sessions */
     const protocomm_security_t *sec;
 
     /* Pointer to proof of possession object */
index e52be0053527ac54718fdbb56434963b049b880e..f29f1a34801689e1044cdaff4c05629b89672622 100644 (file)
@@ -103,7 +103,7 @@ static void gatts_profile_event_handler(esp_gatts_cb_event_t event, esp_gatt_if_
         g_ble_cfg_p->exec_write_fn(event, gatts_if, param);
         break;
     case ESP_GATTS_MTU_EVT:
-        ESP_LOGV(TAG, "ESP_GATTS_MTU_EVT, MTU %d", param->mtu.mtu);
+        ESP_LOGD(TAG, "ESP_GATTS_MTU_EVT, MTU %d", param->mtu.mtu);
         if (g_ble_cfg_p->set_mtu_fn) {
             g_ble_cfg_p->set_mtu_fn(event, gatts_if, param);
         }
index 892cd4d559bc128138e09c337b5b9272bda69c40..4402429f6d6ea99bb9fa4fcb43c24caa22bc9c83 100644 (file)
@@ -55,7 +55,7 @@ typedef struct {
 } simple_ble_cfg_t;
 
 
-/** Initialise a simple ble connection
+/** Initialize a simple ble connection
  *
  * This function allocates memory and returns a pointer to the
  * configuration structure.
index 037f61d2966a07c448c781969575b915a0dbe248..b374f055e8dbdc15bf8205d783ab4d1a8950092f 100644 (file)
@@ -276,7 +276,7 @@ static void transport_simple_ble_exec_write(esp_gatts_cb_event_t event, esp_gatt
 static void transport_simple_ble_disconnect(esp_gatts_cb_event_t event, esp_gatt_if_t gatts_if, esp_ble_gatts_cb_param_t *param)
 {
     esp_err_t ret;
-    ESP_LOGV(TAG, "Inside disconnect w/ session - %d", param->disconnect.conn_id);
+    ESP_LOGD(TAG, "Inside disconnect w/ session - %d", param->disconnect.conn_id);
     if (protoble_internal->pc_ble->sec &&
         protoble_internal->pc_ble->sec->close_transport_session) {
         ret = protoble_internal->pc_ble->sec->close_transport_session(param->disconnect.conn_id);
@@ -290,7 +290,7 @@ static void transport_simple_ble_disconnect(esp_gatts_cb_event_t event, esp_gatt
 static void transport_simple_ble_connect(esp_gatts_cb_event_t event, esp_gatt_if_t gatts_if, esp_ble_gatts_cb_param_t *param)
 {
     esp_err_t ret;
-    ESP_LOGV(TAG, "Inside BLE connect w/ conn_id - %d", param->connect.conn_id);
+    ESP_LOGD(TAG, "Inside BLE connect w/ conn_id - %d", param->connect.conn_id);
     if (protoble_internal->pc_ble->sec &&
         protoble_internal->pc_ble->sec->new_transport_session) {
         ret = protoble_internal->pc_ble->sec->new_transport_session(param->connect.conn_id);
@@ -488,7 +488,7 @@ esp_err_t protocomm_ble_start(protocomm_t *pc, const protocomm_ble_config_t *con
     }
 
     prepare_write_env.prepare_buf = NULL;
-    ESP_LOGV(TAG, "Waiting for client to connect ......");
+    ESP_LOGD(TAG, "Waiting for client to connect ......");
     return ESP_OK;
 }
 
index 5c268bc49a32fd463582b279c383e1b3f3612ad3..e1e10a7720fbc56eb3143440eb8330e68ee221c6 100644 (file)
@@ -76,7 +76,7 @@ static void protocomm_console_task(void *arg)
     QueueHandle_t uart_queue;
     uart_event_t event;
 
-    ESP_LOGV(TAG, "Initialising UART on port %d", uart_num);
+    ESP_LOGD(TAG, "Initializing UART on port %d", uart_num);
     uart_driver_install(uart_num, 256, 0, 8, &uart_queue, 0);
     /* Initialize the console */
     esp_console_config_t console_config = {
index e81bf7fb9e07cf04d130233d19a76a75ad640b6a..b4653b9a5819e912a972c9fc23f335bce1ee3a2d 100644 (file)
@@ -26,7 +26,7 @@
 
 static const char *TAG = "protocomm_httpd";
 static protocomm_t *pc_httpd; /* The global protocomm instance for HTTPD */
-static bool pc_ext_httpd_handle_provided;
+static bool pc_ext_httpd_handle_provided = false;
 static uint32_t session_id = PROTOCOMM_NO_SESSION_ID;
 
 #define MAX_REQ_BODY_LEN 4096
@@ -42,9 +42,9 @@ static esp_err_t common_post_handler(httpd_req_t *req)
     int cur_session_id = httpd_req_to_sockfd(req);
 
     if (cur_session_id != session_id) {
-        /* Initialise new security session */
+        /* Initialize new security session */
         if (session_id != PROTOCOMM_NO_SESSION_ID) {
-            ESP_LOGV(TAG, "Closing session with ID: %d", session_id);
+            ESP_LOGD(TAG, "Closing session with ID: %d", session_id);
             /* Presently HTTP server doesn't support callback on socket closure so
              * previous session can only be closed when new session is requested */
             if (pc_httpd->sec && pc_httpd->sec->close_transport_session) {
@@ -66,7 +66,7 @@ static esp_err_t common_post_handler(httpd_req_t *req)
             }
         }
         session_id = cur_session_id;
-        ESP_LOGV(TAG, "New session with ID: %d", cur_session_id);
+        ESP_LOGD(TAG, "New session with ID: %d", cur_session_id);
     }
 
     if (req->content_len <= 0) {
@@ -133,7 +133,7 @@ static esp_err_t protocomm_httpd_add_endpoint(const char *ep_name,
         return ESP_ERR_INVALID_STATE;
     }
 
-    ESP_LOGV(TAG, "Adding endpoint : %s", ep_name);
+    ESP_LOGD(TAG, "Adding endpoint : %s", ep_name);
 
     /* Construct URI name by prepending '/' to ep_name */
     char* ep_uri = calloc(1, strlen(ep_name) + 2);
@@ -170,7 +170,7 @@ static esp_err_t protocomm_httpd_remove_endpoint(const char *ep_name)
         return ESP_ERR_INVALID_STATE;
     }
 
-    ESP_LOGV(TAG, "Removing endpoint : %s", ep_name);
+    ESP_LOGD(TAG, "Removing endpoint : %s", ep_name);
 
     /* Construct URI name by prepending '/' to ep_name */
     char* ep_uri = calloc(1, strlen(ep_name) + 2);