From 739b4aadf706d9f49c58a6a591a43408efedcea2 Mon Sep 17 00:00:00 2001 From: Hrishikesh Dhayagude Date: Sat, 25 Aug 2018 21:21:42 +0530 Subject: [PATCH] components/bt: Make a pass through Bluetooth header files This is just a quick glance at all the header files exposed to the users from cleanup point of view. Signed-off-by: Hrishikesh Dhayagude --- .../bluedroid/api/include/api/esp_a2dp_api.h | 6 ++--- .../bluedroid/api/include/api/esp_avrc_api.h | 2 +- .../bluedroid/api/include/api/esp_bt_defs.h | 2 +- .../api/include/api/esp_gap_ble_api.h | 16 +++++++------- .../api/include/api/esp_gap_bt_api.h | 8 +++---- .../api/include/api/esp_gatt_common_api.h | 5 +++++ .../bluedroid/api/include/api/esp_gatt_defs.h | 4 ++-- .../bluedroid/api/include/api/esp_gattc_api.h | 10 ++++----- .../api/include/api/esp_hf_client_api.h | 12 +++++----- .../bluedroid/api/include/api/esp_hf_defs.h | 2 +- .../bluedroid/api/include/api/esp_spp_api.h | 22 +++++++++---------- components/bt/include/esp_bt.h | 8 +++---- 12 files changed, 51 insertions(+), 46 deletions(-) diff --git a/components/bt/bluedroid/api/include/api/esp_a2dp_api.h b/components/bt/bluedroid/api/include/api/esp_a2dp_api.h index 8117d4c54..3b002a405 100644 --- a/components/bt/bluedroid/api/include/api/esp_a2dp_api.h +++ b/components/bt/bluedroid/api/include/api/esp_a2dp_api.h @@ -116,7 +116,7 @@ typedef union { struct a2d_audio_cfg_param { esp_bd_addr_t remote_bda; /*!< remote bluetooth device address */ esp_a2d_mcc_t mcc; /*!< A2DP media codec capability information */ - } audio_cfg; /*!< media codec configuration infomation */ + } audio_cfg; /*!< media codec configuration information */ /** * @brief ESP_A2D_MEDIA_CTRL_ACK_EVT @@ -147,12 +147,12 @@ typedef void (* esp_a2d_sink_data_cb_t)(const uint8_t *buf, uint32_t len); /** * @brief A2DP source data read callback function * - * @param[in] buf : buffer to be filled with PCM data stream from higer layer + * @param[in] buf : buffer to be filled with PCM data stream from higher layer * * @param[in] len : size(in bytes) of data block to be copied to buf. -1 is an indication to user * that data buffer shall be flushed * - * @return size of bytes read successfully, if the argumetn len is -1, this value is ignored. + * @return size of bytes read successfully, if the argument len is -1, this value is ignored. * */ typedef int32_t (* esp_a2d_source_data_cb_t)(uint8_t *buf, int32_t len); diff --git a/components/bt/bluedroid/api/include/api/esp_avrc_api.h b/components/bt/bluedroid/api/include/api/esp_avrc_api.h index 228beb8ae..e1f68392c 100644 --- a/components/bt/bluedroid/api/include/api/esp_avrc_api.h +++ b/components/bt/bluedroid/api/include/api/esp_avrc_api.h @@ -111,7 +111,7 @@ typedef enum { /// AVRC shuffle modes typedef enum { ESP_AVRC_PS_SHUFFLE_OFF = 0x1, /* #include @@ -44,3 +47,5 @@ extern esp_err_t esp_ble_gatt_set_local_mtu (uint16_t mtu); #ifdef __cplusplus } #endif + +#endif /* __ESP_GATT_COMMON_API_H__ */ diff --git a/components/bt/bluedroid/api/include/api/esp_gatt_defs.h b/components/bt/bluedroid/api/include/api/esp_gatt_defs.h index 7053f266f..de4bc8976 100644 --- a/components/bt/bluedroid/api/include/api/esp_gatt_defs.h +++ b/components/bt/bluedroid/api/include/api/esp_gatt_defs.h @@ -224,7 +224,7 @@ typedef enum { ESP_GATT_CONN_L2C_FAILURE = 1, /*!< General L2cap failure */ /* relate to BTA_GATT_CONN_L2C_FAILURE in bta/bta_gatt_api.h */ ESP_GATT_CONN_TIMEOUT = 0x08, /*!< Connection timeout */ /* relate to BTA_GATT_CONN_TIMEOUT in bta/bta_gatt_api.h */ ESP_GATT_CONN_TERMINATE_PEER_USER = 0x13, /*!< Connection terminate by peer user */ /* relate to BTA_GATT_CONN_TERMINATE_PEER_USER in bta/bta_gatt_api.h */ - ESP_GATT_CONN_TERMINATE_LOCAL_HOST = 0x16, /*!< Connectionterminated by local host */ /* relate to BTA_GATT_CONN_TERMINATE_LOCAL_HOST in bta/bta_gatt_api.h */ + ESP_GATT_CONN_TERMINATE_LOCAL_HOST = 0x16, /*!< Connection terminated by local host */ /* relate to BTA_GATT_CONN_TERMINATE_LOCAL_HOST in bta/bta_gatt_api.h */ ESP_GATT_CONN_FAIL_ESTABLISH = 0x3e, /*!< Connection fail to establish */ /* relate to BTA_GATT_CONN_FAIL_ESTABLISH in bta/bta_gatt_api.h */ ESP_GATT_CONN_LMP_TIMEOUT = 0x22, /*!< Connection fail for LMP response tout */ /* relate to BTA_GATT_CONN_LMP_TIMEOUT in bta/bta_gatt_api.h */ ESP_GATT_CONN_CONN_CANCEL = 0x0100, /*!< L2CAP connection cancelled */ /* relate to BTA_GATT_CONN_CONN_CANCEL in bta/bta_gatt_api.h */ @@ -453,7 +453,7 @@ typedef struct { uint16_t incl_srvc_s_handle; /*!< The start handle of the service which has been included */ uint16_t incl_srvc_e_handle; /*!< The end handle of the service which has been included */ esp_bt_uuid_t uuid; /*!< The include service uuid */ -} esp_gattc_incl_svc_elem_t; /*!< The gattc inclue service element */ +} esp_gattc_incl_svc_elem_t; /*!< The gattc include service element */ #ifdef __cplusplus diff --git a/components/bt/bluedroid/api/include/api/esp_gattc_api.h b/components/bt/bluedroid/api/include/api/esp_gattc_api.h index 44c013d5e..b0fabb7a1 100644 --- a/components/bt/bluedroid/api/include/api/esp_gattc_api.h +++ b/components/bt/bluedroid/api/include/api/esp_gattc_api.h @@ -312,7 +312,7 @@ esp_err_t esp_ble_gattc_open(esp_gatt_if_t gattc_if, esp_bd_addr_t remote_bda, e /** - * @brief Close a virtual connection to a GATT server. gattc maybe have multiple virtual GATT server connections when multiple app_id registed, + * @brief Close the virtual connection to the GATT server. gattc may have multiple virtual GATT server connections when multiple app_id registered, * this API only close one virtual GATT server connection. if there exist other virtual GATT server connections, * it does not disconnect the physical connection. * if you want to disconnect the physical connection directly, you can use esp_ble_gap_disconnect(esp_bd_addr_t remote_device). @@ -371,7 +371,7 @@ esp_err_t esp_ble_gattc_search_service(esp_gatt_if_t gattc_if, uint16_t conn_id, * @param[in] gattc_if: Gatt client access interface. * @param[in] conn_id: connection ID which identify the server. * @param[in] svc_uuid: the pointer to the service uuid. - * @param[out] result: The pointer to the service whith has been found in the gattc cache. + * @param[out] result: The pointer to the service which has been found in the gattc cache. * @param[inout] count: input the number of service want to find, * it will output the number of service has been found in the gattc cache with the given service uuid. * @param[in] offset: Offset of the service position to get. @@ -392,7 +392,7 @@ esp_gatt_status_t esp_ble_gattc_get_service(esp_gatt_if_t gattc_if, uint16_t con * @param[in] conn_id: connection ID which identify the server. * @param[in] start_handle: the attribute start handle. * @param[in] end_handle: the attribute end handle - * @param[out] result: The pointer to the charateristic in the service. + * @param[out] result: The pointer to the characteristic in the service. * @param[inout] count: input the number of characteristic want to find, * it will output the number of characteristic has been found in the gattc cache with the given service. * @param[in] offset: Offset of the characteristic position to get. @@ -695,7 +695,7 @@ esp_err_t esp_ble_gattc_write_char_descr (esp_gatt_if_t gattc_if, * * @param[in] gattc_if: Gatt client access interface. * @param[in] conn_id : connection ID. - * @param[in] handle : charateristic handle to prepare write. + * @param[in] handle : characteristic handle to prepare write. * @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. @@ -720,7 +720,7 @@ esp_err_t esp_ble_gattc_prepare_write(esp_gatt_if_t gattc_if, * * @param[in] gattc_if: Gatt client access interface. * @param[in] conn_id : connection ID. - * @param[in] handle : characteristic descriptor hanlde to prepare write. + * @param[in] handle : characteristic descriptor handle to prepare write. * @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. diff --git a/components/bt/bluedroid/api/include/api/esp_hf_client_api.h b/components/bt/bluedroid/api/include/api/esp_hf_client_api.h index 65598e087..67ec894e0 100644 --- a/components/bt/bluedroid/api/include/api/esp_hf_client_api.h +++ b/components/bt/bluedroid/api/include/api/esp_hf_client_api.h @@ -40,7 +40,7 @@ typedef enum { ESP_HF_CLIENT_AUDIO_STATE_DISCONNECTED = 0, /*!< audio connection released */ ESP_HF_CLIENT_AUDIO_STATE_CONNECTING, /*!< audio connection has been initiated */ ESP_HF_CLIENT_AUDIO_STATE_CONNECTED, /*!< audio connection is established */ - ESP_HF_CLIENT_AUDIO_STATE_CONNECTED_MSBC, /*!< mSBC audio connection is estalibshed */ + ESP_HF_CLIENT_AUDIO_STATE_CONNECTED_MSBC, /*!< mSBC audio connection is established */ } esp_hf_client_audio_state_t; /// in-band ring tone state @@ -66,9 +66,9 @@ typedef enum { #define ESP_HF_CLIENT_CHLD_FEAT_REL_ACC 0x02 /* 1 Release active calls and accept other waiting or held call */ #define ESP_HF_CLIENT_CHLD_FEAT_REL_X 0x04 /* 1x Release specified active call only */ #define ESP_HF_CLIENT_CHLD_FEAT_HOLD_ACC 0x08 /* 2 Active calls on hold and accept other waiting or held call */ -#define ESP_HF_CLIENT_CHLD_FEAT_PRIV_X 0x10 /* 2x Request private mode with specified call(put the rest on hold */ +#define ESP_HF_CLIENT_CHLD_FEAT_PRIV_X 0x10 /* 2x Request private mode with specified call(put the rest on hold) */ #define ESP_HF_CLIENT_CHLD_FEAT_MERGE 0x20 /* 3 Add held call to multiparty */ -#define ESP_HF_CLIENT_CHLD_FEAT_MERGE_DETACH 0x40 /* 4 Connect two calls and leave(disconnct from multiparty */ +#define ESP_HF_CLIENT_CHLD_FEAT_MERGE_DETACH 0x40 /* 4 Connect two calls and leave(disconnect from multiparty) */ /// HF CLIENT callback events typedef enum { @@ -140,7 +140,7 @@ typedef union { * @brief ESP_HF_CLIENT_CIND_SIGNAL_STRENGTH_EVT */ struct hf_client_signal_strength_ind_param { - int value; /*!< singal strength value, ranges from 0 to 5 */ + int value; /*!< signal strength value, ranges from 0 to 5 */ } signal_strength; /*!< HF callback param of ESP_HF_CLIENT_CIND_SIGNAL_STRENGTH_EVT */ /** @@ -175,7 +175,7 @@ typedef union { * @brief ESP_HF_CLIENT_CIND_CALL_HELD_EVT */ struct hf_client_call_held_ind_param { - esp_hf_call_held_status_t status; /*!< bluetooth proprietary call hold status indocator */ + esp_hf_call_held_status_t status; /*!< bluetooth proprietary call hold status indicator */ } call_held; /*!< HF callback param of ESP_HF_CLIENT_CIND_CALL_HELD_EVT */ /** @@ -619,7 +619,7 @@ void esp_hf_client_pcm_resample_init(uint32_t src_sps, uint32_t bits, uint32_t c * @brief Down sampling utility to convert high sampling rate into 8K/16bits 1-channel mode PCM * samples. This can only be used in the case that Voice Over HCI is enabled. * - * @param[in] src: pointer to the buffer where the original smapling PCM are stored + * @param[in] src: pointer to the buffer where the original sampling PCM are stored * @param[in] in_bytes: length of the input PCM sample buffer in byte * @param[in] dst: pointer to the buffer which is to be used to store the converted PCM samples * diff --git a/components/bt/bluedroid/api/include/api/esp_hf_defs.h b/components/bt/bluedroid/api/include/api/esp_hf_defs.h index b71277932..1ff9f14f6 100644 --- a/components/bt/bluedroid/api/include/api/esp_hf_defs.h +++ b/components/bt/bluedroid/api/include/api/esp_hf_defs.h @@ -120,7 +120,7 @@ typedef enum { /// response indication codes for AT commands typedef enum { - ESP_HF_AT_RESPONSE_CODE_OK = 0, /*!< acknoweledges execution of a command line */ + ESP_HF_AT_RESPONSE_CODE_OK = 0, /*!< acknowledges execution of a command line */ ESP_HF_AT_RESPONSE_CODE_ERR, /*!< command not accepted */ ESP_HF_AT_RESPONSE_CODE_NO_CARRIER, /*!< connection terminated */ ESP_HF_AT_RESPONSE_CODE_BUSY, /*!< busy signal detected */ diff --git a/components/bt/bluedroid/api/include/api/esp_spp_api.h b/components/bt/bluedroid/api/include/api/esp_spp_api.h index e819158cd..d7f357748 100644 --- a/components/bt/bluedroid/api/include/api/esp_spp_api.h +++ b/components/bt/bluedroid/api/include/api/esp_spp_api.h @@ -62,9 +62,9 @@ typedef enum { ESP_SPP_CLOSE_EVT = 27, /*!< When SPP connection closed, the event comes */ ESP_SPP_START_EVT = 28, /*!< When SPP server started, the event comes */ ESP_SPP_CL_INIT_EVT = 29, /*!< When SPP client initiated a connection, the event comes */ - ESP_SPP_DATA_IND_EVT = 30, /*!< When SPP connection received data, the event comes, olny for ESP_SPP_MODE_CB */ - ESP_SPP_CONG_EVT = 31, /*!< When SPP connection congestion status changed, the event comes, olny for ESP_SPP_MODE_CB */ - ESP_SPP_WRITE_EVT = 33, /*!< When SPP write operation completes, the event comes, olny for ESP_SPP_MODE_CB */ + ESP_SPP_DATA_IND_EVT = 30, /*!< When SPP connection received data, the event comes, only for ESP_SPP_MODE_CB */ + ESP_SPP_CONG_EVT = 31, /*!< When SPP connection congestion status changed, the event comes, only for ESP_SPP_MODE_CB */ + ESP_SPP_WRITE_EVT = 33, /*!< When SPP write operation completes, the event comes, only for ESP_SPP_MODE_CB */ ESP_SPP_SRV_OPEN_EVT = 34, /*!< When SPP Server connection open, the event comes */ } esp_spp_cb_event_t; @@ -95,7 +95,7 @@ typedef union { struct spp_open_evt_param { esp_spp_status_t status; /*!< status */ uint32_t handle; /*!< The connection handle */ - int fd; /*!< The file descriptor olny for ESP_SPP_MODE_VFS*/ + int fd; /*!< The file descriptor only for ESP_SPP_MODE_VFS */ esp_bd_addr_t rem_bda; /*!< The peer address */ } open; /*!< SPP callback param of ESP_SPP_OPEN_EVT */ @@ -106,7 +106,7 @@ typedef union { esp_spp_status_t status; /*!< status */ uint32_t handle; /*!< The connection handle */ uint32_t new_listen_handle; /*!< The new listen handle */ - int fd; /*!< The file descriptor olny for ESP_SPP_MODE_VFS*/ + int fd; /*!< The file descriptor only for ESP_SPP_MODE_VFS */ esp_bd_addr_t rem_bda; /*!< The peer address */ } srv_open; /*!< SPP callback param of ESP_SPP_SRV_OPEN_EVT */ /** @@ -155,7 +155,7 @@ typedef union { esp_spp_status_t status; /*!< status */ uint32_t handle; /*!< The connection handle */ uint16_t len; /*!< The length of data */ - uint8_t *data; /*!< The data recived */ + uint8_t *data; /*!< The data received */ } data_ind; /*!< SPP callback param of ESP_SPP_DATA_IND_EVT */ /** @@ -224,14 +224,14 @@ esp_err_t esp_spp_deinit(); esp_err_t esp_spp_start_discovery(esp_bd_addr_t bd_addr); /** - * @brief This function makes an SPP conection to a remote BD Address. + * @brief This function makes an SPP connection to a remote BD Address. * When the connection is initiated or failed to initiate, * the callback is called with ESP_SPP_CL_INIT_EVT. * When the connection is established or failed, * the callback is called with ESP_SPP_OPEN_EVT. * * @param[in] sec_mask: Security Setting Mask . - * @param[in] role: Msater or slave. + * @param[in] role: Master or slave. * @param[in] remote_scn: Remote device bluetooth device SCN. * @param[in] peer_bd_addr: Remote device bluetooth device address. * @@ -262,7 +262,7 @@ esp_err_t esp_spp_disconnect(uint32_t handle); * with ESP_SPP_SRV_OPEN_EVT. * * @param[in] sec_mask: Security Setting Mask . - * @param[in] role: Msater or slave. + * @param[in] role: Master or slave. * @param[in] local_scn: The specific channel you want to get. * If channel is 0, means get any channel. * @param[in] name: Server's name. @@ -276,7 +276,7 @@ esp_err_t esp_spp_start_srv(esp_spp_sec_t sec_mask, /** - * @brief This function is used to write data, olny for ESP_SPP_MODE_CB. + * @brief This function is used to write data, only for ESP_SPP_MODE_CB. * * @param[in] handle: The connection handle. * @param[in] len: The length of the data written. @@ -302,4 +302,4 @@ esp_err_t esp_spp_vfs_register(void); } #endif -#endif ///__ESP_SPP_API_H__ \ No newline at end of file +#endif ///__ESP_SPP_API_H__ diff --git a/components/bt/include/esp_bt.h b/components/bt/include/esp_bt.h index 0376b5d38..c18e0e543 100644 --- a/components/bt/include/esp_bt.h +++ b/components/bt/include/esp_bt.h @@ -141,7 +141,7 @@ typedef struct { * It will be overwrite with a constant value which in menuconfig or from a macro. * So, do not modify the value when esp_bt_controller_init() */ - uint8_t bt_max_sync_conn; /*!< BR/EDR maxium ACL connection numbers. Effective in menuconfig */ + uint8_t bt_max_sync_conn; /*!< BR/EDR maximum ACL connection numbers. Effective in menuconfig */ uint32_t magic; /*!< Magic number */ } esp_bt_controller_config_t; @@ -233,7 +233,7 @@ esp_power_level_t esp_ble_tx_power_get(esp_ble_power_type_t power_type); * BR/EDR power control will use the power in range of minimum value and maximum value. * The power level will effect the global BR/EDR TX power, such inquire, page, connection and so on. * Please call the function after esp_bt_controller_enable and before any function which cause RF do TX. - * So you can call the function can before do discover, beofre profile init and so on. + * So you can call the function before doing discovery, profile init and so on. * For example, if you want BR/EDR use the new TX power to do inquire, you should call * this function before inquire. Another word, If call this function when BR/EDR is in inquire(ING), * please do inquire again after call this function. @@ -324,7 +324,7 @@ bool esp_vhci_host_check_send_available(void); void esp_vhci_host_send_packet(uint8_t *data, uint16_t len); /** @brief esp_vhci_host_register_callback - * register the vhci referece callback, the call back + * register the vhci reference callback * struct defined by vhci_host_callback structure. * @param callback esp_vhci_host_callback type variable * @return ESP_OK - success, ESP_FAIL - failed @@ -440,7 +440,7 @@ bool esp_bt_controller_is_sleeping(void); * Note that after this request, bluetooth controller may again enter sleep as long as the modem sleep is enabled * * Profiling shows that it takes several milliseconds to wakeup from modem sleep after this request. - * Generally it takes longer if 32kHz XTAL is used than the main XTAL, due to the lower frequncy of the former as the bluetooth low power clock source. + * Generally it takes longer if 32kHz XTAL is used than the main XTAL, due to the lower frequency of the former as the bluetooth low power clock source. */ void esp_bt_controller_wakeup_request(void);