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:
18:c463fb80d81d
Parent:
17:661d4a5b7c1b
Child:
19:323801b9c74e
--- a/src/exosite.c	Sun Jan 04 12:14:33 2015 -0600
+++ b/src/exosite.c	Sun Jan 04 12:21:11 2015 -0600
@@ -262,7 +262,7 @@
       return EXO_ERROR;
     case EXO_STATE_INITIALIZED:
     case EXO_STATE_BAD_CIK:
-      if (op[0].state == EXO_REQUEST_NULL && op[0].timeout == 0)
+      if (op[0].state == EXO_REQUEST_NULL || op[0].timeout < exopal_get_time())
         exo_activate(&op[0]);
     case EXO_STATE_GOOD:
       break;
@@ -385,7 +385,10 @@
             op[i].state = EXO_REQUEST_ERROR;
 
             if (coap_get_code(&pdu) == CC_UNAUTHORIZED){
-              device_state = EXO_STATE_BAD_CIK;
+              //device_state = EXO_STATE_BAD_CIK;
+
+              if (op[0].type == EXO_NULL || op[0].timeout < exopal_get_time())
+                exo_activate(&op[0]);
             } else if (coap_get_code(&pdu) == CC_NOT_FOUND) {
               device_state = EXO_STATE_GOOD;
             }