Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
C
Controller
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
4
Issues
4
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Package Registry
Container Registry
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Guardians of the Kretschmar Elock System
Controller
Commits
c7e37549
Commit
c7e37549
authored
Oct 02, 2020
by
Jacob Priddy
👌
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix attempt 2
parent
2fc2f977
Pipeline
#12692
passed with stages
in 1 minute and 12 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
11 deletions
+17
-11
main/src/connectors/esp32/esp_http.c
main/src/connectors/esp32/esp_http.c
+17
-11
No files found.
main/src/connectors/esp32/esp_http.c
View file @
c7e37549
...
...
@@ -194,18 +194,24 @@ int door_http_post(
}
current_request_callbacks
=
callbacks
;
esp_http_client_set_url
(
handle
,
path
);
esp_http_client_set_method
(
handle
,
HTTP_METHOD_POST
);
esp_http_client_set_post_field
(
client
,
data
,
strlen
(
data
));
esp_err_t
err
=
esp_http_client_perform
(
handle
);
if
(
err
!=
ESP_OK
)
{
ESP_LOGE
(
TAG
,
"Error perform http request %s"
,
esp_err_to_name
(
err
));
return
DOOR_HTTP_ERR_FAIL
;
for
(
int
tries
=
0
;
tries
<
5
;
++
tries
)
{
esp_http_client_set_url
(
handle
,
path
);
esp_http_client_set_method
(
handle
,
HTTP_METHOD_POST
);
esp_http_client_set_post_field
(
client
,
data
,
strlen
(
data
));
esp_err_t
err
=
esp_http_client_perform
(
handle
);
if
(
err
==
ESP_OK
)
{
int
status_code
=
esp_http_client_get_status_code
(
handle
);
ESP_LOGI
(
TAG
,
"Status code from POST call: %d"
,
status_code
);
return
status_code
;
}
ESP_LOGE
(
TAG
,
"Error perform http request %s. Retrying..."
,
esp_err_to_name
(
err
));
esp_http_client_close
(
handle
);
}
int
status_code
=
esp_http_client_get_status_code
(
handle
);
ESP_LOGI
(
TAG
,
"Status code from POST call: %d"
,
status_code
);
return
status_code
;
return
DOOR_HTTP_ERR_FAIL
;
}
static
esp_err_t
door_http_ota_update_validate_image_header
(
esp_app_desc_t
*
new_app_info
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment