EasyManuals Logo

Espressif ESP32-S2 User Manual

Espressif ESP32-S2
1695 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Page #679 background imageLoading...
Page #679 background image
Chapter 2. API Reference
[in] pc: Pointer to the protocomm instance to be deleted
esp_err_t protocomm_add_endpoint(protocomm_t *pc, const char *ep_name, proto-
comm_req_handler_t h, void *priv_data)
Add endpoint request handler for a protocomm instance.
This API will bind an endpoint handler function to the specied endpoint name, along with any private data
that needs to be pass to the handler at the time of call.
Note
An endpoint must be bound to a valid protocomm instance, created using protocomm_new().
This function internally calls the registered add_endpoint() function of the selected transport
which is a member of the protocomm_t instance structure.
Return
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
Parameters
[in] pc: Pointer to the protocomm instance
[in] ep_name: Endpoint identier(name) string
[in] h: Endpoint handler function
[in] priv_data: Pointer to private data to be passed as a parameter to the handler function on
call. Pass NULL if not needed.
esp_err_t protocomm_remove_endpoint(protocomm_t *pc, const char *ep_name)
Remove endpoint request handler for a protocomm instance.
This API will remove a registered endpoint handler identied by an endpoint name.
Note
This function internally calls the registered remove_endpoint() function which is a member
of the protocomm_t instance structure.
Return
ESP_OK : Success
ESP_ERR_NOT_FOUND : Endpoint with specied name doesnt exist
ESP_ERR_INVALID_ARG : Null instance/name arguments
Parameters
[in] pc: Pointer to the protocomm instance
[in] ep_name: Endpoint identier(name) string
esp_err_t protocomm_open_session(protocomm_t *pc, uint32_t session_id)
Allocates internal resources for new transport session.
Note
An endpoint must be bound to a valid protocomm instance, created using protocomm_new().
Return
ESP_OK : Request handled successfully
ESP_ERR_NO_MEM : Error allocating internal resource
ESP_ERR_INVALID_ARG : Null instance/name arguments
Parameters
[in] pc: Pointer to the protocomm instance
[in] session_id: Unique ID for a communication session
esp_err_t protocomm_close_session(protocomm_t *pc, uint32_t session_id)
Frees internal resources used by a transport session.
Note
An endpoint must be bound to a valid protocomm instance, created using protocomm_new().
Return
ESP_OK : Request handled successfully
ESP_ERR_INVALID_ARG : Null instance/name arguments
Parameters
Espressif Systems 668
Submit Document Feedback
Release v4.4

Table of Contents

Questions and Answers:

Question and Answer IconNeed help?

Do you have a question about the Espressif ESP32-S2 and is the answer not in the manual?

Espressif ESP32-S2 Specifications

General IconGeneral
BrandEspressif
ModelESP32-S2
CategorySingle board computers
LanguageEnglish