Skip to content

Commit 9b33e98

Browse files
author
Juha Heiskanen
committed
Fixed mac_pd_sap CCA_PREPARE active ACK handler.
Change-Id: Ib423726b704b7ade4685e18c4941dd0e26a4131c
1 parent 035af9a commit 9b33e98

File tree

1 file changed

+23
-1
lines changed

1 file changed

+23
-1
lines changed

test/nanostack/unittest/mac/mac_pd_sap/test_mac_pd_sap.c

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929
#include "test_mac_pd_sap.h"
3030
#include "mac_header_helper_functions_stub.h"
3131
#include "mac_mcps_sap_stub.h"
32+
#include "mac_security_mib_stub.h"
3233
#include "nsdynmemLIB_stub.h"
3334
#include "fhss_config_stub.h"
3435
#include "sw_mac_stub.h"
@@ -817,11 +818,32 @@ bool test_mac_cca_prepare_cb()
817818
phy_message.message.mac15_4_pd_sap_confirm.status = PHY_LINK_CCA_PREPARE;
818819

819820
int8_t ret = mac_pd_sap_data_cb(&rf_ptr, &phy_message);
821+
if (ret != -1) {
822+
return false;
823+
}
824+
825+
rf_ptr.ack_tx_possible = true;
826+
ret = mac_pd_sap_data_cb(&rf_ptr, &phy_message);
820827
if (ret != 0) {
821828
return false;
822829
}
823830

824-
rf_ptr.mac_ack_tx_active = false;
831+
rf_ptr.ack_tx_possible = false;
832+
833+
rf_ptr.enhanced_ack_handler_timestamp = 10;
834+
mlme_device_descriptor_t test_neigh;
835+
mac_security_mib_stub.device_ptr = &test_neigh;
836+
837+
ret = mac_pd_sap_data_cb(&rf_ptr, &phy_message);
838+
if (ret != 0) {
839+
return false;
840+
}
841+
mac_security_mib_stub.device_ptr = NULL;
842+
843+
ret = mac_pd_sap_data_cb(&rf_ptr, &phy_message);
844+
if (ret != -1 || rf_ptr.mac_ack_tx_active) {
845+
return false;
846+
}
825847

826848
ret = mac_pd_sap_data_cb(&rf_ptr, &phy_message);
827849
if (ret != -1) {

0 commit comments

Comments
 (0)