1 /*
2  * Copyright (c) 2023 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 #ifndef SOFTBUS_SCENARIO_MANAGER_H
17 #define SOFTBUS_SCENARIO_MANAGER_H
18 
19 #include "softbus_def.h"
20 
21 #ifdef __cplusplus
22 #if __cplusplus
23 extern "C" {
24 #endif
25 #endif
26 
27 typedef enum {
28     SM_ERROR_INNER = -1,
29     SM_ERROR_INVALID_PARAM = -2,
30     SM_ERROR_TYPE_NOT_SUPPORT = -3,
31     SM_ERROR_INVALID_LOCAL_MAC = -4,
32     SM_ERROR_OUT_OF_MEMORY = -5,
33     SM_ERROR_OPT_NOT_SUPPORT = -6,
34 } ScenarioManagerError;
35 
36 typedef enum {
37     SM_MESSAGE_TYPE = 1,
38     SM_BYTE_TYPE = 2,
39     SM_FILE_TYPE = 3,
40     SM_VIDEO_TYPE = 4,
41     SM_AUDIO_TYPE = 5,
42     SM_RAW_TYPE = 6,
43 } ScenarioManagerBusinessType;
44 
45 typedef struct ScenarioManager ScenarioManager;
46 
47 int32_t ScenarioManagerGetInstance(void);
48 
49 // update scenarios based on the command and determine whether to deliver the driver.
50 int32_t AddScenario(const char *localMac, const char *peerMac, int localPid, int businessType);
51 
52 int32_t DelScenario(const char *localMac, const char *peerMac, int localPid, int businessType);
53 
54 // clear all scenarios
55 void ScenarioManagerdestroyInstance();
56 
57 #ifdef __cplusplus
58 #if __cplusplus
59 }
60 #endif /* __cplusplus */
61 #endif /* __cplusplus */
62 
63 #endif // SOFTBUS_SCENARIO_MANAGER_H
64