26 lines
580 B
C++
26 lines
580 B
C++
#include "esp_log.h"
|
|
#include "system_init.h"
|
|
#include "freertos/FreeRTOS.h"
|
|
#include "freertos/projdefs.h"
|
|
#include "freertos/task.h"
|
|
#include "protocol.h"
|
|
|
|
static const char* TAG = "iot_fish";
|
|
|
|
extern "C" void app_main(void)
|
|
{
|
|
system_init();
|
|
|
|
for (int i=0; i<5; i++)
|
|
{
|
|
char buf[512];
|
|
int len = build_telemetry_single(buf, sizeof(buf), "123", "dev1", 123456, "temperature", 22.5, "C", nullptr, 0);
|
|
|
|
if (len > 0) {
|
|
ESP_LOGI("protocol", "%s\n", buf);
|
|
}
|
|
vTaskDelay(pdMS_TO_TICKS(1000));
|
|
}
|
|
|
|
system_finalize();
|
|
} |