Espressif ESP32-S2 Programming Manual page 680

Table of Contents

Advertisement

Chapter 2. API Reference
• [in] pc: Pointer to the protocomm instance
• [in] session_id: Unique ID for a communication session
esp_err_t protocomm_req_handle(protocomm_t
Calls the registered handler of an endpoint session 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 caller.
Return
• 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
• ESP_ERR_INVALID_ARG : Null instance/name arguments
Parameters
• [in] pc: Pointer to the protocomm instance
• [in] ep_name: Endpoint identifier(name) string
• [in] session_id: Unique ID for a communication session
• [in] inbuf: Input buffer contains input request data which is to be processed by the registered
handler
• [in] inlen: Length of the input buffer
• [out] outbuf: Pointer to internally allocated output buffer, where the resulting response data
output from the registered handler is to be stored
• [out] outlen: Buffer length of the allocated output buffer
esp_err_t protocomm_set_security(protocomm_t
Add endpoint security for a protocomm instance.
This API will bind a security session establisher to the specified endpoint name, along with any proof of
possession that may be required for authenticating a session client.
Note
• An endpoint must be bound to a valid protocomm instance, created using protocomm_new().
• The choice of security can be any protocomm_security_t instance. Choices proto-
comm_security0 and protocomm_security1 are readily available.
Return
• 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
• ESP_ERR_INVALID_ARG : Null instance/name/handler arguments
Parameters
• [in] pc: Pointer to the protocomm instance
• [in] ep_name: Endpoint identifier(name) string
• [in] sec: Pointer to endpoint security instance
• [in] pop: Pointer to proof of possession for authenticating a client
esp_err_t protocomm_unset_security(protocomm_t
Remove endpoint security for a protocomm instance.
This API will remove a registered security endpoint identified by an endpoint name.
Return
• ESP_OK : Success
• ESP_ERR_NOT_FOUND : Endpoint with specified name doesn't exist
• ESP_ERR_INVALID_ARG : Null instance/name arguments
Parameters
Espressif Systems
*pc, const char *ep_name, uint32_t session_id,
const uint8_t *inbuf, ssize_t inlen, uint8_t **outbuf, ssize_t
*outlen)
*pc, const char *ep_name, const
tocomm_security_t
*sec, const
*pop)
*pc, const char *ep_name)
669
Submit Document Feedback
pro-
protocomm_security_pop_t
Release v4.4

Advertisement

Table of Contents
loading
Need help?

Need help?

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

Subscribe to Our Youtube Channel

Table of Contents

Save PDF