xref: /nrf52832-nimble/packages/NimBLE-latest/apps/bletest/src/bletest_priv.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_BLETEST_PRIV_
21 #define H_BLETEST_PRIV_
22 
23 #ifdef __cplusplus
24 extern "C" {
25 #endif
26 
27 void bletest_send_conn_update(uint16_t handle);
28 
29 #if (MYNEWT_VAL(BLE_LL_CFG_FEAT_LE_ENCRYPTION) == 1)
30 void bletest_ltk_req_reply(uint16_t handle);
31 int bletest_send_ltk_req_neg_reply(uint16_t handle);
32 int bletest_send_ltk_req_reply(uint16_t handle);
33 int bletest_hci_le_start_encrypt(struct hci_start_encrypt *cmd);
34 int bletest_hci_le_encrypt(uint8_t *key, uint8_t *pt);
35 #endif
36 
37 int bletest_hci_reset_ctlr(void);
38 int bletest_hci_rd_bd_addr(void);
39 int bletest_hci_le_set_datalen(uint16_t handle, uint16_t txoctets,
40                                uint16_t txtime);
41 int bletest_hci_le_write_sugg_datalen(uint16_t txoctets, uint16_t txtime);
42 int bletest_hci_le_rd_sugg_datalen(void);
43 int bletest_hci_rd_local_version(void);
44 int bletest_hci_rd_local_feat(void);
45 int bletest_hci_rd_local_supp_cmd(void);
46 int bletest_hci_le_read_supp_states(void);
47 int bletest_hci_le_rd_max_datalen(void);
48 int bletest_hci_le_read_rem_used_feat(uint16_t handle);
49 int bletest_hci_le_set_rand_addr(uint8_t *addr);
50 int bletest_hci_rd_rem_version(uint16_t handle);
51 int bletest_hci_le_set_host_chan_class(uint8_t *chanmap);
52 int bletest_hci_le_rd_chanmap(uint16_t handle);
53 int bletest_hci_le_set_event_mask(uint64_t event_mask);
54 int bletest_hci_set_event_mask(uint64_t event_mask);
55 int bletest_hci_le_add_to_whitelist(uint8_t *addr, uint8_t addr_type);
56 int bletest_hci_le_set_scan_enable(uint8_t enable, uint8_t filter_dups);
57 int bletest_hci_le_create_connection(struct hci_create_conn *hcc);
58 int bletest_hci_le_set_scan_params(uint8_t scan_type, uint16_t scan_itvl,
59                                    uint16_t scan_window, uint8_t own_addr_type,
60                                    uint8_t filter_policy);
61 int bletest_hci_le_add_resolv_list(uint8_t *local_irk, uint8_t *peer_irk,
62                                    uint8_t *peer_ident_addr, uint8_t addr_type);
63 int bletest_hci_le_enable_resolv_list(uint8_t enable);
64 
65 #if MYNEWT_VAL(BLE_ANDROID_MULTI_ADV_SUPPORT)
66 int bletest_hci_le_set_multi_rand_addr(uint8_t *addr, uint8_t instance);
67 int bletest_hci_le_set_multi_adv_data(uint8_t *data, uint8_t len,
68                                       uint8_t instance);
69 int bletest_hci_le_set_multi_adv_params(struct hci_multi_adv_params *adv,
70                                         uint8_t instance);
71 int bletest_hci_le_set_multi_adv_enable(uint8_t enable, uint8_t instance);
72 int bletest_hci_le_set_multi_scan_rsp_data(uint8_t *data, uint8_t len,
73                                            uint8_t instance);
74 #else
75 int bletest_hci_le_set_adv_data(uint8_t *data, uint8_t len);
76 int bletest_hci_le_set_adv_params(struct hci_adv_params *adv);
77 int bletest_hci_le_set_adv_enable(uint8_t enable);
78 int bletest_hci_le_set_scan_rsp_data(uint8_t *data, uint8_t len);
79 #endif
80 
81 
82 #ifdef __cplusplus
83 }
84 #endif
85 
86 #endif  /* H_BLETEST_PRIV_*/
87