How do I read the Wi-Fi firmware version?

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
Anonymous
Not applicable

[WICED-SDK-2.2.1]

Is there an API for this?

0 Likes
1 Reply
Anonymous
Not applicable
We will add an API for this in the next SDK.

Until then, you can add the API manually as follows:

Add the following API function prototype to <WICED-SDK-2.2.1>/Wiced/WWD/include/wwd_wifi.h

/** Retrieves the WLAN firmware version

*

* @param[out] Pointer to a buffer that version information will be written to

* @param[in]  Length of the buffer

* @return     @ref wiced_result_t

*/

extern wiced_result_t wiced_wifi_get_wifi_version( char* version, uint8_t length );

Add the following API call to <WICED-SDK-2.2.1>/Wiced/WWD/internal/wwd_wifi.c

wiced_result_t wiced_wifi_get_wifi_version( char* version, uint8_t length )

{

    wiced_buffer_t buffer;

    wiced_buffer_t response;

    wiced_result_t result;

    if ( NULL == wiced_get_iovar_buffer( &buffer, length, IOVAR_STR_VERSION ) )

    {

        return WICED_ERROR;

    }

    result = wiced_send_iovar( SDPCM_GET, buffer, &response, SDPCM_STA_INTERFACE );

    if ( result == WICED_SUCCESS )

    {

        memcpy( version, host_buffer_get_current_piece_data_pointer( response ), length );

        host_buffer_release( response, WICED_NETWORK_RX );

    }

    return result;

}

0 Likes