MNT: Add a function to set internal state (#232)

When master, it's up to the application to put master state into operational.
We had a function to do this so that we don't have to write directly in NMT structure
This commit is contained in:
jdascenzio 2020-10-01 10:21:45 +02:00 committed by GitHub
parent b7251ee1dd
commit 09f1083ae6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 17 additions and 0 deletions

View File

@ -351,3 +351,9 @@ CO_NMT_internalState_t CO_NMT_getInternalState(
return CO_NMT_INITIALIZING;
}
void CO_NMT_setInternalState(
CO_NMT_t *NMT,
CO_NMT_internalState_t state)
{
NMT->operatingState = state;
}

View File

@ -252,6 +252,17 @@ CO_NMT_reset_cmd_t CO_NMT_process(
CO_NMT_internalState_t CO_NMT_getInternalState(
CO_NMT_t *NMT);
/**
* Set current NMT state
*
* @param NMT This object.
* @param CO_NMT_internalState_t State to set
*
*/
void CO_NMT_setInternalState(
CO_NMT_t *NMT,
CO_NMT_internalState_t state);
#ifdef __cplusplus
}