• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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 #ifndef DISC_CLIENT_PROXY_H
17 
18 #include <stdint.h>
19 #include "softbus_common.h"
20 
21 #ifdef __cplusplus
22 #if __cplusplus
23 extern "C" {
24 #endif
25 #endif
26 
27 /**
28  * @brief Discovery device callback function.
29  * @see {@link ClientIpcOnDiscoverFailed} or {@link ClientIpcDiscoverySuccess}
30  * @param[in] pkgName Indicates the pointer to package name, which can contain a maximum of 64 bytes.
31  * @param[in] device Indicates a pointer to device information. For details, see {@link DeviceInfo}.
32  * @param[in] addtions Indicates a pointer to device additional information.
33  * @return <b>SOFTBUS_OK</b> Client IPC found on device.
34  */
35 int32_t ClientIpcOnDeviceFound(const char *pkgName, const DeviceInfo *device, const InnerDeviceInfoAddtions *addtions);
36 
37 /**
38  * @brief The discovery failure callback notifies the local end of failure to discover other devices.
39  * This callback is only called when discovering other devices fails.
40  * @see {@link ClientIpcOnDeviceFound} or {@link ClientIpcDiscoverySuccess}
41  * @param[in] pkgName Indicates the pointer to package name, which can contain a maximum of 64 bytes.
42  * @param[in] subscribeId Indicates the service ID.
43  * @param[in] failReason Fail reason.
44  * @return <b>SOFTBUS_OK</b> Failed to find Client IPC found on device.
45  */
46 int32_t ClientIpcOnDiscoverFailed(const char *pkgName, int subscribeId, int failReason);
47 
48 /**
49  * @brief The discovery success callback notifies the local end of successfully discovering other devices.
50  * This callback is only called when other devices are successfully discovered.
51  * @see {@link ClientIpcOnDeviceFound} or {@link ClientIpcOnDiscoverFailed}
52  * @param[in] pkgName Indicates the pointer to package name, which can contain a maximum of 64 bytes.
53  * @param[in] subscribeId Indicates the service ID.
54  * @return <b>SOFTBUS_OK</b> Client IPC found on device successfully.
55  */
56 int32_t ClientIpcDiscoverySuccess(const char *pkgName, int subscribeId);
57 
58 /**
59  * @brief Publishing success callback, notifying the local end of publishing its own information successfully.
60  * This callback is only called when the ability to publish itself is successful.
61  * @see {@link ClientIpcOnPublishFail}
62  * @param[in] pkgName Indicates the pointer to package name, which can contain a maximum of 64 bytes.
63  * @param[in] publishId Publish ID.
64  * @return <b>SOFTBUS_OK</b> Client IPC published successfully.
65  */
66 int32_t ClientIpcOnPublishSuccess(const char *pkgName, int publishId);
67 
68 /**
69  * @brief Publishing failure callback, notifying the local end of the failure to publish its own information.
70  * This callback is only called when the ability to publish itself fails.
71  * @see {@link ClientIpcOnPublishSuccess}
72  * @param[in] pkgName Indicates the pointer to package name, which can contain a maximum of 64 bytes.
73  * @param[in] publishId Publish ID.
74  * @param[in] reason Fail reason.
75  * @return <b>SOFTBUS_OK</b> Client IPC published failed.
76  */
77 int32_t ClientIpcOnPublishFail(const char *pkgName, int publishId, int reason);
78 
79 #ifdef __cplusplus
80 #if __cplusplus
81 }
82 #endif /* __cplusplus */
83 #endif /* __cplusplus */
84 
85 #endif // !DISC_CLIENT_PROXY_H