Skip to content

Commit

Permalink
Remove forced status update for all chunks
Browse files Browse the repository at this point in the history
Force update only for one chunk otap, or on first and last chunk (if not generated by stack start/stop)
  • Loading branch information
StephaneTriomphe committed Dec 18, 2024
1 parent 5119412 commit e9b35c4
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 3 deletions.
19 changes: 19 additions & 0 deletions lib/wpc_proto/internal_modules/proto_otap.c
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,13 @@ static app_res_e handle_scratchpad_chunk(uint8_t * chunk,

m_scratchpad_load_current_seq = seq;
res = WPC_start_local_scratchpad_update(total_size, seq);

/* Force parameters update */
if (!m_restart_after_load)
{
Proto_config_refresh_otap_infos();
}

if (res != APP_RES_OK)
{
m_scratchpad_load_current_seq = INVALID_CURRENT_SEQ;
Expand Down Expand Up @@ -93,6 +100,12 @@ static app_res_e handle_scratchpad_chunk(uint8_t * chunk,
{
/* Yes it is */
m_scratchpad_load_current_seq = INVALID_CURRENT_SEQ;

/* Force parameters update */
if (!m_restart_after_load)
{
Proto_config_refresh_otap_infos();
}
}

return APP_RES_OK;
Expand Down Expand Up @@ -160,6 +173,12 @@ app_proto_res_e Proto_otap_handle_upload_scratchpad(wp_UploadScratchpadReq *req,
LOGE("Upload scratchpad failed %d: with seq %d of size %d\n", res, req->seq, req->scratchpad.size);
}
m_scratchpad_load_current_seq = INVALID_CURRENT_SEQ;

/* Force parameters update */
if (!m_restart_after_load)
{
Proto_config_refresh_otap_infos();
}
}
}
else
Expand Down
3 changes: 0 additions & 3 deletions lib/wpc_proto/wpc_proto.c
Original file line number Diff line number Diff line change
Expand Up @@ -263,9 +263,6 @@ app_proto_res_e WPC_Proto_handle_request(const uint8_t * request_p,

res = Proto_otap_handle_upload_scratchpad(wp_message_req_p->upload_scratchpad_req,
upload_scratchpad_resp_p);

/* Update parameters */
Proto_config_refresh_otap_infos();
}
}
else if (wp_message_req_p->process_scratchpad_req)
Expand Down

0 comments on commit e9b35c4

Please sign in to comment.