Patch 1: Arduino pdu malloc fix.
authorJoseph Morrow <joseph.l.morrow@intel.com>
Fri, 12 Sep 2014 17:17:46 +0000 (13:17 -0400)
committerJoseph Morrow <joseph.l.morrow@intel.com>
Fri, 12 Sep 2014 17:18:13 +0000 (13:18 -0400)
Patch 2: Rebase

Patch 3: Changed implementation of fix to simply change size of
COAP_MAX_PDU_SIZE to 320 for Arduino only. This will stay the same
going forth, but there is an uncaught case that can only be fixed
in the next sprint(as there is not enough time)-- We must implement
blockwise transfer so that a PDU larger than 320 is properly
handled (i.e. broken up into chunks of 320 or smaller). A Rally task
has already been created for Sprint 8 for this.

Patch 4: Meant to use "else" instead of "elif".

Change-Id: I4df20d28c821f6fc2c98a6bf3672331264978be5

csdk/libcoap-4.1.1/pdu.h

index 058dac8..b6039a6 100644 (file)
@@ -30,7 +30,11 @@ extern "C" {
 #define COAP_DEFAULT_PORT           5683 /* CoAP default UDP port */
 #define COAP_DEFAULT_MAX_AGE          60 /* default maximum object lifetime in seconds */
 #ifndef COAP_MAX_PDU_SIZE
-#define COAP_MAX_PDU_SIZE           1400 /* maximum size of a CoAP PDU */
+#ifdef WITH_ARDUINO
+#define COAP_MAX_PDU_SIZE           320 /* maximum size of a CoAP PDU for embedded platforms*/
+#else
+#define COAP_MAX_PDU_SIZE           1400 /* maximum size of a CoAP PDU for big platforms*/
+#endif
 #endif /* COAP_MAX_PDU_SIZE */
 
 #define COAP_DEFAULT_VERSION           1 /* version of CoAP supported */