• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /******************************************************************************
2  * Copyright (c) 2022 Telink Semiconductor (Shanghai) Co., Ltd. ("TELINK")
3  * All rights reserved.
4  *
5  * Licensed under the Apache License, Version 2.0 (the "License");
6  * you may not use this file except in compliance with the License.
7  * You may obtain a copy of the License at
8  *
9  *     http://www.apache.org/licenses/LICENSE-2.0
10  *
11  * Unless required by applicable law or agreed to in writing, software
12  * distributed under the License is distributed on an "AS IS" BASIS,
13  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  * See the License for the specific language governing permissions and
15  * limitations under the License.
16  *
17  *****************************************************************************/
18 #ifndef GATT_H_
19 #define GATT_H_
20 
21 #if (L2CAP_CREDIT_BASED_FLOW_CONTROL_MODE_EN)
22 
23 #define BLC_EATT_NEED_LEN(sdu, cids, credits)
24 
25 int blc_eatt_registerService(u8 srvCount, u8 chCount, u16 mtu, u16 mps, u16 credits, u8 *pBuffer,
26                              blc_l2cap_coc_evtcb evtcb);
27 int blc_eatt_startService(u16 handle);
28 int blc_eatt_stopService(u16 handle);
29 
30 int blc_eatt_sendData(u16 handle, u16 scid, u8 *pHead, u8 headLen, u8 *pData, u16 dataLen, bool cidBusy);
31 
32 int blc_eatt_sendErrorRsp(u16 connHandle, u16 scid, u8 errOpcode, u16 errHandle, u8 errReason);
33 
34 int blc_eatt_sendReadByTypeReq(u16 connHandle, u16 scid, u16 startAttHandle, u16 endAttHandle, u8 *uuid, int uuidLen);
35 int blc_eatt_sendReadByTypeRsp(u16 connHandle, u16 scid, u8 typeLen, u8 dataLen, u8 *pData);
36 
37 int blc_eatt_sendReadByGroupTypeReq(u16 connHandle, u16 scid, u16 startAttHandle, u16 endAttHandle, u8 *uuid,
38                                     int uuidLen);
39 int blc_eatt_sendReadByGroupTypeRsp(u16 connHandle, u16 scid, u8 typeLen, u8 *pData, u16 datalen);
40 
41 int blc_eatt_sendFindInfoReq(u16 connHandle, u16 scid, u16 startAttHandle, u16 endAttHandle);
42 int blc_eatt_sendFindInfoRsp(u16 connHandle, u16 scid, u8 format, u8 dataLen, u8 *pData);
43 
44 int blc_eatt_sendFindByTypeReq(u16 connHandle, u16 scid, u16 startAttHandle, u16 endAttHandle, u8 *pUuid,
45                                u8 *pAttrValue, int valueLen);
46 int blc_eatt_sendFindByTypeRsp(u16 connHandle, u16 scid, u8 dataLen, u8 *pData);
47 
48 int blc_eatt_sendReadReq(u16 connHandle, u16 scid, u16 attHandle);
49 int blc_eatt_sendReadRsp(u16 connHandle, u16 scid, u8 dataLen, u8 *pData);
50 int blc_eatt_sendReadBlobReq(u16 connHandle, u16 scid, u16 attHandle, u16 offset);
51 int blc_eatt_sendReadBlobRsp(u16 connHandle, u16 scid, u8 dataLen, u8 *pData);
52 
53 int blc_eatt_sendReadMultipleReq(u16 connHandle, u16 scid, u8 numHandles, u16 *pHandle);
54 int blc_eatt_sendReadMultVarReq(u16 connHandle, u16 scid, u8 numHandles, u16 *pHandle);
55 int blc_eatt_sendReadMultVarRsp(u16 connHandle, u16 scid, u8 numVars, u16 *pVarLen);
56 
57 int blc_eatt_pushNotify(u16 connHandle, u16 scid, u16 attHandle, u16 dataLen, u8 *pData);
58 int blc_eatt_pushIndicate(u16 connHandle, u16 scid, u16 attHandle, u16 dataLen, u8 *pData);
59 int blc_eatt_sendWriteReq(u16 connHandle, u16 scid, u16 attHandle, u16 dataLen, u8 *pData);
60 int blc_eatt_sendWriteRsp(u16 connHandle, u16 scid);
61 int blc_eatt_sendWriteCmd(u16 connHandle, u16 scid, u16 attHandle, u16 dataLen, u8 *pData);
62 int blc_eatt_sendPrepareWriteReq(u16 connHandle, u16 scid, u16 attHandle, u16 offset, u16 dataLen, u8 *pData);
63 int blc_eatt_sendPrepareWriteRsp(u16 connHandle, u16 scid, u16 attHandle, u16 offset, u16 dataLen, u8 *pData);
64 int blc_eatt_sendExecuteWriteReq(u16 connHandle, u16 scid, u8 flag);
65 int blc_eatt_sendExecuteWriteRsp(u16 connHandle, u16 scid);
66 
67 #endif  // #if (L2CAP_CREDIT_BASED_FLOW_CONTROL_MODE_EN)
68 
69 #endif  // #ifndef GATT_H_
70