You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mynewt.apache.org by GitBox <gi...@apache.org> on 2018/07/01 23:53:17 UTC

[GitHub] ccollins476ad edited a comment on issue #1234: mgmt/imgmgr: Allow app to reject image upload reqs

ccollins476ad edited a comment on issue #1234: mgmt/imgmgr: Allow app to reject image upload reqs
URL: https://github.com/apache/mynewt-core/pull/1234#issuecomment-401641737
 
 
   Thanks, Andrzej.  Regarding `ULLONG_MAX` vs `UINT32_MAX`- I think it is correct, but please let me know if I got it wrong.  The only two values that are compared with `ULLONG_MAX` are: 1) `req->off` and `req->size`.  Both of these members are of type `unsigned long long`, and are both initialized to `ULLONG_MAX` in `imgr_upload()` (line 587).
   
   When I look at it now, I think this is really confusing.  The other struct type, `struct imgr_upload_action`,  uses`uint32_t` for its `size` member, *not* `unsigned long long`.  This inconsistency seems weird to me, so now I think I should change this member's type to `unsigned long long`.  The reason `imgr_upload_req` uses `unsigned long long` is just that that is what the CBOR library uses for decoding, and I didn't want to waste stack space by allocating separate temporaries to decode into.
   
   Regarding the callback on each received request- I was thinking the application may want to reject an image upgrade due to low battery.  If the battery level became critically low in the middle of the upgrade, the application would want to abort the procedure at that point.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services