From 78e3a75b9cfa7d226a922801eb62400e2ef92442 Mon Sep 17 00:00:00 2001 From: Matthias Kovatsch Date: Wed, 19 Jun 2013 14:48:04 +0200 Subject: [PATCH] Updated buffer definition macro due to core changes. --- apps/er-coap-03/er-coap-03.h | 4 ++-- apps/er-coap-07/er-coap-07.h | 4 ++-- apps/er-coap-12/er-coap-12.h | 4 ++-- apps/er-coap-13/er-coap-13.h | 10 +++++----- 4 files changed, 11 insertions(+), 11 deletions(-) diff --git a/apps/er-coap-03/er-coap-03.h b/apps/er-coap-03/er-coap-03.h index 00a292bcb..fb69bd63a 100644 --- a/apps/er-coap-03/er-coap-03.h +++ b/apps/er-coap-03/er-coap-03.h @@ -85,8 +85,8 @@ #define COAP_MAX_ATTEMPTS 4 #endif /* COAP_MAX_ATTEMPTS */ -#define UIP_IP_BUF ((struct uip_ip_hdr *)&uip_buf[UIP_LLH_LEN]) -#define UIP_UDP_BUF ((struct uip_udp_hdr *)&uip_buf[uip_l2_l3_hdr_len]) +#define UIP_IP_BUF ((struct uip_ip_hdr *)&uip_buf[UIP_LLH_LEN]) +#define UIP_UDP_BUF ((struct uip_udp_hdr *)&uip_buf[UIP_LLH_LEN + UIP_IPH_LEN]) #define SET_OPTION(packet, opt) ((packet)->options |= 1<options & 1<options |= 1L<options & 1L< */ -#ifndef COAP_12_H_ -#define COAP_12_H_ +#ifndef COAP_13_H_ +#define COAP_13_H_ #include /* for size_t */ #include "contiki-net.h" @@ -92,8 +92,8 @@ #define COAP_MAX_ATTEMPTS 4 #endif /* COAP_MAX_ATTEMPTS */ -#define UIP_IP_BUF ((struct uip_ip_hdr *)&uip_buf[UIP_LLH_LEN]) -#define UIP_UDP_BUF ((struct uip_udp_hdr *)&uip_buf[uip_l2_l3_hdr_len]) +#define UIP_IP_BUF ((struct uip_ip_hdr *)&uip_buf[UIP_LLH_LEN]) +#define UIP_UDP_BUF ((struct uip_udp_hdr *)&uip_buf[UIP_LLH_LEN + UIP_IPH_LEN]) /* Bitmap for set options */ enum { OPTION_MAP_SIZE = sizeof(uint8_t) * 8 }; @@ -379,4 +379,4 @@ int coap_set_header_size(void *packet, uint32_t size); int coap_get_payload(void *packet, const uint8_t **payload); int coap_set_payload(void *packet, const void *payload, size_t length); -#endif /* COAP_12_H_ */ +#endif /* COAP_13_H_ */