esp-ena/main/main.c

42 lines
1.0 KiB
C
Raw Normal View History

2020-07-11 12:11:34 +02:00
/**
* provide bluetooth part of Exposure Notification API v1.2 as defined by Apple/Google
*
2020-07-11 12:11:34 +02:00
* Source documents:
*
2020-07-11 12:11:34 +02:00
* https://blog.google/documents/70/Exposure_Notification_-_Bluetooth_Specification_v1.2.2.pdf
*
2020-07-11 12:11:34 +02:00
* https://covid19-static.cdn-apple.com/applications/covid19/current/static/detection-tracing/pdf/ExposureNotification-BluetoothSpecificationv1.2.pdf
*
*
*
2020-07-11 12:11:34 +02:00
*/
#include <stdio.h>
#include "freertos/FreeRTOS.h"
#include "freertos/task.h"
#include <time.h>
#include <sys/time.h>
#include "esp_system.h"
#include "esp_log.h"
#include "ena.h"
#include "ena-storage.h"
#include "ena-interface.h"
#include "ena-interface-menu.h"
2020-07-11 12:11:34 +02:00
#include "sdkconfig.h"
void app_main(void)
{
// DEBUG set time
struct timeval tv = {1594459800, 0}; // current hardcoded timestamp (2020-07-11 09:30:00) ¯\_(ツ)_/¯
settimeofday(&tv, NULL);
esp_log_level_set(ENA_STORAGE_LOG, ESP_LOG_INFO);
// ena_storage_erase(); // only needed on first start! TODO automatically check
2020-07-11 12:11:34 +02:00
ena_interface_start();
ena_interface_menu_start();
ena_start();
2020-07-11 12:11:34 +02:00
}