2 * Copyright (C) 2012 The Android Open Source Project
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
21 #define L2CAP_FLAG_SUPPORT_CONNECTIONS 1
22 #define L2CAP_FLAG_SUPPORT_CONNECTIONLESS 2
24 #define L2CAP_CHAN_CONNECTIONLESS 2 //pass to capServiceTx as needed
27 #define L2CAP_PSM_SDP 0x0001
28 #define L2CAP_PSM_RFCOMM 0x0003
29 #define L2CAP_PSM_AVDTP 0x0019
32 #define L2CAP_MAX_PIECED_MESSAGES 4 //most broken messages we support *at once*
38 void* (*serviceInstanceAllocate
)(uint16_t conn
, uint16_t chan
, uint16_t remChan
);
39 void (*serviceInstanceFree
)(void* service
);
41 void (*serviceRx
)(void* service
, const uint8_t* data
, uint16_t size
);
50 void l2capServiceTx(uint16_t conn
, uint16_t remChan
, sg_buf
* data
);
51 void l2capServiceCloseConn(uint16_t conn
, uint16_t chan
);
53 //API for service management
54 char l2capServiceRegister(uint16_t PSM
, const L2capService
* svcData
);
55 char l2capServiceUnregister(uint16_t PSM
,char sendDiscPacket
);
59 void l2capAclLinkUp(uint16_t conn
);
60 void l2capAclLinkDataRx(uint16_t conn
, char first
, const uint8_t* data
, uint16_t size
);
61 void l2capAclLinkDown(uint16_t conn
);