1 /*
2  * SPDX-FileCopyrightText: 2020-2021 Espressif Systems (Shanghai) CO LTD
3  *
4  * SPDX-License-Identifier: Apache-2.0
5  */
6 
7 #ifndef _BTC_BLE_MESH_BLE_H_
8 #define _BTC_BLE_MESH_BLE_H_
9 
10 #include <stdint.h>
11 #include "btc/btc_manage.h"
12 #include "mesh_bearer_adapt.h"
13 #include "esp_ble_mesh_ble_api.h"
14 
15 #ifdef __cplusplus
16 extern "C" {
17 #endif
18 
19 typedef union {
20     struct {
21         esp_ble_mesh_ble_adv_param_t param;
22         esp_ble_mesh_ble_adv_data_t data;
23     } start_ble_adv;
24     struct {
25         uint8_t index;
26     } stop_ble_adv;
27     struct {
28         esp_ble_mesh_ble_scan_param_t param;
29     } start_ble_scan;
30     struct {
31         /* RFU */
32     } stop_ble_scan;
33 } btc_ble_mesh_ble_args_t;
34 
35 typedef enum {
36     BTC_BLE_MESH_ACT_START_BLE_ADV,
37     BTC_BLE_MESH_ACT_STOP_BLE_ADV,
38     BTC_BLE_MESH_ACT_START_BLE_SCAN,
39     BTC_BLE_MESH_ACT_STOP_BLE_SCAN,
40 } btc_ble_mesh_ble_act_t;
41 
42 void bt_mesh_ble_scan_cb_evt_to_btc(const bt_mesh_addr_t *addr,
43                                     uint8_t adv_type, uint8_t data[],
44                                     uint16_t length, int8_t rssi);
45 
46 void btc_ble_mesh_ble_call_handler(btc_msg_t *msg);
47 
48 void btc_ble_mesh_ble_cb_handler(btc_msg_t *msg);
49 
50 #ifdef __cplusplus
51 }
52 #endif
53 
54 #endif /* _BTC_BLE_MESH_BLE_H_ */
55