The (alpha of the) official Exosite library, CoAP version.

NOTE: This mirror repository may be out of date, check the main repo for changes. If there are any remind me to update this mirror.

This is an unstable alpha of the Official Exosite library, there are known issues with the port to this platform. You probably shouldn't use this library yet if you just want to get things done.

This version uses CoAP for the application protocol.

Revision:
23:e94087cd483d
Parent:
20:e98884244926
Child:
24:cfbd25fc62c4
--- a/src/exosite.c	Tue Jan 06 10:08:06 2015 -0600
+++ b/src/exosite.c	Tue Jan 06 11:22:43 2015 -0600
@@ -62,6 +62,9 @@
 static uint16_t message_id_counter;
 static exo_device_state device_state = EXO_STATE_UNINITIALIZED;
 
+// Internal Constants
+static const int MINIMUM_DATAGRAM_SIZE = 576; // RFC791: all hosts must accept minimum of 576 octets
+
 /*!
  * \brief  Initializes the Exosite library
  *
@@ -290,13 +293,13 @@
 
 static void exo_process_waiting_datagrams(exo_op *op, uint8_t count)
 {
-  uint8_t buf[576];
+  uint8_t buf[MINIMUM_DATAGRAM_SIZE];
   coap_pdu pdu;
   coap_payload payload;
   int i;
 
   pdu.buf = buf;
-  pdu.max = 576;
+  pdu.max = MINIMUM_DATAGRAM_SIZE;
   pdu.len = 0;
 
   // receive a UDP packet if one or more waiting
@@ -431,13 +434,13 @@
 // process all ops that are in an active state
 static void exo_process_active_ops(exo_op *op, uint8_t count)
 {
-  uint8_t buf[576];
+  uint8_t buf[MINIMUM_DATAGRAM_SIZE];
   coap_pdu pdu;
   int i;
   uint64_t now = exopal_get_time();
 
   pdu.buf = buf;
-  pdu.max = 576;
+  pdu.max = MINIMUM_DATAGRAM_SIZE;
   pdu.len = 0;
 
   for (i = 0; i < count; i++) {