Add error handling for mqtt, fixed some issues

This commit is contained in:
Tuan PM
2018-05-03 21:50:24 +07:00
parent 4bc37bb8db
commit 75d3c65cb6
13 changed files with 414 additions and 234 deletions

View File

@@ -23,9 +23,13 @@
#include "esp_log.h"
#include "esp_system.h"
#define mem_assert(x) assert(x)
char *platform_create_id_string();
int platform_random(int max);
long long platform_tick_get_ms();
void ms_to_timeval(int timeout_ms, struct timeval *tv);
#define ESP_MEM_CHECK(TAG, a, action) if (!(a)) { \
ESP_LOGE(TAG,"%s:%d (%s): %s", __FILE__, __LINE__, __FUNCTION__, "Memory exhausted"); \
action; \
}
#endif