Merge pull request #456 from adamdunkels/push/6lowpan-changes
6lowpan changes
This commit is contained in:
commit
acee82abbb
2 changed files with 18 additions and 1 deletions
|
@ -257,6 +257,8 @@ static struct timer reass_timer;
|
|||
#define sicslowpan_len uip_len
|
||||
#endif /* SICSLOWPAN_CONF_FRAG */
|
||||
|
||||
static int last_rssi;
|
||||
|
||||
/*-------------------------------------------------------------------------*/
|
||||
/* Rime Sniffer support for one single listener to enable powertrace of IP */
|
||||
/*-------------------------------------------------------------------------*/
|
||||
|
@ -1604,6 +1606,9 @@ input(void)
|
|||
/* The MAC puts the 15.4 payload inside the RIME data buffer */
|
||||
rime_ptr = packetbuf_dataptr();
|
||||
|
||||
/* Save the RSSI of the incoming packet in case the upper layer will
|
||||
want to query us for it later. */
|
||||
last_rssi = (signed short)packetbuf_attr(PACKETBUF_ATTR_RSSI);
|
||||
#if SICSLOWPAN_CONF_FRAG
|
||||
/* if reassembly timed out, cancel it */
|
||||
if(timer_expired(&reass_timer)) {
|
||||
|
@ -1666,7 +1671,12 @@ input(void)
|
|||
*/
|
||||
#define PRIORITIZE_NEW_PACKETS 1
|
||||
#if PRIORITIZE_NEW_PACKETS
|
||||
if(processed_ip_in_len > 0 && first_fragment
|
||||
|
||||
if(!is_fragment) {
|
||||
/* Prioritize non-fragment packets too. */
|
||||
sicslowpan_len = 0;
|
||||
processed_ip_in_len = 0;
|
||||
} else if(processed_ip_in_len > 0 && first_fragment
|
||||
&& !rimeaddr_cmp(&frag_sender, packetbuf_addr(PACKETBUF_ADDR_SENDER))) {
|
||||
sicslowpan_len = 0;
|
||||
processed_ip_in_len = 0;
|
||||
|
@ -1900,6 +1910,12 @@ sicslowpan_init(void)
|
|||
#endif /* SICSLOWPAN_COMPRESSION == SICSLOWPAN_COMPRESSION_HC06 */
|
||||
}
|
||||
/*--------------------------------------------------------------------*/
|
||||
int
|
||||
sicslowpan_get_last_rssi(void)
|
||||
{
|
||||
return last_rssi;
|
||||
}
|
||||
/*--------------------------------------------------------------------*/
|
||||
const struct network_driver sicslowpan_driver = {
|
||||
"sicslowpan",
|
||||
sicslowpan_init,
|
||||
|
|
|
@ -317,6 +317,7 @@ struct sicslowpan_nh_compressor {
|
|||
|
||||
};
|
||||
|
||||
int sicslowpan_get_last_rssi(void);
|
||||
|
||||
extern const struct network_driver sicslowpan_driver;
|
||||
|
||||
|
|
Loading…
Reference in a new issue