component_bt: Fix build doc errors of bt

1. bluedroid: use standard function pointer define.
   2. blufi: Change ESP_BD_ADDR_LEN into ESP_BLUFI_BD_ADDR_LEN
   3. doc/sphinx_known_warnings: Remove fixed parts.
This commit is contained in:
weitianhua 2022-05-10 16:01:15 +08:00
parent 6d85d53cee
commit 72fd3bc1e6
13 changed files with 23 additions and 53 deletions

View File

@ -114,9 +114,9 @@ typedef struct {
} esp_blufi_ap_record_t; } esp_blufi_ap_record_t;
/// Bluetooth address length /// Bluetooth address length
#define ESP_BD_ADDR_LEN 6 #define ESP_BLUFI_BD_ADDR_LEN 6
/// Bluetooth device address /// Bluetooth device address
typedef uint8_t esp_bd_addr_t[ESP_BD_ADDR_LEN]; typedef uint8_t esp_blufi_bd_addr_t[ESP_BLUFI_BD_ADDR_LEN];
/** /**
* @brief BLUFI callback parameters union * @brief BLUFI callback parameters union
@ -147,7 +147,7 @@ typedef union {
* @brief ESP_BLUFI_EVENT_CONNECT * @brief ESP_BLUFI_EVENT_CONNECT
*/ */
struct blufi_connect_evt_param { struct blufi_connect_evt_param {
esp_bd_addr_t remote_bda; /*!< Blufi Remote bluetooth device address */ esp_blufi_bd_addr_t remote_bda; /*!< Blufi Remote bluetooth device address */
uint8_t server_if; /*!< server interface */ uint8_t server_if; /*!< server interface */
uint16_t conn_id; /*!< Connection id */ uint16_t conn_id; /*!< Connection id */
} connect; /*!< Blufi callback param of ESP_BLUFI_EVENT_CONNECT */ } connect; /*!< Blufi callback param of ESP_BLUFI_EVENT_CONNECT */
@ -156,7 +156,7 @@ typedef union {
* @brief ESP_BLUFI_EVENT_DISCONNECT * @brief ESP_BLUFI_EVENT_DISCONNECT
*/ */
struct blufi_disconnect_evt_param { struct blufi_disconnect_evt_param {
esp_bd_addr_t remote_bda; /*!< Blufi Remote bluetooth device address */ esp_blufi_bd_addr_t remote_bda; /*!< Blufi Remote bluetooth device address */
} disconnect; /*!< Blufi callback param of ESP_BLUFI_EVENT_DISCONNECT */ } disconnect; /*!< Blufi callback param of ESP_BLUFI_EVENT_DISCONNECT */
/* ESP_BLUFI_EVENT_REQ_WIFI_CONNECT */ /* No callback param */ /* ESP_BLUFI_EVENT_REQ_WIFI_CONNECT */ /* No callback param */

View File

@ -295,7 +295,7 @@ static void blufi_profile_cb(tBTA_GATTS_EVT event, tBTA_GATTS *p_data)
BT_BD_ADDR_HEX(p_data->conn.remote_bda), p_data->conn.server_if, BT_BD_ADDR_HEX(p_data->conn.remote_bda), p_data->conn.server_if,
p_data->conn.reason, p_data->conn.conn_id); p_data->conn.reason, p_data->conn.conn_id);
memcpy(blufi_env.remote_bda, p_data->conn.remote_bda, sizeof(esp_bd_addr_t)); memcpy(blufi_env.remote_bda, p_data->conn.remote_bda, ESP_BLUFI_BD_ADDR_LEN);
blufi_env.conn_id = p_data->conn.conn_id; blufi_env.conn_id = p_data->conn.conn_id;
blufi_env.is_connected = true; blufi_env.is_connected = true;
blufi_env.recv_seq = blufi_env.send_seq = 0; blufi_env.recv_seq = blufi_env.send_seq = 0;
@ -303,7 +303,7 @@ static void blufi_profile_cb(tBTA_GATTS_EVT event, tBTA_GATTS *p_data)
msg.sig = BTC_SIG_API_CB; msg.sig = BTC_SIG_API_CB;
msg.pid = BTC_PID_BLUFI; msg.pid = BTC_PID_BLUFI;
msg.act = ESP_BLUFI_EVENT_BLE_CONNECT; msg.act = ESP_BLUFI_EVENT_BLE_CONNECT;
memcpy(param.connect.remote_bda, p_data->conn.remote_bda, sizeof(esp_bd_addr_t)); memcpy(param.connect.remote_bda, p_data->conn.remote_bda, ESP_BLUFI_BD_ADDR_LEN);
param.connect.conn_id = BTC_GATT_GET_CONN_ID(p_data->conn.conn_id); param.connect.conn_id = BTC_GATT_GET_CONN_ID(p_data->conn.conn_id);
conn_id = param.connect.conn_id; conn_id = param.connect.conn_id;
server_if = p_data->conn.server_if; server_if = p_data->conn.server_if;
@ -320,7 +320,7 @@ static void blufi_profile_cb(tBTA_GATTS_EVT event, tBTA_GATTS *p_data)
BT_BD_ADDR_HEX(p_data->conn.remote_bda), p_data->conn.server_if, BT_BD_ADDR_HEX(p_data->conn.remote_bda), p_data->conn.server_if,
p_data->conn.reason, p_data->conn.conn_id); p_data->conn.reason, p_data->conn.conn_id);
memcpy(blufi_env.remote_bda, p_data->conn.remote_bda, sizeof(esp_bd_addr_t)); memcpy(blufi_env.remote_bda, p_data->conn.remote_bda, ESP_BLUFI_BD_ADDR_LEN);
blufi_env.conn_id = p_data->conn.conn_id; blufi_env.conn_id = p_data->conn.conn_id;
blufi_env.recv_seq = blufi_env.send_seq = 0; blufi_env.recv_seq = blufi_env.send_seq = 0;
blufi_env.sec_mode = 0x0; blufi_env.sec_mode = 0x0;
@ -334,7 +334,7 @@ static void blufi_profile_cb(tBTA_GATTS_EVT event, tBTA_GATTS *p_data)
msg.sig = BTC_SIG_API_CB; msg.sig = BTC_SIG_API_CB;
msg.pid = BTC_PID_BLUFI; msg.pid = BTC_PID_BLUFI;
msg.act = ESP_BLUFI_EVENT_BLE_DISCONNECT; msg.act = ESP_BLUFI_EVENT_BLE_DISCONNECT;
memcpy(param.disconnect.remote_bda, p_data->conn.remote_bda, sizeof(esp_bd_addr_t)); memcpy(param.disconnect.remote_bda, p_data->conn.remote_bda, ESP_BLUFI_BD_ADDR_LEN);
btc_transfer_context(&msg, &param, sizeof(esp_blufi_cb_param_t), NULL); btc_transfer_context(&msg, &param, sizeof(esp_blufi_cb_param_t), NULL);
break; break;
} }

