sntp module
This commit is contained in:
@ -4,11 +4,14 @@
|
||||
#include "freertos/task.h"
|
||||
#include "esp_wifi.h"
|
||||
#include "esp_log.h"
|
||||
#include <time.h>
|
||||
#include <sys/time.h>
|
||||
|
||||
#include "metrics.h"
|
||||
#include "outputs.h"
|
||||
#include "inputs.h"
|
||||
#include "safety.h"
|
||||
#include "sntp.h"
|
||||
|
||||
static const char *TAG = "smart-oil-heater-control-system-metrics";
|
||||
|
||||
@ -57,6 +60,21 @@ void taskMetrics(void *pvParameters)
|
||||
aMetrics[u16MetricCounter].fMetricValue = (esp_timer_get_time() / 1000000U);
|
||||
u16MetricCounter++;
|
||||
|
||||
/*SNTP Status*/
|
||||
strcpy(aMetrics[u16MetricCounter].caMetricName, "sntp_status");
|
||||
aMetrics[u16MetricCounter].fMetricValue = getSntpState();
|
||||
u16MetricCounter++;
|
||||
|
||||
/*System time
|
||||
time_t now;
|
||||
struct tm timeinfo;
|
||||
time(&now);
|
||||
localtime_r(&now, &timeinfo);
|
||||
strcpy(aMetrics[u16MetricCounter].caMetricName, "system_unixtime");
|
||||
aMetrics[u16MetricCounter].fMetricValue = (float) now;
|
||||
u16MetricCounter++;
|
||||
*/
|
||||
|
||||
/*Wifi RSSI*/
|
||||
wifi_ap_record_t ap;
|
||||
esp_wifi_sta_get_ap_info(&ap);
|
||||
|
Reference in New Issue
Block a user