Skip to content

Commit

Permalink
Fixed mac_pd_sap CCA_PREPARE active ACK handler.
Browse files Browse the repository at this point in the history
Change-Id: Ib423726b704b7ade4685e18c4941dd0e26a4131c
  • Loading branch information
Juha Heiskanen committed Aug 12, 2019
1 parent 035af9a commit 9b33e98
Showing 1 changed file with 23 additions and 1 deletion.
24 changes: 23 additions & 1 deletion test/nanostack/unittest/mac/mac_pd_sap/test_mac_pd_sap.c
Expand Up @@ -29,6 +29,7 @@
#include "test_mac_pd_sap.h"
#include "mac_header_helper_functions_stub.h"
#include "mac_mcps_sap_stub.h"
#include "mac_security_mib_stub.h"
#include "nsdynmemLIB_stub.h"
#include "fhss_config_stub.h"
#include "sw_mac_stub.h"
Expand Down Expand Up @@ -817,11 +818,32 @@ bool test_mac_cca_prepare_cb()
phy_message.message.mac15_4_pd_sap_confirm.status = PHY_LINK_CCA_PREPARE;

int8_t ret = mac_pd_sap_data_cb(&rf_ptr, &phy_message);
if (ret != -1) {
return false;
}

rf_ptr.ack_tx_possible = true;
ret = mac_pd_sap_data_cb(&rf_ptr, &phy_message);
if (ret != 0) {
return false;
}

rf_ptr.mac_ack_tx_active = false;
rf_ptr.ack_tx_possible = false;

rf_ptr.enhanced_ack_handler_timestamp = 10;
mlme_device_descriptor_t test_neigh;
mac_security_mib_stub.device_ptr = &test_neigh;

ret = mac_pd_sap_data_cb(&rf_ptr, &phy_message);
if (ret != 0) {
return false;
}
mac_security_mib_stub.device_ptr = NULL;

ret = mac_pd_sap_data_cb(&rf_ptr, &phy_message);
if (ret != -1 || rf_ptr.mac_ack_tx_active) {
return false;
}

ret = mac_pd_sap_data_cb(&rf_ptr, &phy_message);
if (ret != -1) {
Expand Down

0 comments on commit 9b33e98

Please sign in to comment.