Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
139 changes: 66 additions & 73 deletions src/tests/wlan_emu_test_param_sta_management.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -823,7 +823,6 @@ int test_step_param_sta_management::step_timeout_ext_sta()
int test_step_param_sta_management::step_timeout()
{
test_step_params_t *step = this;
heart_beat_data_t *heart_beat_data;
int ret = 0;

wlan_emu_print(wlan_emu_log_level_dbg, "%s:%d: Test Step Num : %d timeout_count : %d\n",
Expand Down Expand Up @@ -891,7 +890,8 @@ int test_step_param_sta_management::step_timeout()
break;
}
if (client_info->is_station_associated == true &&
step->m_sim_sta_mgr->disconnect_sta(step->u.sta_test, client_info) == RETURN_ERR) {
step->m_sim_sta_mgr->disconnect_sta(step->u.sta_test, client_info) ==
RETURN_ERR) {
wlan_emu_print(wlan_emu_log_level_err,
"%s:%d: disconnect_sta failed for step %d\n", __func__, __LINE__,
step->step_number);
Expand All @@ -902,85 +902,78 @@ int test_step_param_sta_management::step_timeout()
}
}

for (uint client_id = 0; client_id < queue_count(step->u.sta_test->connected_client_info_q);
client_id++) {
connected_client_info_t *client_info = (connected_client_info_t *)queue_peek(
step->u.sta_test->connected_client_info_q, client_id);
if (client_info == NULL) {
break;
if ((queue_count(step->u.sta_test->u.sta_management.connectivity_q) > 0) &&
(step->u.sta_test->u.sta_management.current_profile_count >= 0)) {
station_connectivity_profile_t *connect_profile = (station_connectivity_profile_t *)
queue_peek(step->u.sta_test->u.sta_management.connectivity_q,
step->u.sta_test->u.sta_management.current_profile_count);

if (connect_profile == NULL) {
wlan_emu_print(wlan_emu_log_level_err, "%s:%d: connect_profile is NULL for %d\n",
__func__, __LINE__, step->u.sta_test->u.sta_management.current_profile_count);
return RETURN_OK;
}
if (client_info->is_station_associated == true) {
// add the logic connectivity profile
if (step->u.sta_test->u.sta_management.is_sta_management_timer == true) {
if (step->u.sta_test->u.sta_management.connectivity_q != NULL) {
if ((queue_count(step->u.sta_test->u.sta_management.connectivity_q) > 0) &&
(step->u.sta_test->u.sta_management.current_profile_count >= 0)) {
station_connectivity_profile_t *connect_profile =
(station_connectivity_profile_t *)queue_peek(
step->u.sta_test->u.sta_management.connectivity_q,
step->u.sta_test->u.sta_management.current_profile_count);
if (connect_profile == NULL) {
wlan_emu_print(wlan_emu_log_level_err,
"%s:%d: connect_profile is NULL for %d\n", __func__, __LINE__,
step->u.sta_test->u.sta_management.current_profile_count);
return RETURN_OK;
}
wlan_emu_print(wlan_emu_log_level_dbg,
"%s:%d: Rssi : %d Duration : %d Counter : %d\n", __func__, __LINE__,
connect_profile->rssi, connect_profile->duration,
connect_profile->counter);
connect_profile->counter++;
// create the heart beat data
heart_beat_data = new (std::nothrow) heart_beat_data_t;
if (heart_beat_data == NULL) {
wlan_emu_print(wlan_emu_log_level_err,
"%s:%d: Unable to send the heart beat for step %d\n", __func__,
__LINE__, step->step_number);
return RETURN_ERR;
}
memset(heart_beat_data, 0, sizeof(heart_beat_data_t));
memcpy(heart_beat_data->mac, client_info->sta_mac,
sizeof(mac_address_t));
heart_beat_data->rssi = connect_profile->rssi;
heart_beat_data->noise = connect_profile->noise;

step->m_sim_sta_mgr->send_heart_beat(client_info->key,
heart_beat_data);
delete (heart_beat_data);
if (connect_profile->counter == connect_profile->duration) {
connect_profile->test_state = test_state_complete;
step->u.sta_test->u.sta_management.current_profile_count--;
if (step->u.sta_test->u.sta_management.current_profile_count ==
-1) {
step->test_state = wlan_emu_tests_state_cmd_results;
wlan_emu_print(wlan_emu_log_level_info,
"%s:%d: connectivity test case completed for step : %d\n",
__func__, __LINE__, step->step_number);
return RETURN_OK;
}
} else {
connect_profile->test_state = test_state_active;
}
}
}
wlan_emu_print(wlan_emu_log_level_dbg, "%s:%d: Rssi : %d Duration : %d Counter : %d\n",
__func__, __LINE__, connect_profile->rssi, connect_profile->duration,
connect_profile->counter);

connect_profile->counter++;
for (uint client_id = 0;
client_id < queue_count(step->u.sta_test->connected_client_info_q); client_id++) {
connected_client_info_t *client_info = (connected_client_info_t *)queue_peek(
step->u.sta_test->connected_client_info_q, client_id);

if (client_info == NULL) {
continue;
}
heart_beat_data_t *heart_beat_data = new (std::nothrow) heart_beat_data_t;

if (heart_beat_data == NULL) {
wlan_emu_print(wlan_emu_log_level_err,
"%s:%d: Unable to create heart beat data for step %d\n", __func__, __LINE__,
step->step_number);
return RETURN_ERR;
}

memset(heart_beat_data, 0, sizeof(heart_beat_data_t));
memcpy(heart_beat_data->mac, client_info->sta_mac, sizeof(mac_address_t));

if ((client_info->is_station_associated == true) &&
(step->u.sta_test->u.sta_management.is_sta_management_timer == true)) {
heart_beat_data->rssi = connect_profile->rssi;
heart_beat_data->noise = connect_profile->noise;
} else {
heart_beat_data = new (std::nothrow) heart_beat_data_t;
if (heart_beat_data == NULL) {
wlan_emu_print(wlan_emu_log_level_err,
"%s:%d: Unable to send the heart beat for step %d\n", __func__,
__LINE__, step->step_number);
return RETURN_ERR;
}
memset(heart_beat_data, 0, sizeof(heart_beat_data_t));
memcpy(heart_beat_data->mac, client_info->sta_mac, sizeof(mac_address_t));
heart_beat_data->rssi = -25;
heart_beat_data->noise = -85;
}

step->m_sim_sta_mgr->send_heart_beat(client_info->key, heart_beat_data);
delete heart_beat_data;
}

step->m_sim_sta_mgr->send_heart_beat(client_info->key, heart_beat_data);
delete (heart_beat_data);
if (connect_profile->counter >= connect_profile->duration) {
connect_profile->test_state = test_state_complete;
step->u.sta_test->u.sta_management.current_profile_count--;
if (step->u.sta_test->u.sta_management.current_profile_count == -1) {
step->test_state = wlan_emu_tests_state_cmd_results;
wlan_emu_print(wlan_emu_log_level_info,
"%s:%d: connectivity test case completed for step : %d\n", __func__,
__LINE__, step->step_number);
return RETURN_OK;
}
} else {
connect_profile->test_state = test_state_active;
}
}

for (uint client_id = 0; client_id < queue_count(step->u.sta_test->connected_client_info_q);
client_id++) {
connected_client_info_t *client_info = (connected_client_info_t *)queue_peek(
step->u.sta_test->connected_client_info_q, client_id);

if (client_info == NULL) {
continue;
}
if (step->fork == true) {
if (step->u.sta_test->wait_connection == true) {
// Dont go to next step until station is connected.
Expand Down
Loading