Skip to content
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

update verify active job logic #183

Merged
merged 2 commits into from
Feb 25, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 11 additions & 1 deletion source/ota.c
Original file line number Diff line number Diff line change
Expand Up @@ -2014,7 +2014,17 @@ static OtaJobParseErr_t verifyActiveJobStatus( OtaFileContext_t * pFileContext,

/* Abort the current job. */
( void ) otaAgent.pOtaInterface->pal.setPlatformImageState( &( otaAgent.fileContext ), OtaImageStateAborted );
( void ) otaClose( &( otaAgent.fileContext ) );

/*
* Abort any active file access and release the file resource, if needed.
*/
( void ) otaAgent.pOtaInterface->pal.abort( pFileContext );

/* Cleanup related to selected protocol. */
if( otaDataInterface.cleanup != NULL )
{
( void ) otaDataInterface.cleanup( &otaAgent );
}

/* Set new active job name. */
( void ) memcpy( otaAgent.pActiveJobName, pFileContext->pJobName, strlen( ( const char * ) pFileContext->pJobName ) );
Expand Down