File tree Expand file tree Collapse file tree 4 files changed +23
-2
lines changed
test/nanostack/unittest/stub Expand file tree Collapse file tree 4 files changed +23
-2
lines changed Original file line number Diff line number Diff line change @@ -1183,15 +1183,24 @@ static void mac_pd_data_confirm_failure_handle(protocol_interface_rf_mac_setup_s
1183
1183
mcps_data_confirm_cb (rf_mac_setup , & mcps_data_conf , NULL );
1184
1184
}
1185
1185
1186
+
1186
1187
static void mac_pd_data_ack_handler (mac_pre_parsed_frame_t * buf )
1187
1188
{
1188
1189
protocol_interface_rf_mac_setup_s * rf_mac_setup = buf -> mac_class_ptr ;
1189
1190
1190
1191
if (!rf_mac_setup -> active_pd_data_request ) {
1191
1192
mcps_sap_pre_parsed_frame_buffer_free (buf );
1193
+ tr_debug ("RX ack without active buffer" );
1192
1194
} else {
1193
1195
mac_pre_build_frame_t * buffer = rf_mac_setup -> active_pd_data_request ;
1194
1196
1197
+ //Validate here ack is proper to active buffer
1198
+ if (!mac_pd_sap_ack_validation (rf_mac_setup , & buf -> fcf_dsn , mac_header_message_start_pointer (buf ))) {
1199
+ tr_debug ("Not a valid ACK for active tx process" );
1200
+ mcps_sap_pre_parsed_frame_buffer_free (buf );
1201
+ return ;
1202
+ }
1203
+
1195
1204
if (mac_ack_sap_rx_handler (buf , rf_mac_setup )) {
1196
1205
//Do not forward ACK payload but Accept ACK
1197
1206
mcps_sap_pre_parsed_frame_buffer_free (buf );
Original file line number Diff line number Diff line change @@ -655,12 +655,16 @@ static int8_t mac_data_interface_tx_done_by_ack_cb(protocol_interface_rf_mac_set
655
655
return 0 ;
656
656
}
657
657
658
- static bool mac_pd_sap_ack_validation (protocol_interface_rf_mac_setup_s * rf_ptr , const mac_fcf_sequence_t * fcf_dsn , const uint8_t * data_ptr )
658
+ bool mac_pd_sap_ack_validation (protocol_interface_rf_mac_setup_s * rf_ptr , const mac_fcf_sequence_t * fcf_dsn , const uint8_t * data_ptr )
659
659
{
660
- if (!rf_ptr -> active_pd_data_request || !rf_ptr -> active_pd_data_request -> fcf_dsn .ackRequested ) {
660
+ if (!rf_ptr -> active_pd_data_request || ( !rf_ptr -> active_pd_data_request -> fcf_dsn .ackRequested && ! rf_ptr -> active_pd_data_request -> ExtendedFrameExchange ) ) {
661
661
return false; //No active Data request anymore or no ACK request for current TX
662
662
}
663
663
664
+ if (rf_ptr -> active_pd_data_request -> ExtendedFrameExchange && fcf_dsn -> frametype == FC_DATA_FRAME ) {
665
+ return true;//EFDE final message
666
+ }
667
+
664
668
if (fcf_dsn -> frameVersion != rf_ptr -> active_pd_data_request -> fcf_dsn .frameVersion ) {
665
669
return false;
666
670
}
Original file line number Diff line number Diff line change 26
26
27
27
struct protocol_interface_rf_mac_setup ;
28
28
struct arm_phy_sap_msg_s ;
29
+ struct mac_fcf_sequence_s ;
29
30
30
31
#define ENHANCED_ACK_NEIGHBOUR_POLL_MAX_TIME_US 3500
31
32
@@ -61,4 +62,6 @@ void mac_pd_sap_state_machine(struct protocol_interface_rf_mac_setup *rf_mac_set
61
62
62
63
int8_t mac_data_edfe_force_stop (struct protocol_interface_rf_mac_setup * rf_ptr );
63
64
65
+ bool mac_pd_sap_ack_validation (struct protocol_interface_rf_mac_setup * rf_ptr , const struct mac_fcf_sequence_s * fcf_dsn , const uint8_t * data_ptr );
66
+
64
67
#endif /* MAC_PD_SAP_H_ */
Original file line number Diff line number Diff line change @@ -87,3 +87,8 @@ int8_t mac_data_edfe_force_stop(struct protocol_interface_rf_mac_setup *rf_ptr)
87
87
{
88
88
return 0 ;
89
89
}
90
+
91
+ bool mac_pd_sap_ack_validation (struct protocol_interface_rf_mac_setup * rf_ptr , const struct mac_fcf_sequence_s * fcf_dsn , const uint8_t * data_ptr )
92
+ {
93
+ return true;
94
+ }
You can’t perform that action at this time.
0 commit comments