component/bt : gatt server

1.add gatt server demo for user
2. some function didn't be tested
This commit is contained in:
Tian Hao
2016-11-18 00:30:35 +08:00
parent a35e2d42f0
commit 37365cef95
10 changed files with 382 additions and 73 deletions
@@ -1,6 +1,9 @@
#ifndef __BTC_GAP_BLE_H__
#define __BTC_GAP_BLE_H__
#include "esp_bt_defs.h"
#include "esp_gap_ble_api.h"
typedef enum {
BTC_GAP_BLE_ACT_CFG_ADV_DATA = 0,
BTC_GAP_BLE_ACT_SET_SCAN_PARAM,
@@ -15,7 +18,24 @@ typedef enum {
BTC_GAP_BLE_ACT_SET_DEV_NAME,
} btc_gap_ble_act_t;
/* btc_ble_gap_args_t */
typedef struct {
esp_ble_adv_data_t adv_data;
esp_ble_adv_params_t adv_params;
esp_ble_scan_params_t scan_params;
esp_ble_conn_update_params_t conn_params;
esp_bd_addr_t remote_device;
esp_bd_addr_t rand_addr;
uint32_t duration;
uint16_t tx_data_length;
bool privacy_enable;
#define ESP_GAP_DEVICE_NAME_MAX (32)
char device_name[ESP_GAP_DEVICE_NAME_MAX+1];
} btc_ble_gap_args_t;
void btc_gap_ble_call_handler(btc_msg_t *msg);
void btc_gap_ble_cb_handler(btc_msg_t *msg);
void btc_gap_ble_arg_deep_copy(btc_msg_t *msg, void *p_dest, void *p_src);
#endif /* __BTC_GAP_BLE_H__ */