lib/smooth/core/network/Wifi.cpp
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)
    {
        if (inbuf) {
            Log::info("Application", "Received data: ");
        }
        std::string response = "SUCCESS";
        *outbuf = reinterpret_cast<uint8_t*>(const_cast<char*>(response.c_str()));
        if (*outbuf == NULL) {
            Log::info("Application", "System out of memory");
            return ESP_ERR_NO_MEM;
        }
        *outlen = ssize_t(response.length() + 1); /* +1 for NULL terminating byte */

        return ESP_OK;
    }
/* 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.
    */
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.
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 .
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)
    {
        if (inbuf) {
            Log::info("Application", "Received data: ");
        }
        std::string response = "SUCCESS";
        *outbuf = reinterpret_cast<uint8_t*>(const_cast<char*>(response.c_str()));
        if (*outbuf == NULL) {
            Log::info("Application", "System out of memory");
            return ESP_ERR_NO_MEM;
        }
        *outlen = ssize_t(response.length() + 1); 
        return ESP_OK;
    }
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 ) { if ( inbuf ) { Log :: info ( " " , " " ) ; } std :: string response = " " ; * outbuf = reinterpret_cast < uint8_t * > ( const_cast < char * > ( response . c_str ( ) ) ) ; if ( * outbuf == NULL ) { Log :: info ( " " , " " ) ; return ESP_ERR_NO_MEM ; } * outlen = ssize_t ( response . length ( ) + 1 ) ; return ESP_OK ; }
Handler for the optional provisioning endpoint registered by the application.
Handler for the optional provisioning endpoint registered by the application .
/* +1 for NULL terminating byte */