xref: /nrf52832-nimble/packages/NimBLE-latest/nimble/controller/include/controller/ble_ll_hci.h (revision 042d53a763ad75cb1465103098bb88c245d95138)
1 /*
2  * Licensed to the Apache Software Foundation (ASF) under one
3  * or more contributor license agreements.  See the NOTICE file
4  * distributed with this work for additional information
5  * regarding copyright ownership.  The ASF licenses this file
6  * to you under the Apache License, Version 2.0 (the
7  * "License"); you may not use this file except in compliance
8  * with the License.  You may obtain a copy of the License at
9  *
10  *  http://www.apache.org/licenses/LICENSE-2.0
11  *
12  * Unless required by applicable law or agreed to in writing,
13  * software distributed under the License is distributed on an
14  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15  * KIND, either express or implied.  See the License for the
16  * specific language governing permissions and limitations
17  * under the License.
18  */
19 
20 #ifndef H_BLE_LL_HCI_
21 #define H_BLE_LL_HCI_
22 
23 #ifdef __cplusplus
24 extern "C" {
25 #endif
26 
27 /* For supported commands */
28 #define BLE_LL_SUPP_CMD_LEN (40)
29 extern const uint8_t g_ble_ll_supp_cmds[BLE_LL_SUPP_CMD_LEN];
30 
31 /* The largest event the controller will send. */
32 #define BLE_LL_MAX_EVT_LEN  MYNEWT_VAL(BLE_HCI_EVT_BUF_SIZE)
33 
34 /*
35  * This determines the number of outstanding commands allowed from the
36  * host to the controller. NOTE: you cannot change this without modifying
37  * other portions of the code as we currently use a global os event for
38  * the command; you would need to allocate a pool of these.
39  */
40 #define BLE_LL_CFG_NUM_HCI_CMD_PKTS     (1)
41 
42 /* Initialize LL HCI */
43 void ble_ll_hci_init(void);
44 
45 /* Used to determine if the LE event is enabled/disabled */
46 uint8_t ble_ll_hci_is_le_event_enabled(int subev);
47 
48 /* Used to determine if event is enabled/disabled */
49 uint8_t ble_ll_hci_is_event_enabled(int evcode);
50 
51 /* Send event from controller to host */
52 int ble_ll_hci_event_send(uint8_t *evbuf);
53 
54 /* Sends a command complete with a no-op opcode to host */
55 int ble_ll_hci_send_noop(void);
56 
57 /* Checks the preferref phy masks from set default phy and set phy commands */
58 int ble_ll_hci_chk_phy_masks(uint8_t *cmdbuf, uint8_t *txphy, uint8_t *rxphy);
59 
60 /* Returns true if Extended Advertising HCI commands are in use */
61 bool ble_ll_hci_adv_mode_ext(void);
62 
63 #ifdef __cplusplus
64 }
65 #endif
66 
67 #endif /* H_BLE_LL_HCI_ */
68