• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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_ADAPTER_BLE_CONFLICT_H
17 #define SOFTBUS_ADAPTER_BLE_CONFLICT_H
18 
19 #include <stdbool.h>
20 #include <stdint.h>
21 
22 #include "softbus_error_code.h"
23 
24 #ifdef __cplusplus
25 extern "C" {
26 #endif
27 
28 typedef struct {
29     int32_t (*reuseConnection)(const char *address, const char *udid, uint32_t requestId);
30     bool (*postBytes)(int32_t underlayerHandle, uint8_t *data, uint32_t dataLen);
31     void (*disconnect)(int32_t underlayerHandle, bool isForce);
32     void (*occupy)(const char *udid, int32_t timeout);
33     void (*cancelOccupy)(const char *udid);
34     int32_t (*getConnection)(const char *udid);
35 } SoftBusBleConflictListener;
36 
37 void SoftbusBleConflictRegisterListener(SoftBusBleConflictListener *listener);
38 void SoftbusBleConflictNotifyConnectResult(int32_t requestId, int32_t underlayerHandle, bool status);
39 void SoftbusBleConflictNotifyDateReceive(int32_t underlayerHandle, const uint8_t *data, uint32_t dataLen);
40 void SoftbusBleConflictNotifyDisconnect(const char *addr, const char *udid);
41 
42 #ifdef __cplusplus
43 }
44 #endif /* __cplusplus */
45 #endif /* SOFTBUS_ADAPTER_BLE_CONFLICT_H */