View File

@ -256,7 +256,7 @@ esp_blufi_gap_event(struct ble_gap_event *event, void *arg)
rc = ble_gap_conn_find(event->connect.conn_handle, &desc); rc = ble_gap_conn_find(event->connect.conn_handle, &desc);
assert(rc == 0); assert(rc == 0);
memcpy(param.connect.remote_bda, desc.peer_id_addr.val, sizeof(esp_bd_addr_t)); memcpy(param.connect.remote_bda, desc.peer_id_addr.val, ESP_BLUFI_BD_ADDR_LEN);
param.connect.conn_id = event->connect.conn_handle; param.connect.conn_id = event->connect.conn_handle;
/* save connection handle */ /* save connection handle */
@ -270,7 +270,7 @@ esp_blufi_gap_event(struct ble_gap_event *event, void *arg)
return 0; return 0;
case BLE_GAP_EVENT_DISCONNECT: case BLE_GAP_EVENT_DISCONNECT:
ESP_LOGI(TAG, "disconnect; reason=%d\n", event->disconnect.reason); ESP_LOGI(TAG, "disconnect; reason=%d\n", event->disconnect.reason);
memcpy(blufi_env.remote_bda, event->disconnect.conn.peer_id_addr.val, sizeof(esp_bd_addr_t)); memcpy(blufi_env.remote_bda, event->disconnect.conn.peer_id_addr.val, ESP_BLUFI_BD_ADDR_LEN);
blufi_env.is_connected = false; blufi_env.is_connected = false;
blufi_env.recv_seq = blufi_env.send_seq = 0; blufi_env.recv_seq = blufi_env.send_seq = 0;
blufi_env.sec_mode = 0x0; blufi_env.sec_mode = 0x0;
@ -287,7 +287,7 @@ esp_blufi_gap_event(struct ble_gap_event *event, void *arg)
msg.sig = BTC_SIG_API_CB; msg.sig = BTC_SIG_API_CB;
msg.pid = BTC_PID_BLUFI; msg.pid = BTC_PID_BLUFI;
msg.act = ESP_BLUFI_EVENT_BLE_DISCONNECT; msg.act = ESP_BLUFI_EVENT_BLE_DISCONNECT;
memcpy(param.disconnect.remote_bda, event->disconnect.conn.peer_id_addr.val, sizeof(esp_bd_addr_t)); memcpy(param.disconnect.remote_bda, event->disconnect.conn.peer_id_addr.val, ESP_BLUFI_BD_ADDR_LEN);
btc_transfer_context(&msg, &param, sizeof(esp_blufi_cb_param_t), NULL); btc_transfer_context(&msg, &param, sizeof(esp_blufi_cb_param_t), NULL);
return 0; return 0;

