-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathupdate_manager.cpp
49 lines (37 loc) · 1.55 KB
/
update_manager.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
/*
* @Author: Jakub Witowski
* @Project name: iBeacon
* @File name: update_manager.cpp
*/
/* ==================================================================== */
/* ========================== include files =========================== */
/* ==================================================================== */
#include "update_manager.h"
/* ==================================================================== */
/* ======================== global variables ========================== */
/* ==================================================================== */
/* Update manager handler */
Update_Manager ota;
/* Update Server handler */
ESP8266HTTPUpdateServer httpUpdater;
/* Web Server handler */
extern ESP8266WebServer WServer;
/* ==================================================================== */
/* ================== local function definitions ===================== */
/* ==================================================================== */
/*
* Update_Manager_Init()
* - This functions initializes OTA (Over The Air) update
*/
void Update_Manager::Update_Manager_Init()
{
Serial.printf("OTA -> Update request\r\n");
MDNS.begin(host);
Serial.printf("OTA -> MDNS host started\r\n");
httpUpdater.setup(&WServer, update_path, update_username, update_password);
Serial.printf("OTA -> Update Server setup complete\r\n");
MDNS.addService("http", "tcp", 80);
Serial.printf("OTA -> MDNS service added\r\n");
Serial.printf("OTA -> Update server: http://%s.local%s\r\n", host, update_path);
}
/* EOF */