[commissioner] ensure synchronization with Border Agent (#4788)

This commit fixes situation when Commissioner can't be turned on or off,
due to incorrect state of the Border Agent.

In order to fix it:
 - a new COMMISSIONER state in the notifier module has been introduced
 - Border Agent API is not colled from the commissioner_api.cpp file
This commit is contained in:
Duda, Lukasz
2020-04-09 15:01:58 -07:00
committed by Jonathan Hui
parent 92796224b8
commit 58e771cbad
7 changed files with 45 additions and 19 deletions
+5 -4
View File
@@ -158,8 +158,9 @@ typedef void (*otCommissionerJoinerCallback)(otCommissionerJoinerEvent aEvent,
* @param[in] aJoinerCallback A pointer to a function that is called with a joiner event occurs.
* @param[in] aCallbackContext A pointer to application-specific context.
*
* @retval OT_ERROR_NONE Successfully started the Commissioner role.
* @retval OT_ERROR_INVALID_STATE Commissioner is already started.
* @retval OT_ERROR_NONE Successfully started the Commissioner service.
* @retval OT_ERROR_ALREADY Commissioner is already started.
* @retval OT_ERROR_INVALID_STATE Device is not currently attached to a network.
*
*/
otError otCommissionerStart(otInstance * aInstance,
@@ -172,8 +173,8 @@ otError otCommissionerStart(otInstance * aInstance,
*
* @param[in] aInstance A pointer to an OpenThread instance.
*
* @retval OT_ERROR_NONE Successfully stopped the Commissioner role.
* @retval OT_ERROR_INVALID_STATE Commissioner is already stopped.
* @retval OT_ERROR_NONE Successfully stopped the Commissioner service.
* @retval OT_ERROR_ALREADY Commissioner is already stopped.
*
*/
otError otCommissionerStop(otInstance *aInstance);
+1
View File
@@ -150,6 +150,7 @@ enum
OT_CHANGED_THREAD_BACKBONE_ROUTER_STATE = 1 << 25, ///< Backbone Router state changed
OT_CHANGED_THREAD_BACKBONE_ROUTER_LOCAL = 1 << 26, ///< Local Backbone Router configuration changed
OT_CHANGED_JOINER_STATE = 1 << 27, ///< Joiner state changed
OT_CHANGED_COMMISSIONER_STATE = 1 << 28, ///< Commissioner state changed
};
/**