View File

@ -22,7 +22,7 @@
#if (defined BTC_HD_INCLUDED && BTC_HD_INCLUDED == TRUE) #if (defined BTC_HD_INCLUDED && BTC_HD_INCLUDED == TRUE)
esp_err_t esp_bt_hid_device_register_callback(esp_hd_cb_t *callback) esp_err_t esp_bt_hid_device_register_callback(esp_hd_cb_t callback)
{ {
ESP_BLUEDROID_STATUS_CHECK(ESP_BLUEDROID_STATUS_ENABLED); ESP_BLUEDROID_STATUS_CHECK(ESP_BLUEDROID_STATUS_ENABLED);

View File

@ -22,7 +22,7 @@
#if (defined BTC_HH_INCLUDED && BTC_HH_INCLUDED == TRUE) #if (defined BTC_HH_INCLUDED && BTC_HH_INCLUDED == TRUE)
esp_err_t esp_bt_hid_host_register_callback(esp_hh_cb_t *callback) esp_err_t esp_bt_hid_host_register_callback(esp_hh_cb_t callback)
{ {
ESP_BLUEDROID_STATUS_CHECK(ESP_BLUEDROID_STATUS_ENABLED); ESP_BLUEDROID_STATUS_CHECK(ESP_BLUEDROID_STATUS_ENABLED);

View File

@ -27,7 +27,8 @@ static const uint8_t UUID_SPP[16] = {0x00, 0x00, 0x11, 0x01, 0x00, 0x00, 0x10, 0
0x80, 0x00, 0x00, 0x80, 0x5F, 0x9B, 0x34, 0xFB 0x80, 0x00, 0x00, 0x80, 0x5F, 0x9B, 0x34, 0xFB
}; };
static tSDP_UUID sdp_uuid; static tSDP_UUID sdp_uuid;
esp_err_t esp_spp_register_callback(esp_spp_cb_t *callback)
esp_err_t esp_spp_register_callback(esp_spp_cb_t callback)
{ {
ESP_BLUEDROID_STATUS_CHECK(ESP_BLUEDROID_STATUS_ENABLED); ESP_BLUEDROID_STATUS_CHECK(ESP_BLUEDROID_STATUS_ENABLED);

View File

@ -256,7 +256,7 @@ typedef union {
* @param event: Event type * @param event: Event type
* @param param: Point to callback parameter, currently is union type * @param param: Point to callback parameter, currently is union type
*/ */
typedef void (esp_hd_cb_t)(esp_hidd_cb_event_t event, esp_hidd_cb_param_t *param); typedef void (*esp_hd_cb_t)(esp_hidd_cb_event_t event, esp_hidd_cb_param_t *param);
/** /**
* @brief This function is called to init callbacks with HID device module. * @brief This function is called to init callbacks with HID device module.

View File

@ -287,7 +287,7 @@ typedef union {
* @param event: Event type * @param event: Event type
* @param param: Point to callback parameter, currently is union type * @param param: Point to callback parameter, currently is union type
*/ */
typedef void (esp_hh_cb_t)(esp_hidh_cb_event_t event, esp_hidh_cb_param_t *param); typedef void (*esp_hh_cb_t)(esp_hidh_cb_event_t event, esp_hidh_cb_param_t *param);
/** /**
* @brief This function is called to init callbacks with HID host module. * @brief This function is called to init callbacks with HID host module.

View File

@ -205,7 +205,7 @@ typedef union {
* @param event: Event type * @param event: Event type
* @param param: Point to callback parameter, currently is union type * @param param: Point to callback parameter, currently is union type
*/ */
typedef void (esp_spp_cb_t)(esp_spp_cb_event_t event, esp_spp_cb_param_t *param); typedef void (*esp_spp_cb_t)(esp_spp_cb_event_t event, esp_spp_cb_param_t *param);
/** /**
* @brief This function is called to init callbacks with SPP module. * @brief This function is called to init callbacks with SPP module.

View File

@ -77,7 +77,7 @@ typedef void (bt_hid_copy_cb_t)(btc_msg_t *msg, void *p_dest, void *p_src);
static inline void btc_hd_cb_to_app(esp_hidd_cb_event_t event, esp_hidd_cb_param_t *param) static inline void btc_hd_cb_to_app(esp_hidd_cb_event_t event, esp_hidd_cb_param_t *param)
{ {
esp_hd_cb_t *btc_hd_cb = (esp_hd_cb_t *)btc_profile_cb_get(BTC_PID_HD); esp_hd_cb_t btc_hd_cb = (esp_hd_cb_t)btc_profile_cb_get(BTC_PID_HD);
if (btc_hd_cb) { if (btc_hd_cb) {
btc_hd_cb(event, param); btc_hd_cb(event, param);
} }

View File

@ -66,7 +66,7 @@ static bdstr_t bdstr;
static inline void btc_hh_cb_to_app(esp_hidh_cb_event_t event, esp_hidh_cb_param_t *param) static inline void btc_hh_cb_to_app(esp_hidh_cb_event_t event, esp_hidh_cb_param_t *param)
{ {
esp_hh_cb_t *btc_hh_cb = (esp_hh_cb_t *)btc_profile_cb_get(BTC_PID_HH); esp_hh_cb_t btc_hh_cb = (esp_hh_cb_t)btc_profile_cb_get(BTC_PID_HH);
if (btc_hh_cb) { if (btc_hh_cb) {
btc_hh_cb(event, param); btc_hh_cb(event, param);
} }

View File

@ -266,7 +266,7 @@ static void spp_free_slot(spp_slot_t *slot)
static inline void btc_spp_cb_to_app(esp_spp_cb_event_t event, esp_spp_cb_param_t *param) static inline void btc_spp_cb_to_app(esp_spp_cb_event_t event, esp_spp_cb_param_t *param)
{ {
esp_spp_cb_t *btc_spp_cb = (esp_spp_cb_t *)btc_profile_cb_get(BTC_PID_SPP); esp_spp_cb_t btc_spp_cb = (esp_spp_cb_t)btc_profile_cb_get(BTC_PID_SPP);
if (btc_spp_cb) { if (btc_spp_cb) {
btc_spp_cb(event, param); btc_spp_cb(event, param);
} }

View File

@ -16,39 +16,8 @@ README.rst:line: WARNING: Duplicate C++ declaration, also defined at api-guides/
Declaration is '.. cpp:function:: esp_err_t ulp_run (uint32_t entry_point)'. Declaration is '.. cpp:function:: esp_err_t ulp_run (uint32_t entry_point)'.
esp_ble_mesh_defs.inc:line: WARNING: Duplicate C++ declaration, also defined at api-reference/bluetooth/esp-ble-mesh:line. esp_ble_mesh_defs.inc:line: WARNING: Duplicate C++ declaration, also defined at api-reference/bluetooth/esp-ble-mesh:line.
Declaration is '.. cpp:member:: uint16_t model_id'. Declaration is '.. cpp:member:: uint16_t model_id'.
esp_bt_defs.inc:line: WARNING: Duplicate C declaration, also defined at api-reference/bluetooth/esp_blufi:line. rmt_encoder.inc:line: WARNING: Duplicate C++ declaration, also defined at api-reference/peripherals/rmt:line.
Declaration is '.. c:macro:: ESP_BD_ADDR_LEN'. Declaration is '.. cpp:type:: struct rmt_encoder_t rmt_encoder_t'.
esp_bt_defs.inc:line: WARNING: Duplicate C++ declaration, also defined at api-reference/bluetooth/esp_blufi:line.
Declaration is '.. cpp:type:: uint8_t esp_bd_addr_t [6]'.
esp_spp_api.inc:line: WARNING: Error in type declaration.
If typedef-like declaration:
Type must be either just a name or a typedef-like declaration.
If just a name:
Error in declarator or parameters-and-qualifiers
Invalid C++ declaration: Expected identifier in nested name, got keyword: void [error at 4]
void() esp_spp_cb_t (esp_spp_cb_event_t event, esp_spp_cb_param_t *param)
----^
If typedef-like declaration:
Error in declarator
If declarator-id with parameters-and-qualifiers:
Invalid C++ declaration: Expected identifier in nested name. [error at 4]
void() esp_spp_cb_t (esp_spp_cb_event_t event, esp_spp_cb_param_t *param)
----^
If parenthesis in noptr-declarator:
Error in declarator or parameters-and-qualifiers
If pointer to member declarator:
Invalid C++ declaration: Expected identifier in nested name. [error at 5]
void() esp_spp_cb_t (esp_spp_cb_event_t event, esp_spp_cb_param_t *param)
-----^
If declarator-id:
Invalid C++ declaration: Expected identifier in nested name. [error at 5]
void() esp_spp_cb_t (esp_spp_cb_event_t event, esp_spp_cb_param_t *param)
-----^
If type alias or template alias:
Invalid C++ declaration: Expected identifier in nested name, got keyword: void [error at 4]
void() esp_spp_cb_t (esp_spp_cb_event_t event, esp_spp_cb_param_t *param)
----^
spi_master.inc:line: WARNING: Duplicate C++ declaration, also defined at api-reference/peripherals/spi_master:line. spi_master.inc:line: WARNING: Duplicate C++ declaration, also defined at api-reference/peripherals/spi_master:line.
Declaration is '.. cpp:type:: struct spi_transaction_t spi_transaction_t'. Declaration is '.. cpp:type:: struct spi_transaction_t spi_transaction_t'.
spi_slave.inc:line: WARNING: Duplicate C++ declaration, also defined at api-reference/peripherals/spi_slave:line. spi_slave.inc:line: WARNING: Duplicate C++ declaration, also defined at api-reference/peripherals/spi_slave:line.