Mistake on this page?
Report an issue in GitHub or email us
hci_main.h
Go to the documentation of this file.
1 /*************************************************************************************************/
2 /*!
3  * \file
4  *
5  * \brief HCI main module.
6  *
7  * Copyright (c) 2009-2018 Arm Ltd. All Rights Reserved.
8  *
9  * Copyright (c) 2019-2020 Packetcraft, Inc.
10  *
11  * Licensed under the Apache License, Version 2.0 (the "License");
12  * you may not use this file except in compliance with the License.
13  * You may obtain a copy of the License at
14  *
15  * http://www.apache.org/licenses/LICENSE-2.0
16  *
17  * Unless required by applicable law or agreed to in writing, software
18  * distributed under the License is distributed on an "AS IS" BASIS,
19  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
20  * See the License for the specific language governing permissions and
21  * limitations under the License.
22  */
23 /*************************************************************************************************/
24 #ifndef HCI_MAIN_H
25 #define HCI_MAIN_H
26 
27 #include "wsf_os.h"
28 #include "wsf_queue.h"
29 #include "hci_api.h"
30 
31 #ifdef __cplusplus
32 extern "C" {
33 #endif
34 
35 /**************************************************************************************************
36  Macros
37 **************************************************************************************************/
38 
39 /* Message types for HCI event handler */
40 #define HCI_MSG_CMD_TIMEOUT 1 /* Command timeout timer expired */
41 
42 /* Event types for HCI event handler */
43 #define HCI_EVT_RX 0x01 /* Data received on rx queue */
44 
45 /* Number of times to send HCI_RAND_CMD on reset to prefill random buffer */
46 #define HCI_RESET_RAND_CNT 4
47 
48 /**************************************************************************************************
49  Data Types
50 **************************************************************************************************/
51 
52 /* Type used in number of completed packets event type */
53 typedef struct
54 {
55  uint16_t handle;
56  uint16_t num;
57 } hciNumPkts_t;
58 
59 /* Type for HCI number of completed packets event */
60 typedef struct
61 {
62  uint8_t numHandles;
63  hciNumPkts_t numPkts[1];
65 
66 /* Main control block of the HCI subsystem */
67 typedef struct
68 {
69  wsfQueue_t rxQueue;
70  hciEvtCback_t evtCback;
71  hciSecCback_t secCback;
72  hciAclCback_t aclCback;
73  hciFlowCback_t flowCback;
74  hciIsoCback_t isoCback;
75  hciFlowCback_t isoFlowCback;
76  wsfHandlerId_t handlerId;
77  bool_t resetting;
78 } hciCb_t;
79 
80 /**************************************************************************************************
81  Global Variables
82 **************************************************************************************************/
83 
84 /* Control block */
85 extern hciCb_t hciCb;
86 
87 #ifdef __cplusplus
88 };
89 #endif
90 
91 #endif /* HCI_MAIN_H */
void(* hciIsoCback_t)(uint8_t *pData)
HCI ISO callback type.
Definition: hci_api.h:1248
HCI subsystem API.
void(* hciEvtCback_t)(hciEvt_t *pEvent)
HCI event callback type.
Definition: hci_api.h:1211
void(* hciFlowCback_t)(uint16_t handle, bool_t flowDisabled)
HCI flow control callback type.
Definition: hci_api.h:1259
void(* hciAclCback_t)(uint8_t *pData)
HCI ACL callback type.
Definition: hci_api.h:1238
uint8_t wsfHandlerId_t
Event handler ID data type.
Definition: wsf_os.h:80
Queue structure.
Definition: wsf_queue.h:46
void(* hciSecCback_t)(hciEvt_t *pEvent)
HCI security callback type.
Definition: hci_api.h:1223
General purpose queue service.
Software foundation OS 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.