docs(wifi_provisioning): Use heap to allocate memory for the response

Added a note to specify that the memory for the response of a custom endpoint
should be allocated using the heap, as this memory gets freed by the protocomm layer
once it has been passed to the transport layer.

Closes https://github.com/espressif/esp-idf/issues/13263
This commit is contained in:
harshal.patil
2024-03-04 16:28:13 +05:30
parent acb733845f
commit 483b87750c
2 changed files with 3 additions and 1 deletions

View File

@@ -230,6 +230,8 @@ static void get_device_service_name(char *service_name, size_t max)
/* Handler for the optional provisioning endpoint registered by the application.
* The data format can be chosen by applications. Here, we are using plain ascii text.
* Applications can choose to use other formats like protobuf, JSON, XML, etc.
* Note that memory for the response buffer must be allocated using heap as this buffer
* gets freed by the protocomm layer once it has been sent by the transport layer.
*/
esp_err_t custom_prov_data_handler(uint32_t session_id, const uint8_t *inbuf, ssize_t inlen,
uint8_t **outbuf, ssize_t *outlen, void *priv_data)