Skip to content

Commit 991d155

Browse files
committed
TSCH: use RSSI data from received EB packets in the link stats module
1 parent 53911eb commit 991d155

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

os/net/mac/tsch/tsch.c

+8-4
Original file line numberDiff line numberDiff line change
@@ -505,17 +505,21 @@ tsch_rx_process_pending()
505505
&& frame.fcf.frame_type == FRAME802154_BEACONFRAME;
506506

507507
if(is_data) {
508-
/* Skip EBs and other control messages */
509-
/* Copy to packetbuf for processing */
508+
/* Copy payload to packetbuf for processing */
510509
packetbuf_copyfrom(current_input->payload, current_input->len);
511510
packetbuf_set_attr(PACKETBUF_ATTR_RSSI, current_input->rssi);
512511
packetbuf_set_attr(PACKETBUF_ATTR_CHANNEL, current_input->channel);
513-
}
514512

515-
if(is_data) {
516513
/* Pass to upper layers */
517514
packet_input();
515+
518516
} else if(is_eb) {
517+
/* Don't pass to upper layers, but still count it in link stats */
518+
packetbuf_set_attr(PACKETBUF_ATTR_RSSI, current_input->rssi);
519+
packetbuf_set_attr(PACKETBUF_ATTR_CHANNEL, current_input->channel);
520+
link_stats_input_callback((const linkaddr_t *)frame.src_addr);
521+
522+
/* Process EB without copying the payload to packetbuf */
519523
eb_input(current_input);
520524
}
521525

0 commit comments

Comments
 (0)