Mistake on this page?
Report an issue in GitHub or email us
att_eatt.h
Go to the documentation of this file.
1 /*************************************************************************************************/
2 /*!
3  * \file
4  *
5  * \brief Enhanced ATT (EATT) main module.
6  *
7  * Copyright (c) 2019-2020 Packetcraft, Inc.
8  *
9  * Licensed under the Apache License, Version 2.0 (the "License");
10  * you may not use this file except in compliance with the License.
11  * You may obtain a copy of the License at
12  *
13  * http://www.apache.org/licenses/LICENSE-2.0
14  *
15  * Unless required by applicable law or agreed to in writing, software
16  * distributed under the License is distributed on an "AS IS" BASIS,
17  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
18  * See the License for the specific language governing permissions and
19  * limitations under the License.
20  */
21 /*************************************************************************************************/
22 #ifndef EATT_MAIN_H
23 #define EATT_MAIN_H
24 
25 #include "wsf_queue.h"
26 #include "wsf_timer.h"
27 #include "l2c_api.h"
28 #include "dm_api.h"
29 #include "att_api.h"
30 
31 #ifdef __cplusplus
32 extern "C" {
33 #endif
34 
35 /**************************************************************************************************
36  Data Types
37 **************************************************************************************************/
38 
39 /* EATT channel control block. */
40 typedef struct
41 {
42  uint16_t cid; /* L2CAP channel identifier. */
43  uint16_t priority; /* Slot priority */
44  uint16_t peerMtu; /* Peer MTU of L2CAP channel */
45  uint16_t localMtu; /* Local MTU of L2CAP channel */
46  uint16_t localMps; /* Local MPS of L2CAP channel */
47  bool_t inUse; /* L2CAP channel is open */
48 } eattChanCb_t;
49 
50 /* EATT connection control block. */
51 typedef struct
52 {
53  uint8_t state; /* Connection state. */
54  uint16_t pendingMtu; /* Pending MTU */
55  uint16_t pendingMps; /* Pending MPS */
56  uint16_t connInterval; /* The connection interval. */
57  wsfTimer_t backoffTimer; /* Backoff timer for L2CAP en conn req collisions. */
58  eattChanCb_t *pChanCb; /* Channel control block list. */
59 } eattConnCb_t;
60 
61 /* EATT main control block. */
62 typedef struct
63 {
64  eattConnCb_t ccb[DM_CONN_MAX]; /* Connection control blocks. */
65  l2cCocRegId_t cocRegId; /* L2CAP COC registration ID. */
66 } eattCb_t;
67 
68 extern eattCb_t eattCb;
69 
70 /**************************************************************************************************
71  Function Prototypes
72 **************************************************************************************************/
73 
74 uint16_t eattGetCid(dmConnId_t connId, uint8_t slot);
75 uint8_t eattGetSlotId(dmConnId_t connId, uint16_t cid);
76 eattConnCb_t *eattGetConnCb(dmConnId_t connId);
77 void eattHandler(wsfMsgHdr_t *pMsg);
78 void eattExecCallback(dmConnId_t connId, uint8_t event, uint8_t status);
79 
80 #ifdef __cplusplus
81 };
82 #endif
83 
84 #endif /* EATT_MAIN_H */
uint8_t dmConnId_t
Connection identifier.
Definition: dm_api.h:588
uint16_t l2cCocRegId_t
Connection oriented channel registration ID.
Definition: l2c_api.h:100
Device Manager subsystem API.
Timer structure.
Definition: wsf_timer.h:53
General purpose queue service.
#define DM_CONN_MAX
Maximum number of connections.
Definition: cfg_stack.h:81
Timer service.
Attribute protocol client and server API.
Common message structure passed to event handler.
Definition: wsf_os.h:106
L2CAP subsystem API.
Important Information for this Arm website

This site uses cookies to store information on your computer. By continuing to use our site, you consent to our cookies. If you are not happy with the use of these cookies, please review our Cookie Policy to learn how they can be disabled. By disabling cookies, some features of the site will not work.