• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (c) 2021-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 #ifndef SOFTBUS_PROXYCHANNEL_PIPELINE_STRUCT_H
17 #define SOFTBUS_PROXYCHANNEL_PIPELINE_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     void (*onDataReceived)(int32_t channelId, const char *data, uint32_t len);
28     void (*onDisconnected)(int32_t channelId);
29 } ITransProxyPipelineListener;
30 
31 typedef struct {
32     void (*onChannelOpened)(int32_t requestId, int32_t channelId);
33     void (*onChannelOpenFailed)(int32_t requestId, int32_t reason);
34 } ITransProxyPipelineCallback;
35 
36 typedef enum {
37     MSG_TYPE_INVALID = 0,
38 
39     MSG_TYPE_P2P_NEGO = 0xABADBEEF,
40     MSG_TYPE_IP_PORT_EXCHANGE,
41 
42     MSG_TYPE_CNT = 2,
43 } TransProxyPipelineMsgType;
44 
45 typedef struct {
46     bool bleDirect;
47 } TransProxyPipelineChannelOption;
48 
49 #ifdef __cplusplus
50 }
51 #endif
52 
53 #endif
54