Anonymous
Not applicable
Apr 08, 2013
09:12 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Apr 08, 2013
09:12 PM
[WICED-SDK-2.2.1]
Is there an API for this?
Labels
- Labels:
-
softAP
- Tags:
- &buffer
- &response
- @param[out]
- @ref
- addresses
- applicable
- array
- buffer
- buffer_length
- call
- check_ioctl_buffer
- client_list_buffer
- clients
- count
- data
- describing
- determine
- function
- host_buffer_get_current_piece_data_pointer
- host_buffer_release
- interface
- length
- list
- mac_list[1]
- memcpy
- number
- pointer
- response
- return
- sdpcm_get
- sdpcm_sta_interface
- size_tminhost_buffer_get_current_piece_sizeresponse
- softap
- struct
- structure
- typedef
- uint16_t
- uint32_t
- variable
- wiced_buffer_t
- wiced_error
- wiced_get_ioctl_buffer
- wiced_mac_t
- wiced_maclist_t
- wiced_network_rx
- wiced_result_t
- wiced_send_ioctl
- wiced_success
- wiced_wifi_get_associated_client_list
- wlc_get_assoclist
1 Reply
Anonymous
Not applicable
Apr 08, 2013
09:15 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Apr 08, 2013
09:15 PM
We will add an API for this in the next SDK release.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
/** Gets information about associated clients. * * @note Only applicable if softAP interface is up * * @param[out] pointer to a buffer that will be populated with a variable length structure defined by @ref wiced_maclist_t * @param[in] length of the buffer * * @return @ref wiced_result_t */extern wiced_result_t wiced_wifi_get_associated_client_list( void* client_list_buffer, uint16_t buffer_length );Add the following API call to <WICED-SDK-2.2.1>/Wiced/WWD/internal/wwd_wifi.c
wiced_result_t wiced_wifi_get_associated_client_list( void* client_list_buffer, uint16_t buffer_length ){ wiced_buffer_t buffer; wiced_buffer_t response; uint32_t* data = (uint32_t*) wiced_get_ioctl_buffer( &buffer, buffer_length ); CHECK_IOCTL_BUFFER( data ); if ( wiced_send_ioctl( SDPCM_GET, WLC_GET_ASSOCLIST, buffer, &response, SDPCM_STA_INTERFACE ) == WICED_SUCCESS ) { memcpy( client_list_buffer, (void*) host_buffer_get_current_piece_data_pointer( response ), (size_t)MIN(host_buffer_get_current_piece_size(response), buffer_length) ); host_buffer_release( response, WICED_NETWORK_RX ); return WICED_SUCCESS; } return WICED_ERROR;}FYI, the wiced_maclist_t structure looks like this ...
/** * Structure describing a list of associated softAP clients */typedef struct{ uint32_t count; /**< Number of MAC addresses in the list */ wiced_mac_t mac_list[1]; /**< Variable length array of MAC addresses */} wiced_maclist_t;