12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970 |
- #ifndef BLE_USER_H__
- #define BLE_USER_H__
- #include <stdint.h>
- #include "_string.h"
- #include "nordic_common.h"
- #include "nrf.h"
- #include "ble_advdata.h"
- #include "ble_advertising.h"
- #include "ble_conn_params.h"
- #include "nrf_sdh.h"
- #include "nrf_sdh_soc.h"
- #include "nrf_sdh_ble.h"
- #include "nrf_ble_gatt.h"
- #include "nrf_ble_qwr.h"
- #include "app_timer.h"
- #include "app_error.h"
- #include "ble.h"
- #include "ble_err.h"
- #include "ble_hci.h"
- #include "ble_srv_common.h"
- #include "define.h"
- #include "app_button.h"
- #include "nrf_pwr_mgmt.h"
- #include "nrf_log.h"
- #include "nrf_log_ctrl.h"
- #include "nrf_log_default_backends.h"
- #ifdef __cplusplus
- extern "C" {
- #endif
-
- typedef enum{
- BLE_STAT_CONNECTED,
- BLE_STAT_DISCONNECTED,
- BLE_STAT_DATA_OK,
- BLE_STAT_DATA_NOK
- }ble_stat_e;
-
- typedef bool (*ble_recieve_data_func)(uint8_t *data,uint8_t len);
- typedef void (*ble_dfu_act_func)(void);
- typedef void (*ble_stat_func)(ble_stat_e stat);
- typedef void (*ble_disconnect_func)(void);
-
- typedef struct{
- ble_recieve_data_func recieve_data;
- ble_dfu_act_func dfu_act;
- ble_stat_func ble_stat;
- ble_disconnect_func ble_disconnect;
- }ble_user_func_s;
-
- void Ble_User_Init(void);
- void ble_timers_init(void);
- void ble_owned_data_send(uint8_t *data,uint16_t len);
- bool get_m_owned_conn_stat(void);
- void return_dfu_act(bool stat);
- void set_ble_recieve_data_evtfunc(ble_recieve_data_func func);
- void set_ble_dfu_act_evtfunc(ble_dfu_act_func func);
- void set_ble_stat_evtfunc(ble_stat_func func);
- void set_ble_disconnect_evtfunc(ble_disconnect_func func);
- extern uint8_t m_addl_adv_manuf_data[];
- #ifdef __cplusplus
- }
- #endif
- #endif // BSP_H__
- /** @} */
|