voltando a versao de n aberturas e fechamentos de sockets data 19/09

Dependencies:   EthernetInterface NTPClient mbed-rtos mbed EALib

Fork of header_main_publish by VZTECH

Revision:
14:22a35f575502
Parent:
8:e3bfe62a477e
Child:
17:67a6b557eda5
--- a/utils.h	Tue Sep 16 15:09:11 2014 +0000
+++ b/utils.h	Tue Sep 16 21:02:37 2014 +0000
@@ -3,6 +3,7 @@
 
 #include <iostream>
 #include <string.h>
+#include "debug.h"
 #include "mbed.h"
 #include "EthernetInterface.h"
 #include "vz_protocol.h"
@@ -21,8 +22,12 @@
 extern DigitalOut led2;
 extern DigitalOut led3;
 extern DigitalOut led4;
-
-#define set_status(a,b) a = b
+#define set_status(a,b) _set_status(a,b)
+#define _set_status(a,b){ \
+  if( a != b ) debug_msg("Anterior %d -- Atual %d", a, b ); \
+  if( a != NULL || b != NULL ) a = b; \
+  else debug_msg("Paramento sip null"); \
+}
 
 void reverse( char str[], int length );
 char* itoa(int num, char* str, int base);