What is an RSSI and how do I retrieve the RSSI and MAC address of each client connected to my WICED SoftAP?

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

cross mob
Anonymous
Not applicable

RSSI or Received Signal Strength Indicator is the measurement of the power present in a received radio signal.

Use the wiced_wifi_get_associated_client_list( ) function to get the list of stations connected to the WICED SoftAP. The MAC address of each connected client is stored in a wiced_mac_t type structure.

wiced_mac_t is defined as:

 

typedef struct  

{

    uint8_t octet[6]; /**< Unique 6-byte MAC address */

} wiced_mac_t;

The mac address can then be passed to the function wiced_wifi_get_ap_client_rssi( ):

int32_t             rssi = 0;

int                   client_number = 0;

wiced_result_t  result;

struct

{

    int    count;

    wiced_mac_t     mac_list[MAX_SOFT_AP_CLIENTS];

} client_info;

/* Get the list of the stations connected to Wiced soft AP */

result = wiced_wifi_get_associated_client_list( &client_info, sizeof(client_info) );

if ( result == WICED_SUCCESS )

{

    for ( client_number=0; client_number < client_info.count; client_number++ )

    {

        /* Get the RSSI of every client currently connected to the soft AP */

        result = wiced_wifi_get_ap_client_rssi(&rssi, &client_info.mac_list[client_number]);

      

        if ( result == WICED_SUCCESS )

        {

            WPRINT_APP_INFO(("| %d | %02x:%02x:%02x:%02x:%02x:%02x | %3lddBm |\r\n",

                                            client_number,

                                            client_info.mac_list[client_number].octet[0],

                                            client_info.mac_list[client_number].octet[1],

                                            client_info.mac_list[client_number].octet[2],

                                            client_info.mac_list[client_number].octet[3],

                                            client_info.mac_list[client_number].octet[4],

                                            client_info.mac_list[client_number].octet[5],

                                            rssi ));           

        }

    }

}

API Details:

wiced_result_t wiced_wifi_get_associated_client_list ( void *    client_list_buffer,

                                                                                    uint16_t          buffer_length )                             

Gets information about associated clients.

Note:

Only applicable if softAP interface is up

Parameters

I/O

Description

client_list_buffer

out

Pointer to a buffer that will be populated with a variable length structure defined by wiced_maclist_t.

buffer_length

in

Length of the buffer.

Return

WICED_SUCCESS if client list retrieval is successful.

wiced_result_t wiced_wifi_get_ap_client_rssi( int32_t* rssi,  wiced_mac_t* client_mac_addr )

Retrieve the latest RSSI value of the AP client.

Parameters

I/O

Description

rssi

out

Latest RSSI of the client.

client_mac_addr

in

Mac address of the AP client

Return

WICED_SUCCESS if RSSI is successfully retrieved.

0 Likes
0 Replies