1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2025-12-25 22:43:50 +01:00

sys/transceiver: cleanup and fix for cc2420 and at86rf231

cc2420: the payload pointer was set twice
at86rf231: payload_len was not copied from the radio driver buffer
This commit is contained in:
Thomas Eichinger 2014-10-06 16:33:59 +02:00
parent 6fcc2ac777
commit 2f27388d04
2 changed files with 5 additions and 5 deletions

View File

@ -28,7 +28,7 @@
#define ENABLE_DEBUG (0)
#if ENABLE_DEBUG
#define DEBUG_ENABLED (1)
#define DEBUG_ENABLED
#endif
#include "debug.h"
@ -68,7 +68,7 @@ void at86rf231_rx_handler(void)
at86rf231_rx_buffer[rx_buffer_next].length);
if (at86rf231_rx_buffer[rx_buffer_next].frame.fcf.frame_type != 2) {
#if DEBUG_ENABLED
#ifdef DEBUG_ENABLED
ieee802154_frame_print_fcf_frame(&at86rf231_rx_buffer[rx_buffer_next].frame);
#endif
@ -81,7 +81,7 @@ void at86rf231_rx_handler(void)
}
}
else {
#if DEBUG_ENABLED
#ifdef DEBUG_ENABLED
DEBUG("GOT ACK for SEQ %u\n", at86rf231_rx_buffer[rx_buffer_next].frame.seq_nr);
ieee802154_frame_print_fcf_frame(&at86rf231_rx_buffer[rx_buffer_next].frame);
#endif

View File

@ -573,6 +573,7 @@ void receive_cc2420_packet(ieee802154_packet_t *trans_p)
memcpy(&data_buffer[transceiver_buffer_pos * CC2420_MAX_DATA_LENGTH],
p->frame.payload, p->frame.payload_len);
trans_p->frame.payload = (uint8_t *) & (data_buffer[transceiver_buffer_pos * CC2420_MAX_DATA_LENGTH]);
trans_p->frame.payload_len = p->frame.payload_len;
eINT();
#ifdef DEBUG_ENABLED
@ -608,8 +609,6 @@ void receive_cc2420_packet(ieee802154_packet_t *trans_p)
return;
}
#endif
trans_p->frame.payload = (uint8_t *) &(data_buffer[transceiver_buffer_pos * CC2420_MAX_DATA_LENGTH]);
trans_p->frame.payload_len = p->frame.payload_len;
DEBUG("transceiver: Content: %s\n", trans_p->data);
}
#endif
@ -667,6 +666,7 @@ void receive_at86rf231_packet(ieee802154_packet_t *trans_p)
memcpy(&data_buffer[transceiver_buffer_pos * AT86RF231_MAX_DATA_LENGTH], p->frame.payload,
p->frame.payload_len);
trans_p->frame.payload = (uint8_t *) & (data_buffer[transceiver_buffer_pos * AT86RF231_MAX_DATA_LENGTH]);
trans_p->frame.payload_len = p->frame.payload_len;
eINT();
#ifdef DEBUG_ENABLED