mirror of
https://github.com/sle118/squeezelite-esp32.git
synced 2025-12-08 12:37:01 +03:00
Merge branch 'Over_The_Air_Update' of
https://github.com/sle118/squeezelite-esp32.git into Over_The_Air_Update
This commit is contained in:
@@ -36,6 +36,7 @@ static struct {
|
||||
char * current_url;
|
||||
bool bRedirectFound;
|
||||
bool bOTAStarted;
|
||||
bool bInitialized;
|
||||
} ota_status;
|
||||
uint8_t lastpct=0;
|
||||
uint8_t newpct=0;
|
||||
@@ -45,6 +46,11 @@ static esp_http_client_config_t ota_config;
|
||||
static esp_http_client_handle_t client;
|
||||
|
||||
const char * ota_get_status(){
|
||||
if(!ota_status.bInitialized)
|
||||
{
|
||||
memset(ota_status.status_text, 0x00,sizeof(ota_status.status_text));
|
||||
ota_status.bInitialized = true;
|
||||
}
|
||||
return ota_status.status_text;
|
||||
}
|
||||
uint8_t ota_get_pct_complete(){
|
||||
@@ -187,7 +193,7 @@ void ota_task(void *pvParameter)
|
||||
{
|
||||
char * passedURL=(char *)pvParameter;
|
||||
memset(&ota_status, 0x00, sizeof(ota_status));
|
||||
|
||||
ota_status.bInitialized = true;
|
||||
ESP_LOGD(TAG, "HTTP ota Thread started");
|
||||
snprintf(ota_status.status_text,sizeof(ota_status.status_text)-1,"Initializing...");
|
||||
ota_status.bRedirectFound=false;
|
||||
|
||||
@@ -343,6 +343,7 @@ void http_server_netconn_serve(struct netconn *conn) {
|
||||
free(config_buffer);
|
||||
netconn_write(conn, json_end, strlen(json_end), NETCONN_NOCOPY);
|
||||
}
|
||||
ESP_LOGD(TAG,"Done serving config.json");
|
||||
}
|
||||
else if(strstr(line, "POST /config.json ")){
|
||||
ESP_LOGI(TAG,"Serving POST config.json");
|
||||
@@ -470,8 +471,6 @@ void http_server_netconn_serve(struct netconn *conn) {
|
||||
netconn_write(conn, http_404_hdr, sizeof(http_404_hdr) - 1, NETCONN_NOCOPY);
|
||||
}
|
||||
}
|
||||
// reset the buffer with nulls
|
||||
memset(buf, 0x00,buflen);
|
||||
/* free the buffer */
|
||||
netbuf_delete(inbuf);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user