apache / mynewt-mcumgr

Apache mynewt
https://mynewt.apache.org/
99 stars 76 forks source link

Add event callbacks on command handlers #16

Closed MariuszSkamra closed 5 years ago

MariuszSkamra commented 6 years ago

Those callbacks will be needed to i.e. track state of firmware update, Notify about reboot going to happen etc.

Signed-off-by: Mariusz Skamra mariusz.skamra@codecoup.pl

MariuszSkamra commented 6 years ago

I updated PR with respect to your comments @rymanluk now, everytime, command will fail, MGMT_EVT_OP_CMD_DONE will be sent anyway, with error status as defined by MGMTERR defines. @nvlsianpu To avoid confusion, I changed statuses to opcodes MGMT_EVT_OPCMD adding 3rd MGMT_EVT_OP_CMD_STATUS which argument can be status of upload. This way I avoid 0x80 shift, which might be confusing. @carlescufi I will create an issue for this one to keep it in mind. Note, that it is not necessary feature, and in some cases (lack of display??) percentages are not needed IMO.

MariuszSkamra commented 5 years ago

@nvlsianpu done