Add APIs to provide service_state_changed callback 34/220434/10
authorJi-hoon Lee <dalton.lee@samsung.com>
Wed, 18 Dec 2019 05:30:04 +0000 (14:30 +0900)
committerJi-hoon Lee <dalton.lee@samsung.com>
Fri, 27 Mar 2020 15:35:57 +0000 (15:35 +0000)
Change-Id: Ia983bf6d2f8184d7baae9701153e8dededaf7020

doc/uix_ma_doc.h
include/multi_assistant.h
include/multi_assistant_common.h
include/multi_assistant_internal.h

index a46a76394657ee16ed876b136d03422d5d2a9246..ca328ffa42753073142f64801ce45ab6c675e8ac 100644 (file)
  * @section CAPI_UIX_MULTI_ASSISTANT_MODULE_HEADER Required Header
  * \#include <multi_assistant.h><br>
  *
- * @section CAPI_UIX_MULTI_ASSISTANT_MODULE_STATE_TRANSITIONS State Transitions
+ * @section CAPI_UIX_MULTI_ASSISTANT_MODULE_CLIENT_STATE_TRANSITIONS Client State Transitions
  * <table>
  * <tr>
  * <th>FUNCTION</th>
- * <th>PRE-STATE</th>
- * <th>POST-STATE</th>
+ * <th>PRE-CLIENT-STATE</th>
+ * <th>POST-CLIENT-STATE</th>
  * <th>SYNC TYPE</th>
  * </tr>
  * <tr>
 * </tr>
 * </table>
 *
-* @section CAPI_UIX_MULTI_ASSISTANT_MODULE_STATE_DEPENDENT_FUNCTION_CALLS State Dependent Function Calls
-* The following table shows state-dependent function calls.
-* It is forbidden to call functions listed below in wrong states.
+* @section CAPI_UIX_MULTI_ASSISTANT_MODULE_CLIENT_STATE_DEPENDENT_FUNCTION_CALLS Client State Dependent Function Calls
+* The following table shows client-state-dependent function calls.
+* It is forbidden to call functions listed below in wrong client states.
 * Violation of this rule may result in an unpredictable behavior.
 * <table>
 * <tr>
 * <th>FUNCTION</th>
-* <th>VALID STATES</th>
+* <th>VALID CLIENT STATES</th>
 * <th>DESCRIPTION</th>
 * </tr>
 * <tr>
 * ma_set_audio_streaming_data_section_changed_cb()<br>
 * ma_unset_audio_streaming_data_section_changed_cb()</td>
 * <td>Initialized</td>
-* <td> All callback function should be registered in Initialized state </td>
+* <td> All callback function should be registered in Initialized client state </td>
 * </tr>
 * </table>
 *
index b5781c649d9235f2b587d42b146967ed4ea509fd..87eb02571c352440dec54b7e42ceaace65f46b87 100644 (file)
@@ -715,6 +715,40 @@ int ma_unset_audio_streaming_data_section_changed_cb(void);
  */
 int ma_set_assistant_wakeup_language(const char* language);
 
+/**
+ * @brief Sets the service state changed callback.
+ * @since_tizen 6.0
+ *
+ * @param[in] callback The callback
+ * @param[in] user_data The user data passed to the callback function
+ *
+ * @return @c 0 on success, otherwise a negative error value
+ * @retval #MA_ERROR_NONE Successful
+ * @retval #MA_ERROR_NOT_SUPPORTED Not supported
+ * @retval #MA_ERROR_INVALID_PARAMETER Invalid parameter
+ * @retval #MA_ERROR_INVALID_STATE Invalid state
+ *
+ * @pre The state should be #MA_STATE_INITIALIZED.
+ * @see ma_service_state_changed_cb()
+ * @see ma_unset_service_state_changed_cb()
+ */
+int ma_set_service_state_changed_cb(ma_service_state_changed_cb callback, void* user_data);
+
+/**
+ * @brief Unsets the service state changed callback.
+ * @since_tizen 6.0
+ *
+ * @return @c 0 on success, otherwise a negative error value
+ * @retval #MA_ERROR_NONE Successful
+ * @retval #MA_ERROR_NOT_SUPPORTED Not supported
+ * @retval #MA_ERROR_INVALID_STATE Invalid state
+ *
+ * @pre The state should be #MA_STATE_INITIALIZED.
+ * @see ma_service_state_changed_cb()
+ * @see ma_set_service_state_changed_cb()
+ */
+int ma_unset_service_state_changed_cb(void);
+
 #ifdef __cplusplus
 }
 #endif
