-
Notifications
You must be signed in to change notification settings - Fork 74
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix logic for handling custom jobs #164
Conversation
aggarw13
commented
Feb 15, 2021
•
edited
Loading
edited
- Improve handling of custom jobs by calling the user-defined callback only if the Job ID and job document data can be parsed from JSON payload.
- Remove instances of custom callback from from API
4ddc82f
to
f4046d5
Compare
907014f
to
2f9906f
Compare
static OtaJobParseErr_t parseJobDocFromCustomCallback( const char * pJson, | ||
uint32_t messageLength ); | ||
static OtaJobParseErr_t handleCustomJob( const char * pJson, | ||
uint32_t messageLength ); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
messageLength should be size_t
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The messageLength
parameter comes from parseJobDoc
function. Changing the type across the function call chain would be out of scope of this PR.
uint32_t messageLength ) | ||
/* If there is an error in parsing the json, check if it can be handled by external callback. */ | ||
static OtaJobParseErr_t handleCustomJob( const char * pJson, | ||
uint32_t messageLength ) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
messageLength should be size_t
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same as this reply.