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_STRUCT_H 17 #define SOFTBUS_ADAPTER_BLE_CONFLICT_STRUCT_H 18 19 #include <stdbool.h> 20 #include <stdint.h> 21 22 #ifdef __cplusplus 23 extern "C" { 24 #endif 25 26 typedef struct { 27 int32_t (*reuseConnection)(const char *address, const char *udid, uint32_t requestId); 28 bool (*postBytes)(int32_t underlayerHandle, uint8_t *data, uint32_t dataLen); 29 void (*disconnect)(int32_t underlayerHandle, bool isForce); 30 void (*occupy)(const char *udid, int32_t timeout); 31 void (*cancelOccupy)(const char *udid); 32 int32_t (*getConnection)(const char *udid); 33 } SoftBusBleConflictListener; 34 35 typedef struct { 36 void (*conflictNotifyConnectResult)(uint32_t requestId, int32_t underlayerHandle, bool result); 37 void (*conflictNotifyDataReceive)(int32_t underlayerHandle, const uint8_t *data, uint32_t dataLen); 38 void (*conflictNotifyDisconnect)(int32_t underlayerHandle, int32_t status); 39 } LegacyConflictEventListener; 40 41 #ifdef __cplusplus 42 } 43 #endif /* __cplusplus */ 44 #endif /* SOFTBUS_ADAPTER_BLE_CONFLICT_STRUCT_H */