index caca2bb087b2f9820d1527141001f81ecee2037e..c81debf2a93624d78f968227860974081b343e4b 100644 (file)
@@ -161,6 +161,18 @@ typedef enum {
        MA_AUDIO_STREAMING_DATA_SECTION_WAKE_WORD,              /**< Wake word section started */
 } ma_audio_streaming_data_section_e;
 
+/**
+ * @brief Enumerations for multi-assistant service state.
+ * @since_tizen 6.0
+ */
+typedef enum {
+       MA_SERVICE_STATE_INACTIVE = 0,                  /**< 'Inactive' state */
+       MA_SERVICE_STATE_LISTENING = 1,                 /**< 'Listening' state */
+       MA_SERVICE_STATE_UTTERANCE = 2,                 /**< 'Utterance' state */
+       MA_SERVICE_STATE_PROCESSING = 3,                /**< 'Processing' state */
+       MA_SERVICE_STATE_VOICE_FEEDBACK = 4,    /**< 'VoiceFeedback' state */
+} ma_service_state_e;
+
 /**
  * @brief Called when the client state is changed.
  * @since_tizen 5.0
@@ -283,6 +295,16 @@ typedef void (*ma_preprocessing_information_changed_cb)(const char* app_id, void
  */
 typedef void (*ma_audio_streaming_data_section_changed_cb)(ma_audio_streaming_data_section_e section, void* user_data);
 
+/**
+ * @brief Called when the service state is changed.
+ * @since_tizen 6.0
+ *
+ * @param[in] previous The previous service state
+ * @param[in] current The new service state
+ * @param[in] user_data The user data passed from the callback registration function
+ */
+typedef void (*ma_service_state_changed_cb)(ma_service_state_e previous, ma_service_state_e current, void* user_data);
+
 #ifdef __cplusplus
 }
 #endif
index 790f07bfc0c98156e5241b6c6d107adf0cb7336d..28f90114820a4a53f55a62108a844c79e6eb5ee6 100644 (file)
@@ -23,62 +23,6 @@ extern "C"
 {
 #endif
 
-/**
- * @brief Enumerations for multi-assistant service state.
- * @since_tizen 5.5
- */
-typedef enum {
-       MA_SERVICE_STATE_INACTIVE = 0,                  /**< 'Inactive' state */
-       MA_SERVICE_STATE_LISTENING = 1,                 /**< 'Listening' state */
-       MA_SERVICE_STATE_UTTERANCE = 2,                 /**< 'Utterance' state */
-       MA_SERVICE_STATE_PROCESSING = 3,                /**< 'Processing' state */
-       MA_SERVICE_STATE_VOICE_FEEDBACK = 4,    /**< 'VoiceFeedback' state */
-} ma_service_state_e;
-
-/**
- * @brief Called when the service state is changed.
- * @since_tizen 5.5
- *
- * @param[in] previous The previous service state
- * @param[in] current The current service state
- * @param[in] user_data The user data passed from the callback registration function
- */
-typedef void (*ma_service_state_changed_cb)(ma_service_state_e previous, ma_service_state_e current, void* user_data);
-
-/**
- * @brief Sets the service state changed callback.
- * @since_tizen 5.5
- *
- * @param[in] callback The callback
- * @param[in] user_data The user data passed to the callback function
- *
- * @return @c 0 on success, otherwise a negative error value
- * @retval #MA_ERROR_NONE Successful
- * @retval #MA_ERROR_NOT_SUPPORTED Not supported
- * @retval #MA_ERROR_INVALID_PARAMETER Invalid parameter
- * @retval #MA_ERROR_INVALID_STATE Invalid state
- *
- * @pre The state should be #MA_STATE_INITIALIZED.
- * @see ma_service_state_changed_cb()
- * @see ma_unset_service_state_changed_cb()
- */
-int ma_set_service_state_changed_cb(ma_service_state_changed_cb callback, void* user_data);
-
-/**
- * @brief Unsets the service state changed callback.
- * @since_tizen 5.5
- *
- * @return @c 0 on success, otherwise a negative error value
- * @retval #MA_ERROR_NONE Successful
- * @retval #MA_ERROR_NOT_SUPPORTED Not supported
- * @retval #MA_ERROR_INVALID_STATE Invalid state
- *
- * @pre The state should be #MA_STATE_INITIALIZED.
- * @see ma_service_state_changed_cb()
- * @see ma_set_service_state_changed_cb()
- */
-int ma_unset_service_state_changed_cb(void);
-
 #ifdef __cplusplus
 }
 #endif