• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (c) 2025 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 #include "softbus_conn_init.h"
17 
18 #include "comm_log.h"
19 #include "g_reg_conn_func.h"
20 #include "g_enhance_conn_func.h"
21 #include "softbus_conn_ble_manager.h"
22 #include "softbus_conn_interface.h"
23 #include "softbus_base_listener.h"
24 
ConnOpenFuncInit(void * soHandle)25 int32_t ConnOpenFuncInit(void *soHandle)
26 {
27     if (soHandle == NULL) {
28         COMM_LOGE(COMM_SVC, "libdsoftbus_server_plugin.z.so soHandle is null");
29         return SOFTBUS_NETWORK_DLOPEN_FAILED;
30     }
31     int32_t (*connRegisterOpenfunc)(void);
32     int ret = SoftBusDlsym(soHandle, "ConnRegisterOpenFunc", (void**)&connRegisterOpenfunc);
33     if (ret != SOFTBUS_OK) {
34         COMM_LOGE(COMM_SVC, "dlsym ConnRegisterOpenFunc fail, ret=%d", ret);
35         return SOFTBUS_NETWORK_DLSYM_FAILED;
36     }
37 
38     if (connRegisterOpenfunc() != SOFTBUS_OK) {
39         COMM_LOGE(COMM_SVC, "ConnRegisterOpenFunc return fail, ret=%d", ret);
40         return SOFTBUS_NETWORK_CONN_OPEN_FUNC_INIT_FAILED;
41     }
42 
43     return ret;
44 }