1 /*
2  * Copyright (c) 2021 Huawei Device Co., Ltd.
3  * Licensed under the Apache License, Version 2.0 (the "License");
4  * you may not use this file except in compliance with the License.
5  * You may obtain a copy of the License at
6  *
7  *     http://www.apache.org/licenses/LICENSE-2.0
8  *
9  * Unless required by applicable law or agreed to in writing, software
10  * distributed under the License is distributed on an "AS IS" BASIS,
11  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12  * See the License for the specific language governing permissions and
13  * limitations under the License.
14  */
15 
16 /**
17  * @addtogroup kws_sdk
18  * @{
19  *
20  * @brief Defines the basic functions, constants, and error codes for the wakeup keyword spotting (KWS) SDK.
21  *
22  * @since 2.2
23  * @version 1.0
24  */
25 
26 /**
27  * @file kws_retcode.h
28  *
29  * @brief Defines the return codes for the KWS task.
30  *
31  * @since 2.2
32  * @version 1.0
33  */
34 
35 #ifndef KWS_RETCODE_H
36 #define KWS_RETCODE_H
37 
38 namespace OHOS {
39 namespace AI {
40 /**
41  * @brief Enumerates the return codes supported by the KWS SDK.
42  *
43  * @since 2.2
44  * @version 1.0
45  */
46 typedef enum {
47     KWS_RETCODE_FAILURE = -1,                  /** Return code for an operation failure */
48     KWS_RETCODE_SUCCESS = 0,                   /** Return code for an operation success */
49     KWS_RETCODE_INIT_ERROR = 1001,             /** Return code for an initialization error */
50     KWS_RETCODE_NULL_PARAM = 1002,             /** Return code for a null parameter error */
51     KWS_RETCODE_SERIALIZATION_ERROR = 2001,    /** Return code for a serialization error */
52     KWS_RETCODE_UNSERIALIZATION_ERROR = 2002,  /** Return code for a deserialization error */
53     KWS_RETCODE_PLUGIN_EXECUTION_ERROR = 3001, /** Return code for a plugin inference error */
54     KWS_RETCODE_PLUGIN_SESSION_ERROR = 3002,   /** Return code for a plugin session error */
55 } KWSRetCode;
56 } // namespace AI
57 } // namespace OHOS
58 #endif // KWS_RETCODE_H
59 /** @} */