#include <time.h>
#include <sys/time.h>

#include "Settings.h"
#include <esp_mac.h>
#include "SensorData.h"


void createHeader(struct MESSAGE_HEADER * header)
{
	struct timeval tv;
	gettimeofday(&tv, NULL);
	header->type = MESSAGE_TYPE_HEADER;
	header->sec = tv.tv_sec;
	header->usec = tv.tv_usec;
	header->group_id = SETTINGS.device.group_id;
	esp_read_mac(header->mac, ESP_MAC_WIFI_STA);
}