initial publish

Dependencies:   mbed-rtos mbed

Files at this revision

API Documentation at this revision

Comitter:
boddeke
Date:
Thu Jun 02 11:44:51 2016 +0000
Parent:
0:31e47b639d0f
Commit message:
update

Changed in this revision

main.cpp Show annotated file Show diff for this revision Revisions of this file
payload.h Show annotated file Show diff for this revision Revisions of this file
diff -r 31e47b639d0f -r f5b145be9d8e main.cpp
--- a/main.cpp	Wed May 18 08:37:47 2016 +0000
+++ b/main.cpp	Thu Jun 02 11:44:51 2016 +0000
@@ -17,6 +17,7 @@
     
     pc.printf("---- checking changes: ");
     
+    // carefull... do not use if(hasChanges())
     int changes = hasChanges();
     
     if(changes) {
@@ -45,6 +46,15 @@
     pc.printf(        "* Build: " __DATE__ ", " __TIME__" *\r\n");
     pc.printf(        "********************************\r\n\r\n");
     
+    pc.printf("sizeof(char) = %d\r\n",sizeof(char));
+    pc.printf("sizeof(short) = %d\r\n",sizeof(short));
+    pc.printf("sizeof(int) = %d\r\n",sizeof(int));
+    pc.printf("sizeof(long) = %d\r\n",sizeof(long));
+     
+    
+    pc.printf("Node ID:    %d\r\n",NODE_ID);
+    pc.printf("Node STATE: %d\r\n",NODE_STATE);
+    
     sender_ticker.attach(&sender, SEND_INTERVAL);
     
     pc.printf("\r\n\r\npayload size: %d bytes\r\n",sizeof(Payload));
diff -r 31e47b639d0f -r f5b145be9d8e payload.h
--- a/payload.h	Wed May 18 08:37:47 2016 +0000
+++ b/payload.h	Thu Jun 02 11:44:51 2016 +0000
@@ -3,10 +3,18 @@
 // on: 20160519
 #include <Semaphore.h>
 
-#pragma pack(push, 1)
+enum NodeStates { development = 0, preproduction = 1, production = 2};
+#define NODE_ID                     0x01
+#define NODE_STATE           development
 
-#define NODE_ID    0x01
+#define CONTACT_NOACK_MIN          10000
+#undef  CONTACT_NOACK_MAX   
+#define CONTACT_ACK_MIN          3600000
+#define CONTACT_ACK_MAX          3600000
 
+#define CONTACT_MAX_TOTAL_PER_DAY    100
+
+#pragma pack(push, 1)
 typedef struct payloadvalues{
   unsigned char node_id;
   unsigned char reed_sensor_value: 1;