fixed content type for dynamic resources, added for test modem command
with callback
This commit is contained in:
parent
a0ec795652
commit
6c20a210f9
|
|
@ -70,6 +70,10 @@ static esp_err_t set_content_type_from_file(httpd_req_t *req,
|
||||||
{
|
{
|
||||||
return httpd_resp_set_type(req, "font/woff2");
|
return httpd_resp_set_type(req, "font/woff2");
|
||||||
}
|
}
|
||||||
|
else if (IS_FILE_EXT(filename, ".json"))
|
||||||
|
{
|
||||||
|
return httpd_resp_set_type(req, "application/json");
|
||||||
|
}
|
||||||
/* This is a limited set only */
|
/* This is a limited set only */
|
||||||
/* For any other type always set as plain text */
|
/* For any other type always set as plain text */
|
||||||
return httpd_resp_set_type(req, "text/plain");
|
return httpd_resp_set_type(req, "text/plain");
|
||||||
|
|
|
||||||
|
|
@ -331,9 +331,15 @@ void ModemSendAT(char *cmd, char *resp, int timeout)
|
||||||
ESP_LOGI(TAG, "Response:%s", resp);
|
ESP_LOGI(TAG, "Response:%s", resp);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
esp_err_t cmd_cb(uint8_t* data, int len)
|
||||||
|
{
|
||||||
|
ESP_LOGI(TAG, "Response:%*s", len, data);
|
||||||
|
return ESP_OK;
|
||||||
|
}
|
||||||
|
|
||||||
void ModemSendSMS(void)
|
void ModemSendSMS(void)
|
||||||
{
|
{
|
||||||
|
esp_modem_command(dce, "atd", &cmd_cb, 3000);
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
||||||
|
|
@ -147,6 +147,10 @@ static esp_err_t set_content_type_from_file(httpd_req_t *req,
|
||||||
{
|
{
|
||||||
return httpd_resp_set_type(req, "font/woff2");
|
return httpd_resp_set_type(req, "font/woff2");
|
||||||
}
|
}
|
||||||
|
else if (IS_FILE_EXT(filename, ".json"))
|
||||||
|
{
|
||||||
|
return httpd_resp_set_type(req, "application/json");
|
||||||
|
}
|
||||||
/* This is a limited set only */
|
/* This is a limited set only */
|
||||||
/* For any other type always set as plain text */
|
/* For any other type always set as plain text */
|
||||||
return httpd_resp_set_type(req, "text/plain");
|
return httpd_resp_set_type(req, "text/plain");
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user