return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_gap_args_t), NULL) == BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
}
-
-/*******************************************************************************
-**
-** Function esp_ble_resolve_adv_data
-**
-** Description This function is called to get ADV data for a specific type.
-**
-** Parameters p_adv - pointer of ADV data
-** type - finding ADV data type
-** p_length - return the length of ADV data not including type
-**
-** Returns pointer of ADV data
-**
-*******************************************************************************/
-uint8_t *esp_ble_resolve_adv_data( uint8_t *p_adv, uint8_t type, uint8_t *p_length)
+uint8_t *esp_ble_resolve_adv_data( uint8_t *adv_data, uint8_t type, uint8_t *length)
{
if (((type < ESP_BLE_AD_TYPE_FLAG) || (type > ESP_BLE_AD_TYPE_128SERVICE_DATA)) &&
(type != ESP_BLE_AD_MANUFACTURER_SPECIFIC_TYPE)) {
return NULL;
}
- if (p_adv == NULL) {
+ if (adv_data == NULL) {
LOG_ERROR("Invalid p_eir data.\n");
return NULL;
}
- return (BTM_CheckAdvData( p_adv, type, p_length));
+ return (BTM_CheckAdvData( adv_data, type, length));
}
**
** @brief This function is called to send config state to phone
**
-** @param[in] state: blufi config ok or not
+** @param[in] state: blufi config OK or not
**
** @return ESP_OK - success, other - failed
**
**
** @function esp_blufi_profile_init
**
-** @brief This function is called to init blufi_profile
+** @brief This function is called to initialize blufi_profile
**
** @return ESP_OK - success, other - failed
**
**
** @function esp_blufi_profile_deinit
**
-** @brief This function is called to init blufi_profile
+** @brief This function is called to de-initialize blufi_profile
**
** @return ESP_OK - success, other - failed
**
typedef struct {
bool set_scan_rsp; /*!< Set this advertising data as scan response or not*/
bool include_name; /*!< Advertising data include device name or not */
- bool include_txpower; /*!< Advertising data include tx power */
- int min_interval; /*!< Advertising data show advertising min internval */
- int max_interval; /*!< Advertising data show advertising max internval */
- int appearance; /*!< Extenal appearance of device */
+ bool include_txpower; /*!< Advertising data include TX power */
+ int min_interval; /*!< Advertising data show advertising min interval */
+ int max_interval; /*!< Advertising data show advertising max interval */
+ int appearance; /*!< External appearance of device */
uint16_t manufacturer_len; /*!< Manufacturer data length */
uint8_t *p_manufacturer_data; /*!< Manufacturer data point */
uint16_t service_data_len; /*!< Service data length */
uint8_t *p_service_data; /*!< Service data point */
uint16_t service_uuid_len; /*!< Service uuid length */
- uint8_t *p_service_uuid; /*!< Service uuid arrary point */
+ uint8_t *p_service_uuid; /*!< Service uuid array point */
uint8_t flag; /*!< Advertising flag of discovery mode */
} esp_ble_adv_data_t;
ESP_GAP_SEARCH_INQ_RES_EVT = 0, /* Inquiry result for a peer device. */
ESP_GAP_SEARCH_INQ_CMPL_EVT = 1, /* Inquiry complete. */
ESP_GAP_SEARCH_DISC_RES_EVT = 2, /* Discovery result for a peer device. */
- ESP_GAP_SEARCH_DISC_BLE_RES_EVT = 3, /* Discovery result for BLE GATT based servoce on a peer device. */
+ ESP_GAP_SEARCH_DISC_BLE_RES_EVT = 3, /* Discovery result for BLE GATT based service on a peer device. */
ESP_GAP_SEARCH_DISC_CMPL_EVT = 4, /* Discovery complete. */
ESP_GAP_SEARCH_DI_DISC_CMPL_EVT = 5, /* Discovery complete. */
ESP_GAP_SEARCH_SEARCH_CANCEL_CMPL_EVT = 6, /* Search cancelled */
//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; /*!< BD address which has been searched */
+ esp_bd_addr_t bda; /*!< Bluetooth device address which has been searched */
esp_bt_dev_type_t dev_type; /*!< Device type */
esp_ble_addr_type_t ble_addr_type; /*!< Ble device address type */
- int rssi; /*!< Searched device's rssi */
+ int rssi; /*!< Searched device's RSSI */
uint8_t ble_adv[ESP_BLE_ADV_DATA_LEN_MAX]; /*!< Received EIR */
int flag; /*!< Advertising data flag bit */
int num_resps; /*!< Scan result number */
** @brief This function is called to override the BTA default ADV parameters.
**
** @param[in] adv_data: Pointer to User defined ADV data structure. This
-** memory space can not be freed until p_adv_data_cback
+** memory space can not be freed until callback of config_adv_data
** is received.
-** @param[in|out] adv_data_cback: set adv data complete callback.
**
** @return ESP_OK - success, other - failed
**
** @brief This function is called to set scan parameters
**
** @param[in] esp_ble_scan_params: Pointer to User defined scan_params data structure. This
-** memory space can not be freed until scan_param_setup_cback
+** memory space can not be freed until callback of set_scan_params
**
** @return ESP_OK - success, other - failed
**
**
** @function esp_ble_gap_start_scanning
**
-** @brief This procedure keep the device scanning the peer device whith advertising on the air
+** @brief This procedure keep the device scanning the peer device which advertising on the air
**
-** @param[in] duration: Keeping the scaning time, the unit is second.
+** @param[in] duration: Keeping the scanning time, the unit is second.
**
** @return ESP_OK - success, other - failed
**
**
** @function esp_ble_gap_stop_scanning
**
-** @brief This function call to stop the device scanning the peer device whith advertising on the air
-** @param void
-** @return ESP_OK - success, other - failed
+** @brief This function call to stop the device scanning the peer device which advertising on the air
+** @param void
+** @return ESP_OK - success, other - failed
**
*******************************************************************************/
esp_err_t esp_ble_gap_stop_scanning(void);
**
** @brief This function is called to start advertising.
**
-** @param[in] esp_ble_adv_params_all_t: ointer to User defined adv_params data structure.
+** @param[in] esp_ble_adv_params_all_t: pointer to User defined adv_params data structure.
**
** @return ESP_OK - success, other - failed
**
**
** @brief Update connection parameters, can only be used when connection is up.
**
-** @param[in] param - connection update params
+** @param[in] param - connection update parameters
**
** @return ESP_OK - success, other - failed
**
**
** @function esp_ble_gap_set_rand_addr
**
-** @brief This function set the random address for the appliction
+** @brief This function set the random address for the application
**
-** @param[in] rand_addr: the random address whith should be setting
+** @param[in] rand_addr: the random address which should be setting
**
** @return ESP_OK - success, other - failed
**
**
** @brief Enable/disable privacy on the local device
**
-** @param[in] privacy_enable - enable/disabe privacy on remote device.
+** @param[in] privacy_enable - enable/disable privacy on remote device.
**
** @return ESP_OK - success, other - failed
**
**
** @function esp_ble_resolve_adv_data
**
-** @brief This function is called to get ADV data for a specific type.
+** @brief This function is called to get ADV data for a specific type.
**
-** @param[in] p_adv - pointer of ADV data whitch to be resolved
+** @param[in] adv_data - pointer of ADV data which to be resolved
** @param[in] type - finding ADV data type
-** @param[out] p_length - return the length of ADV data not including type
+** @param[out] length - return the length of ADV data not including type
**
-** @return pointer of ADV data
+** @return pointer of ADV data
**
*******************************************************************************/
-uint8_t *esp_ble_resolve_adv_data(uint8_t *p_adv, uint8_t type, uint8_t *p_length);
+uint8_t *esp_ble_resolve_adv_data(uint8_t *adv_data, uint8_t type, uint8_t *p_length);
#endif /* __ESP_GAP_BLE_API_H__ */
#define ESP_GATTC_CLOSE_EVT 5 /* GATTC close request status event */
#define ESP_GATTC_SEARCH_CMPL_EVT 6 /* GATT discovery complete event */
#define ESP_GATTC_SEARCH_RES_EVT 7 /* GATT discovery result event */
-#define ESP_GATTC_READ_DESCR_EVT 8 /* GATT read characterisitc descriptor event */
+#define ESP_GATTC_READ_DESCR_EVT 8 /* GATT read characteristic descriptor event */
#define ESP_GATTC_WRITE_DESCR_EVT 9 /* GATT write characteristic descriptor event */
#define ESP_GATTC_NOTIFY_EVT 10 /* GATT attribute notification event */
#define ESP_GATTC_PREP_WRITE_EVT 11 /* GATT prepare write event */
** @brief This function is called to register application callbacks
** with GATTC module.
**
-** @param[in] callback - pointer to the application callback function.
+** @param[in] callback : pointer to the application callback function.
**
** @return ESP_OK - success, other - failed
**
** @brief This function is called to unregister an application
** from GATTC module.
**
-** @param[in] gatt_if - app identifier.
+** @param[in] gatt_if : app identifier.
**
** @return ESP_OK - success, other - failed
**
**
** @param[in] conn_id: connection ID which identify the server.
**
-** @param[in] srvc_id: serivce ID
+** @param[in] srvc_id: service ID
**
** @param[in] start_char_id: the start characteristic ID
**
** @param[in] srvc_id: the service ID of which the characteristic is belonged to.
** @param[in] char_id: Characteristic ID, if NULL find the first available
** characteristic.
-** @param[in] start_descr_id: the sctart descriptor id
+** @param[in] start_descr_id: the start descriptor id
**
** @return ESP_OK - success, other - failed
**
** @function esp_ble_gattc_read_char
**
** @brief This function is called to read a service's characteristics of
-** the given characteritisc ID.UTH_REQ_NO_SCATTERNET
+** the given characteriistic ID
**
-** @param[in] conn_id - connection ID.
-** @param[in] srvc_id - service ID.
-** @param[in] char_id - characteritic ID to read.
-** @param[in] auth_req - authenticate request type
+** @param[in] conn_id : connection ID.
+** @param[in] srvc_id : service ID.
+** @param[in] char_id : characteristic ID to read.
+** @param[in] auth_req : authenticate request type
**
** @return ESP_OK - success, other - failed
**
**
** @brief This function is called to read a characteristics descriptor.
**
-** @param[in] conn_id - connection ID.
-** @param[in] srvc_id - service ID.
-** @param[in] descr_id - characteritic descriptor ID to read.
-** @param[in] auth_req - authenticate request type
+** @param[in] conn_id : connection ID.
+** @param[in] srvc_id : service ID.
+** @param[in] descr_id : characteristic descriptor ID to read.
+** @param[in] auth_req : authenticate request type
**
** @return ESP_OK - success, other - failed
**
**
** @brief This function is called to write characteristic value.
**
-** @param[in] conn_id - connection ID.
-** @param[in] srvc_id - service ID.
-** @param[in] char_id - characteristic ID to write.
+** @param[in] conn_id : connection ID.
+** @param[in] srvc_id : service ID.
+** @param[in] char_id : characteristic ID to write.
** @param[in] value_len: length of the value to be written.
-** @param[in] value - the value to be written.
+** @param[in] value : the value to be written.
**
** @return ESP_OK - success, other - failed
**
**
** @brief This function is called to write characteristic descriptor value.
**
-** @param[in] conn_id - connection ID
-** @param[in] srvc_id - service ID.
-** @param[in] char_id - characteristic ID.
-** @param[in] descr_id - characteristic descriptor ID to write.
+** @param[in] conn_id : connection ID
+** @param[in] srvc_id : service ID.
+** @param[in] char_id : characteristic ID.
+** @param[in] descr_id : characteristic descriptor ID to write.
** @param[in] value_len: length of the value to be written.
-** @param[in] value - the value to be written.
+** @param[in] value : the value to be written.
**
** @return ESP_OK - success, other - failed
**
**
** @brief This function is called to prepare write a characteristic value.
**
-** @param[in] conn_id - connection ID.
-** @param[in] char_id - GATT characteritic ID of the service.
-** @param[in] offset - offset of the write value.
+** @param[in] conn_id : connection ID.
+** @param[in] char_id : GATT characteristic ID of the service.
+** @param[in] offset : offset of the write value.
** @param[in] value_len: length of the value to be written.
-** @param[in] value - the value to be written.
+** @param[in] value : the value to be written.
**
** @return ESP_OK - success, other - failed
**
/*******************************************************************************
**
-** @function esp_ble_gattc_execu_write
+** @function esp_ble_gattc_execute_write
**
** @brief This function is called to execute write a prepare write sequence.
**
-** @param[in] conn_id - connection ID.
-** @param[in] is_execute - execute or cancel.
+** @param[in] conn_id : connection ID.
+** @param[in] is_execute : execute or cancel.
**
** @return ESP_OK - success, other - failed
**
**
** @brief This function is called to register for notification of a service.
**
-** @param[in] gatt_if - gatt interface id.
-** @param[in] bda - target GATT server.
-** @param[in] srvc_id - pointer to GATT service ID.
-** @param[in] char_id - pointer to GATT characteristic ID.
+** @param[in] gatt_if : gatt interface id.
+** @param[in] bda : target GATT server.
+** @param[in] srvc_id : pointer to GATT service ID.
+** @param[in] char_id : pointer to GATT characteristic ID.
**
** @return OK if registration succeed, otherwise failed.
**
**
** @brief This function is called to de-register for notification of a service.
**
-** @param[in] gatt_if - gatt interface id.
-** @param[in] bda - target GATT server.
-** @param[in] srvc_id - pointer to GATT service ID.
-** @param[in] char_id - pointer to GATT characteristic ID.
+** @param[in] gatt_if : gatt interface id.
+** @param[in] bda : target GATT server.
+** @param[in] srvc_id : pointer to GATT service ID.
+** @param[in] char_id : pointer to GATT characteristic ID.
**
-** @return OK if deregistration succeed, otherwise failed.
+** @return OK if unregister succeed, otherwise failed.
**
*******************************************************************************/
esp_gatt_status_t esp_ble_gattc_unregister_for_notify (esp_gatt_if_t gatt_if,
typedef union {
//ESP_GATTS_REG_EVT
struct gatts_reg_evt_param {
- int status; /*!< Operation status */
+ 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_CONF_EVT
struct gatts_conf_evt_param {
- int status; /*!< Operation status */
+ 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
struct gatts_create_evt_param {
- int status; /*!< Operation status */
+ 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 */
esp_gatt_srvc_id_t service_id; /*!< Service id, include service uuid and other information */
// param for ESP_GATTS_ADD_INCL_SRVC_EVT
struct gatts_add_incl_srvc_evt_param {
- int status; /*!< Operation status */
+ esp_gatt_status_t status; /*!< Operation status */
uint16_t gatt_if; /*!< Gatt interface id, different application on gatt client different gatt_if */
uint16_t attr_handle; /*!< Included service attribute handle */
uint16_t service_handle; /*!< Service attribute handle */
// param for ESP_GATTS_ADD_CHAR_EVT
struct gatts_add_char_evt_param {
- int status; /*!< Operation status */
+ esp_gatt_status_t status; /*!< Operation status */
uint16_t gatt_if; /*!< Gatt interface id, different application on gatt client different gatt_if */
uint16_t attr_handle; /*!< Characteristic attribute handle */
uint16_t service_handle; /*!< Service attribute handle */
// param for ESP_GATTS_ADD_CHAR_DESCR_EVT
struct gatts_add_char_descr_evt_param {
- int status; /*!< Operation status */
+ esp_gatt_status_t status; /*!< Operation status */
uint16_t gatt_if; /*!< Gatt interface id, different application on gatt client different gatt_if */
uint16_t attr_handle; /*!< Descriptor attribute handle */
uint16_t service_handle; /*!< Service attribute handle */
// param for ESP_GATTS_DELETE_EVT
struct gatts_delete_evt_param {
- int status; /*!< Operation status */
+ 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
struct gatts_start_evt_param {
- int status; /*!< Operation status */
+ 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
struct gatts_stop_evt_param {
- int status; /*!< Operation status */
+ 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_RESPONSE_EVT
struct gatts_rsp_evt_param {
- int status; /*!< Operation status */
+ esp_gatt_status_t status; /*!< Operation status */
uint16_t handle; /*!< Attribute handle which send response */
} rsp; /*!< Gatt server callback param of ESP_GATTS_RESPONSE_EVT */
} esp_ble_gatts_cb_param_t;
**
** @function esp_ble_gatts_app_unregister
**
-** @brief un-register with GATT Server.
+** @brief unregister with GATT Server.
**
** @param[in] gatt_if: gatt interface id.
**
**
** @param[in] gatt_if: gatt interface ID
** @param[in] service_id: service ID.
-** @param[in] num_handle: numble of handle requessted for this service.
+** @param[in] num_handle: number of handle requested for this service.
**
** @return ESP_OK - success, other - failed
**
** it's done, a callback event BTA_GATTS_ADD_DESCR_EVT is called
** to report the status and an ID number for this descriptor.
**
-** @param[in] service_handle: service handle to which this charatceristic descriptor is to
+** @param[in] service_handle: service handle to which this characteristic descriptor is to
** be added.
** @param[in] perm: descriptor access permission.
** @param[in] descr_uuid: descriptor UUID.
** @brief This function is called to start a service.
**
** @param[in] service_handle: the service handle to be started.
-** @param[in] sup_transport: supported trasnport.
+** @param[in] sup_transport: supported transport.
**
** @return ESP_OK - success, other - failed
**
** @brief This function is called to send a response to a request.
**
** @param[in] conn_id - connection identifier.
-** @param[in] trans_id - transfe id
+** @param[in] trans_id - transfer id
** @param[in] status - response status
** @param[in] rsp - response data.
**
** @function esp_ble_gatts_open
**
** @brief Open a direct open connection or add a background auto connection
-** bd address
**
** @param[in] gatt_if: application ID.
-** @param[in] remote_bda: remote device BD address.
+** @param[in] remote_bda: remote device bluetooth device address.
** @param[in] is_direct: direct connection or background auto connection
**
** @return ESP_OK - success, other - failed
LOG_INFO("ADD_DESCR_EVT, status %d, gatt_if %d, attr_handle %d, service_handle %d\n",
p->add_char.status, p->add_char.gatt_if, p->add_char.attr_handle, p->add_char.service_handle);
break;
- case ESP_GATTS_DELELTE_EVT:
+ case ESP_GATTS_DELETE_EVT:
break;
case ESP_GATTS_START_EVT:
LOG_INFO("SERVICE_START_EVT, status %d, gatt_if %d, service_handle %d\n",