Let ESP IDF manage app version
This commit is contained in:
@ -14,6 +14,7 @@
|
||||
#include "relays.h"
|
||||
|
||||
#include "esp_log.h"
|
||||
#include "esp_app_desc.h"
|
||||
|
||||
static const char *TAG = "secure_api";
|
||||
|
||||
@ -118,11 +119,13 @@ fail:
|
||||
*/
|
||||
static cJSON *genDevInfo()
|
||||
{
|
||||
const esp_app_desc_t *desc = esp_app_get_description();
|
||||
|
||||
cJSON *json = cJSON_CreateObject();
|
||||
if (!json)
|
||||
return NULL;
|
||||
cJSON_AddStringToObject(json, "reference", DEV_REFERENCE);
|
||||
cJSON_AddStringToObject(json, "version", DEV_VERSION);
|
||||
cJSON_AddStringToObject(json, "version", desc->version);
|
||||
cJSON_AddNumberToObject(json, "max_relays", relays_count());
|
||||
return json;
|
||||
}
|
||||
|
Reference in New Issue
Block a user