component/bt : cleanup the comment and pass all doxygen check

This commit is contained in:
Tian Hao 2016-11-29 15:32:29 +08:00
parent 06e2a1d4e1
commit 3a3d4276f8
5 changed files with 181 additions and 62 deletions

View file

@ -42,18 +42,27 @@ typedef enum {
ESP_BLUFI_DEINIT_FAILED = 0,
} esp_blufi_deinit_state_t;
/**
* @brief BLUFI callback parameters union
*/
typedef union {
//ESP_BLUFI_EVENT_INIT_FINISH
/**
* @brief ESP_BLUFI_EVENT_INIT_FINISH
*/
struct blufi_init_finish_evt_param {
esp_blufi_init_state_t state; /*!< Initial status */
} init_finish; /*!< Blufi callback param of ESP_BLUFI_EVENT_INIT_FINISH */
//ESP_BLUFI_EVENT_DEINIT_FINISH
/**
* @brief ESP_BLUFI_EVENT_DEINIT_FINISH
*/
struct blufi_deinit_finish_evt_param {
esp_blufi_deinit_state_t state; /*!< De-initial status */
} deinit_finish; /*!< Blufi callback param of ESP_BLUFI_EVENT_DEINIT_FINISH */
//ESP_BLUFI_EVENT_RECV_DATA
/**
* @brief ESP_BLUFI_EVENT_RECV_DATA
*/
struct blufi_recv_evt_param {
uint8_t data[ESP_BLUFI_RECV_DATA_LEN_MAX]; /*!< Blufi receive data */
uint8_t data_len; /*!< Blufi receive data length */

View file

@ -202,20 +202,31 @@ typedef enum {
ESP_GAP_SEARCH_SEARCH_CANCEL_CMPL_EVT = 6, /* Search cancelled */
} esp_gap_search_evt_t;
/**
* @brief Gap callback parameters union
*/
typedef union {
//ESP_GAP_BLE_ADV_DATA_SET_COMPLETE_EVT
/**
* @brief ESP_GAP_BLE_ADV_DATA_SET_COMPLETE_EVT
*/
struct ble_adv_data_cmpl_evt_param {
esp_bt_status_t status; /*!< Indicate the set advertising data operation success status */
} adv_data_cmpl; /*!< Event parameter of ESP_GAP_BLE_ADV_DATA_SET_COMPLETE_EVT */
//ESP_GAP_BLE_SCAN_RSP_DATA_SET_COMPLETE_EVT
/**
* @brief ESP_GAP_BLE_SCAN_RSP_DATA_SET_COMPLETE_EVT
*/
struct ble_scan_rsp_data_cmpl_evt_param {
esp_bt_status_t status; /*!< Indicate the set scan response data operation success status */
} scan_rsp_data_cmpl; /*!< Event parameter of ESP_GAP_BLE_SCAN_RSP_DATA_SET_COMPLETE_EVT */
//ESP_GAP_BLE_SCAN_PARAM_SET_COMPLETE_EVT
/**
* @brief ESP_GAP_BLE_SCAN_PARAM_SET_COMPLETE_EVT
*/
struct ble_scan_param_cmpl_evt_param {
esp_bt_status_t status; /*!< Indicate the set scan param operation success status */
} scan_param_cmpl; /*!< Event parameter of ESP_GAP_BLE_SCAN_PARAM_SET_COMPLETE_EVT */
//ESP_GAP_BLE_SCAN_RESULT_EVT
/**
* @brief ESP_GAP_BLE_SCAN_RESULT_EVT
*/
struct ble_scan_result_evt_param {
esp_gap_search_evt_t search_evt; /*!< Search event type */
esp_bd_addr_t bda; /*!< Bluetooth device address which has been searched */

View file

@ -21,7 +21,9 @@
#define ESP_GATT_PREP_WRITE_CANCEL 0x00
#define ESP_GATT_PREP_WRITE_EXEC 0x01
/* Success code and error codes */
/**
* @brief GATT success code and error codes
*/
typedef enum {
ESP_GATT_OK = 0x0,
ESP_GATT_INVALID_HANDLE = 0x01, /* 0x0001 */
@ -69,28 +71,41 @@ typedef enum {
ESP_GATT_OUT_OF_RANGE = 0xff, /* 0xFFAttribute value out of range */
} esp_gatt_status_t;
/**
* @brief Gatt Connection reason enum
*/
typedef enum {
ESP_GATT_CONN_UNKNOWN = 0,
ESP_GATT_CONN_L2C_FAILURE = 1, /* general L2cap failure */
ESP_GATT_CONN_TIMEOUT = 0x08, /* 0x08 connection timeout */
ESP_GATT_CONN_TERMINATE_PEER_USER = 0x13, /* 0x13 connection terminate by peer user */
ESP_GATT_CONN_TERMINATE_LOCAL_HOST = 0x16, /* 0x16 connectionterminated by local host */
ESP_GATT_CONN_FAIL_ESTABLISH = 0x3e, /* 0x03E connection fail to establish */
// ESP_GATT_CONN_LMP_TIMEOUT = 0x22, /* 0x22 connection fail for LMP response tout */
ESP_GATT_CONN_CONN_CANCEL = 0x0100, /* 0x0100 L2CAP connection cancelled */
ESP_GATT_CONN_NONE = 0x0101 /* 0x0101 no connection to cancel */
} esp_gatt_reason_t;
ESP_GATT_CONN_UNKNOWN = 0, /*!< Gatt connection unknown */
ESP_GATT_CONN_L2C_FAILURE = 1, /*!< General L2cap failure */
ESP_GATT_CONN_TIMEOUT = 0x08, /*!< Connection timeout */
ESP_GATT_CONN_TERMINATE_PEER_USER = 0x13, /*!< Connection terminate by peer user */
ESP_GATT_CONN_TERMINATE_LOCAL_HOST = 0x16, /*!< Connectionterminated by local host */
ESP_GATT_CONN_FAIL_ESTABLISH = 0x3e, /*!< Connection fail to establish */
ESP_GATT_CONN_LMP_TIMEOUT = 0x22, /*!< Connection fail for LMP response tout */
ESP_GATT_CONN_CONN_CANCEL = 0x0100, /*!< L2CAP connection cancelled */
ESP_GATT_CONN_NONE = 0x0101 /*!< No connection to cancel */
} esp_gatt_conn_reason_t;
/**
* @brief Gatt id, include uuid and instance id
*/
typedef struct {
esp_bt_uuid_t uuid; /*!< UUID */
uint8_t inst_id; /*!< Instance id */
} __attribute__((packed)) esp_gatt_id_t;
/**
* @brief Gatt service id, include id
* (uuid and instance id) and primary flag
*/
typedef struct {
esp_gatt_id_t id; /*!< Gatt id, include uuid and instance */
bool is_primary; /*!< This service is primary or not */
} __attribute__((packed)) esp_gatt_srvc_id_t;
/**
* @brief Gatt authentication request type
*/
typedef enum {
AUTH_REQ_NO_SCATTERNET, /* Device doesn't support scatternet, it might
support "role switch during connection" for
@ -103,8 +118,9 @@ typedef enum {
and slave roles */
} esp_gatt_auth_req_t;
/* Attribute permissions
*/
/**
* @brief Attribute permissions
*/
typedef enum {
ESP_GATT_PERM_READ = (1 << 0), /* bit 0 - 0x0001 */
ESP_GATT_PERM_READ_ENCRYPTED = (1 << 1), /* bit 1 - 0x0002 */

View file

@ -66,16 +66,22 @@
#define ESP_GATT_DEF_BLE_MTU_SIZE 23
#define ESP_GATT_MAX_MTU_SIZE 517
/* esp_ble_gattc_cb_param_t */
/**
* @brief Gatt client callback parameters union
*/
typedef union {
/*registration data for ESP_GATTC_REG_EVT */
/**
* @brief ESP_GATTC_REG_EVT
*/
struct gattc_reg_evt_param {
esp_gatt_status_t status; /*!< Operation status */
esp_gatt_if_t gatt_if; /*!< Gatt interface id, different application on gatt client different gatt_if */
uint16_t app_id; /*!< Application id which input in register API */
} reg; /*!< Gatt client callback param of ESP_GATTC_REG_EVT */
/* ESP_GATTC_OPEN_EVT */
/**
* @brief ESP_GATTC_OPEN_EVT
*/
struct gattc_open_evt_param {
esp_gatt_status_t status; /*!< Operation status */
uint16_t conn_id; /*!< Connection id */
@ -84,35 +90,45 @@ typedef union {
uint16_t mtu; /*!< MTU size */
} open; /*!< Gatt client callback param of ESP_GATTC_OPEN_EVT */
/* ESP_GATTC_CLOSE_EVT */
/**
* @brief ESP_GATTC_CLOSE_EVT
*/
struct gattc_close_evt_param {
esp_gatt_status_t status; /*!< Operation status */
uint16_t conn_id; /*!< Connection id */
esp_gatt_if_t gatt_if; /*!< Gatt interface id, different application on gatt client different gatt_if */
esp_bd_addr_t remote_bda; /*!< Remote bluetooth device address */
esp_gatt_reason_t reason; /*!< The reason of gatt close */
esp_gatt_conn_reason_t reason; /*!< The reason of gatt connection close */
} close; /*!< Gatt client callback param of ESP_GATTC_CLOSE_EVT */
/* ESP_GATTC_CFG_MTU_EVT */
/**
* @brief ESP_GATTC_CFG_MTU_EVT
*/
struct gattc_cfg_mtu_evt_param {
esp_gatt_status_t status; /*!< Operation status */
uint16_t conn_id; /*!< Connection id */
uint16_t mtu; /*!< MTU size */
} cfg_mtu; /*!< Gatt client callback param of ESP_GATTC_CFG_MTU_EVT */
/* ESP_GATTC_SEARCH_CMPL_EVT */
/**
* @brief ESP_GATTC_SEARCH_CMPL_EVT
*/
struct gattc_search_cmpl_evt_param {
esp_gatt_status_t status; /*!< Operation status */
uint16_t conn_id; /*!< Connection id */
} search_cmpl; /*!< Gatt client callback param of ESP_GATTC_SEARCH_CMPL_EVT */
/* ESP_GATTC_SEARCH_RES_EVT */
/**
* @brief ESP_GATTC_SEARCH_RES_EVT
*/
struct gattc_search_res_evt_param {
uint16_t conn_id; /*!< Connection id */
esp_gatt_srvc_id_t srvc_id; /*!< Service id, include service uuid and other information */
} search_res; /*!< Gatt client callback param of ESP_GATTC_SEARCH_RES_EVT */
/* ESP_GATTC_READ_CHAR_EVT, ESP_GATTC_READ_DESCR_EVT */
/**
* @brief ESP_GATTC_READ_CHAR_EVT, ESP_GATTC_READ_DESCR_EVT
*/
struct gattc_read_char_evt_param {
esp_gatt_status_t status; /*!< Operation status */
uint16_t conn_id; /*!< Connection id */
@ -124,7 +140,9 @@ typedef union {
uint16_t value_len; /*!< Characteristic value length */
} read; /*!< Gatt client callback param of ESP_GATTC_READ_CHAR_EVT */
/* ESP_GATTC_WRITE_CHAR_EVT, ESP_GATTC_PREP_WRITE_EVT, ESP_GATTC_WRITE_DESCR_EVT */
/**
* @brief ESP_GATTC_WRITE_CHAR_EVT, ESP_GATTC_PREP_WRITE_EVT, ESP_GATTC_WRITE_DESCR_EVT
*/
struct gattc_write_evt_param {
esp_gatt_status_t status; /*!< Operation status */
uint16_t conn_id; /*!< Connection id */
@ -133,13 +151,17 @@ typedef union {
esp_gatt_id_t descr_id; /*!< Descriptor id, include descriptor uuid and other information */
} write; /*!< Gatt client callback param of ESP_GATTC_WRITE_DESCR_EVT */
/* ESP_GATTC_EXEC_EVT */
/**
* @brief ESP_GATTC_EXEC_EVT
*/
struct gattc_exec_cmpl_evt_param {
esp_gatt_status_t status; /*!< Operation status */
uint16_t conn_id; /*!< Connection id */
} exec_cmpl; /*!< Gatt client callback param of ESP_GATTC_EXEC_EVT */
/* ESP_GATTC_NOTIFY_EVT */
/**
* @brief ESP_GATTC_NOTIFY_EVT
*/
struct gattc_notify_evt_param {
uint16_t conn_id; /*!< Connection id */
esp_bd_addr_t remote_bda; /*!< Remote bluetooth device address */
@ -151,18 +173,24 @@ typedef union {
bool is_notify; /*!< True means notify, false means indicate */
} notify; /*!< Gatt client callback param of ESP_GATTC_NOTIFY_EVT */
/* ESP_GATTC_SRVC_CHG_EVT*/
/**
* @brief ESP_GATTC_SRVC_CHG_EVT
*/
struct gattc_srvc_chg_evt_param {
esp_bd_addr_t remote_bda; /*!< Remote bluetooth device address */
} srvc_chg; /*!< Gatt client callback param of ESP_GATTC_SRVC_CHG_EVT */
/* ESP_GATTC_CONGEST_EVT */
/**
* @brief ESP_GATTC_CONGEST_EVT
*/
struct gattc_congest_evt_param {
uint16_t conn_id; /*!< Connection id */
bool congested; /*!< Congested or not */
} congest; /*!< Gatt client callback param of ESP_GATTC_CONGEST_EVT */
/* ESP_GATTC_GET_CHAR_EVT */
/**
* @brief ESP_GATTC_GET_CHAR_EVT
*/
struct gattc_get_char_evt_param {
esp_gatt_status_t status; /*!< Operation status */
uint16_t conn_id; /*!< Connection id */
@ -171,7 +199,9 @@ typedef union {
esp_gatt_char_prop_t char_prop; /*!< Characteristic property */
} get_char; /*!< Gatt client callback param of ESP_GATTC_GET_CHAR_EVT */
/* ESP_GATTC_GET_DESCR_EVT */
/**
* @brief ESP_GATTC_GET_DESCR_EVT
*/
struct gattc_get_descr_evt_param {
esp_gatt_status_t status; /*!< Operation status */
uint16_t conn_id; /*!< Connection id */
@ -180,7 +210,9 @@ typedef union {
esp_gatt_id_t descr_id; /*!< Descriptor id, include descriptor uuid and other information */
} get_descr; /*!< Gatt client callback param of ESP_GATTC_GET_DESCR_EVT */
/* ESP_GATTC_GET_INCL_SRVC_EVT */
/**
* @brief ESP_GATTC_GET_INCL_SRVC_EVT
*/
struct gattc_get_incl_srvc_evt_param {
esp_gatt_status_t status; /*!< Operation status */
uint16_t conn_id; /*!< Connection id */
@ -188,14 +220,18 @@ typedef union {
esp_gatt_srvc_id_t incl_srvc_id;/*!< Included service id, include service uuid and other information */
} get_incl_srvc; /*!< Gatt client callback param of ESP_GATTC_GET_INCL_SRVC_EVT */
/* ESP_GATTC_REG_FOR_NOTIFY_EVT */
/**
* @brief ESP_GATTC_REG_FOR_NOTIFY_EVT
*/
struct gattc_reg_for_notify_evt_param {
esp_gatt_status_t status; /*!< Operation status */
esp_gatt_srvc_id_t srvc_id; /*!< Service id, include service uuid and other information */
esp_gatt_id_t char_id; /*!< Characteristic id, include characteristic uuid and other information */
} reg_for_notify; /*!< Gatt client callback param of ESP_GATTC_REG_FOR_NOTIFY_EVT */
/* ESP_GATTC_UNREG_FOR_NOTIFY_EVT */
/**
* @brief ESP_GATTC_UNREG_FOR_NOTIFY_EVT
*/
struct gattc_unreg_for_notify_evt_param {
esp_gatt_status_t status; /*!< Operation status */
esp_gatt_srvc_id_t srvc_id; /*!< Service id, include service uuid and other information */

View file

@ -47,16 +47,22 @@
/* following is extra event */
#define ESP_GATTS_RESPONSE_EVT 21
/* esp_ble_gatts_cb_param_t */
/**
* @brief Gatt server callback parameters union
*/
typedef union {
//ESP_GATTS_REG_EVT
/**
* @brief ESP_GATTS_REG_EVT
*/
struct gatts_reg_evt_param {
esp_gatt_status_t status; /*!< Operation status */
uint16_t gatt_if; /*!< Gatt interface id, different application on gatt client different gatt_if */
uint16_t app_id; /*!< Application id which input in register API */
} reg; /*!< Gatt server callback param of ESP_GATTS_REG_EVT */
// param for ESP_GATTS_READ_EVT
/**
* @brief ESP_GATTS_READ_EVT
*/
struct gatts_read_evt_param {
uint16_t conn_id; /*!< Connection id */
uint32_t trans_id; /*!< Transfer id */
@ -66,7 +72,9 @@ typedef union {
bool is_long; /*!< The value is too long or not */
} read; /*!< Gatt server callback param of ESP_GATTS_READ_EVT */
// param for ESP_GATTS_WRITE_EVT
/**
* @brief ESP_GATTS_WRITE_EVT
*/
struct gatts_write_evt_param {
uint16_t conn_id; /*!< Connection id */
uint32_t trans_id; /*!< Transfer id */
@ -79,7 +87,9 @@ typedef union {
uint8_t *value; /*!< The write attribute value */
} write; /*!< Gatt server callback param of ESP_GATTS_WRITE_EVT */
// param for ESP_GATTS_EXEC_WRITE_EVT
/**
* @brief ESP_GATTS_EXEC_WRITE_EVT
*/
struct gatts_exec_write_evt_param {
uint16_t conn_id; /*!< Connection id */
uint32_t trans_id; /*!< Transfer id */
@ -89,20 +99,29 @@ typedef union {
uint8_t exec_write_flag; /*!< Execute write flag */
} exec_write; /*!< Gatt server callback param of ESP_GATTS_EXEC_WRITE_EVT */
// param for ESP_GATTS_MTU_EVT
/**
* @brief ESP_GATTS_MTU_EVT
*/
struct gatts_mtu_evt_param {
uint16_t conn_id; /*!< Connection id */
uint16_t mtu; /*!< MTU size */
} mtu; /*!< Gatt server callback param of ESP_GATTS_MTU_EVT */
// param for ESP_GATTS_CONF_EVT
/**
* @brief ESP_GATTS_CONF_EVT
*/
struct gatts_conf_evt_param {
esp_gatt_status_t status; /*!< Operation status */
uint16_t conn_id; /*!< Connection id */
} conf; /*!< Gatt server callback param of ESP_GATTS_CONF_EVT (confirm) */
// param for ESP_GATTS_UNREG_EVT, NONE
// param for ESP_GATTS_CREATE_EVT
/**
* @brief ESP_GATTS_UNREG_EVT
*/
/**
* @brief ESP_GATTS_CREATE_EVT
*/
struct gatts_create_evt_param {
esp_gatt_status_t status; /*!< Operation status */
uint16_t gatt_if; /*!< Gatt interface id, different application on gatt client different gatt_if */
@ -110,7 +129,9 @@ typedef union {
esp_gatt_srvc_id_t service_id; /*!< Service id, include service uuid and other information */
} create; /*!< Gatt server callback param of ESP_GATTS_CREATE_EVT */
// param for ESP_GATTS_ADD_INCL_SRVC_EVT
/**
* @brief ESP_GATTS_ADD_INCL_SRVC_EVT
*/
struct gatts_add_incl_srvc_evt_param {
esp_gatt_status_t status; /*!< Operation status */
uint16_t gatt_if; /*!< Gatt interface id, different application on gatt client different gatt_if */
@ -118,7 +139,9 @@ typedef union {
uint16_t service_handle; /*!< Service attribute handle */
} add_incl_srvc; /*!< Gatt server callback param of ESP_GATTS_ADD_INCL_SRVC_EVT */
// param for ESP_GATTS_ADD_CHAR_EVT
/**
* @brief ESP_GATTS_ADD_CHAR_EVT
*/
struct gatts_add_char_evt_param {
esp_gatt_status_t status; /*!< Operation status */
uint16_t gatt_if; /*!< Gatt interface id, different application on gatt client different gatt_if */
@ -127,7 +150,9 @@ typedef union {
esp_bt_uuid_t char_uuid; /*!< Characteristic uuid */
} add_char; /*!< Gatt server callback param of ESP_GATTS_ADD_CHAR_EVT */
// param for ESP_GATTS_ADD_CHAR_DESCR_EVT
/**
* @brief ESP_GATTS_ADD_CHAR_DESCR_EVT
*/
struct gatts_add_char_descr_evt_param {
esp_gatt_status_t status; /*!< Operation status */
uint16_t gatt_if; /*!< Gatt interface id, different application on gatt client different gatt_if */
@ -136,28 +161,36 @@ typedef union {
esp_bt_uuid_t char_uuid; /*!< Characteristic uuid */
} add_char_descr; /*!< Gatt server callback param of ESP_GATTS_ADD_CHAR_DESCR_EVT */
// param for ESP_GATTS_DELETE_EVT
/**
* @brief ESP_GATTS_DELETE_EVT
*/
struct gatts_delete_evt_param {
esp_gatt_status_t status; /*!< Operation status */
uint16_t gatt_if; /*!< Gatt interface id, different application on gatt client different gatt_if */
uint16_t service_handle; /*!< Service attribute handle */
} del; /*!< Gatt server callback param of ESP_GATTS_DELETE_EVT */
// param for ESP_GATTS_START_EVT
/**
* @brief ESP_GATTS_START_EVT
*/
struct gatts_start_evt_param {
esp_gatt_status_t status; /*!< Operation status */
uint16_t gatt_if; /*!< Gatt interface id, different application on gatt client different gatt_if */
uint16_t service_handle; /*!< Service attribute handle */
} start; /*!< Gatt server callback param of ESP_GATTS_START_EVT */
// param for ESP_GATTS_STOP_EVT
/**
* @brief ESP_GATTS_STOP_EVT
*/
struct gatts_stop_evt_param {
esp_gatt_status_t status; /*!< Operation status */
uint16_t gatt_if; /*!< Gatt interface id, different application on gatt client different gatt_if */
uint16_t service_handle; /*!< Service attribute handle */
} stop; /*!< Gatt server callback param of ESP_GATTS_STOP_EVT */
// param for ESP_GATTS_CONNECT_EVT
/**
* @brief ESP_GATTS_CONNECT_EVT
*/
struct gatts_connect_evt_param {
uint16_t conn_id; /*!< Connection id */
uint16_t gatt_if; /*!< Gatt interface id, different application on gatt client different gatt_if */
@ -165,7 +198,9 @@ typedef union {
bool is_connected; /*!< Indicate it is connected or not */
} connect; /*!< Gatt server callback param of ESP_GATTS_CONNECT_EVT */
// param for ESP_GATTS_DISCONNECT_EVT
/**
* @brief ESP_GATTS_DISCONNECT_EVT
*/
struct gatts_disconnect_evt_param {
uint16_t conn_id; /*!< Connection id */
uint16_t gatt_if; /*!< Gatt interface id, different application on gatt client different gatt_if */
@ -173,17 +208,29 @@ typedef union {
bool is_connected; /*!< Indicate it is connected or not */
} disconnect; /*!< Gatt server callback param of ESP_GATTS_DISCONNECT_EVT */
// param for ESP_GATTS_OPEN_EVT none
// param for ESP_GATTS_CANCEL_OPEN_EVT none
// param for ESP_GATTS_CLOSE_EVT none
// param for ESP_GATTS_LISTEN_EVT none
// param for ESP_GATTS_CONGEST_EVT
/**
* @brief ESP_GATTS_OPEN_EVT
*/
/**
* @brief ESP_GATTS_CANCEL_OPEN_EVT
*/
/**
* @brief ESP_GATTS_CLOSE_EVT
*/
/**
* @brief ESP_GATTS_LISTEN_EVT
*/
/**
* @brief ESP_GATTS_CONGEST_EVT
*/
struct gatts_congest_evt_param {
uint16_t conn_id; /*!< Connection id */
bool congested; /*!< Congested or not */
} congest; /*!< Gatt server callback param of ESP_GATTS_CONGEST_EVT */
// param for ESP_GATTS_RESPONSE_EVT
/**
* @brief ESP_GATTS_RESPONSE_EVT
*/
struct gatts_rsp_evt_param {
esp_gatt_status_t status; /*!< Operation status */
uint16_t handle; /*!< Attribute handle which send response */