Tag outgoing TCP packets with the ERELIABLE attribute so that an underlying power-saving MAC protocol can treat them differently, because it knows that an ACK might be arriving soon

This commit is contained in:
adamdunkels 2009-04-29 11:40:33 +00:00
parent 92862ad2a5
commit c02a82ac41

View File

@ -28,7 +28,7 @@
*
* This file is part of the Contiki operating system.
*
* $Id: uip-over-mesh.c,v 1.11 2009/03/12 21:58:20 adamdunkels Exp $
* $Id: uip-over-mesh.c,v 1.12 2009/04/29 11:40:33 adamdunkels Exp $
*/
/**
@ -234,6 +234,13 @@ uip_over_mesh_send(void)
packetbuf_copyfrom(&uip_buf[UIP_LLH_LEN], uip_len);
/* Send TCP data with the PACKETBUF_ATTR_ERELIABLE set so that
an underlying power-saving MAC layer knows that it should be
waiting for an ACK. */
if(BUF->proto == UIP_PROTO_TCP) {
packetbuf_set_attr(PACKETBUF_ATTR_ERELIABLE, 1);
}
rt = route_lookup(&receiver);
if(rt == NULL) {
PRINTF("uIP over mesh no route to %d.%d\n", receiver.u8[0], receiver.u8[1]);