Appiko
lsm_testing_ble.h
1 /*
2  * lsm_testing_ble.h : BLE Support file for LSM6D application
3  * Copyright (C) 2019 Appiko
4  *
5  * This program is free software: you can redistribute it and/or modify
6  * it under the terms of the GNU General Public License as published by
7  * the Free Software Foundation, either version 3 of the License, or
8  * (at your option) any later version.
9  *
10  * This program is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  * GNU General Public License for more details.
14  *
15  * You should have received a copy of the GNU General Public License
16  * along with this program. If not, see <https://www.gnu.org/licenses/>.
17  */
18 
19 #ifndef BT_DONGLE_BLE_H
20 #define BT_DONGLE_BLE_H
21 
22 #include "stdint.h"
23 #include "stdbool.h"
24 #include "ble.h"
25 #include "dev_id_fw_ver.h"
26 
27 typedef struct
28 {
29  uint8_t * adv_data;
30  uint16_t adv_len;
31  uint8_t * scan_rsp_data;
32  uint16_t scan_rsp_len;
33 }
34 lsm_ble_adv_data_t;
35 
36 typedef struct
37 {
38  uint16_t avg_acce;
39  uint16_t avg_smoke;
40 }mod_ble_data_t;
41 
45 void lsm_ble_disconn(void);
46 
51 void lsm_ble_stack_init();
52 
60 void lsm_ble_service_init(void);
61 
66 void lsm_ble_gap_params_init(void);
67 
73 void lsm_ble_adv_init(void);
74 
78 void lsm_ble_adv_start(void (*conn_func) (void));
79 
80 bool lsm_is_bt_on ();
81 
82 void lsm_ble_update_status_byte(mod_ble_data_t * status_byte);
83 
84 #endif /* BT_DONGLE_BLE_H */