component/bt : add cpp extern c

1. add cpp extern c
2. retab tab to 4 space
This commit is contained in:
Tian Hao 2016-12-08 14:26:19 +08:00
parent e0e6966be0
commit 4c6ccf1c23
7 changed files with 58 additions and 7 deletions

View file

@ -21,6 +21,10 @@
#include "bta_gatt_api.h"
#include "esp_err.h"
#ifdef __cplusplus
extern "C" {
#endif
#define ESP_BLUFI_RECV_DATA_LEN_MAX (64+1)
#define ESP_BLUFI_EVENT_INIT_FINISH 0
@ -112,6 +116,8 @@ esp_err_t esp_blufi_profile_init(void);
*/
esp_err_t esp_blufi_profile_deinit(void);
#ifdef __cplusplus
}
#endif
#endif /* _ESP_BLUFI_API_ */

View file

@ -18,6 +18,10 @@
#include <stdint.h>
#include <stdbool.h>
#ifdef __cplusplus
extern "C" {
#endif
/// Status Return Value
typedef enum {
ESP_BT_STATUS_SUCCESS = 0, /* Successful operation. */
@ -99,4 +103,8 @@ typedef enum {
*/
typedef void (* esp_profile_cb_t)(uint32_t event, void *param);
#endif ///__ESP_BT_DEFS_H__
#ifdef __cplusplus
}
#endif
#endif /* __ESP_BT_DEFS_H__ */

View file

@ -18,6 +18,10 @@
#include "btc_main.h"
#include "esp_err.h"
#ifdef __cplusplus
extern "C" {
#endif
/**
* @brief Enable bluetooth, must after esp_init_bluetooth()
*
@ -54,5 +58,8 @@ esp_err_t esp_init_bluetooth(void);
*/
esp_err_t esp_deinit_bluetooth(void);
#ifdef __cplusplus
}
#endif
#endif /* __ESP_BT_MAIN_H__ */

View file

@ -21,6 +21,10 @@
#include "esp_err.h"
#include "esp_bt_defs.h"
#ifdef __cplusplus
extern "C" {
#endif
/// GAP BLE callback event type
typedef enum {
ESP_GAP_BLE_ADV_DATA_SET_COMPLETE_EVT = 0, /*!< When advertising data set complete, the event comes */
@ -421,4 +425,8 @@ esp_err_t esp_ble_gap_set_device_name(const char *name);
*/
uint8_t *esp_ble_resolve_adv_data(uint8_t *adv_data, uint8_t type, uint8_t *length);
#ifdef __cplusplus
}
#endif
#endif /* __ESP_GAP_BLE_API_H__ */

View file

@ -17,6 +17,10 @@
#include "esp_bt_defs.h"
#ifdef __cplusplus
extern "C" {
#endif
/// Attribute write data type from the client
typedef enum {
ESP_GATT_PREP_WRITE_CANCEL = 0x00, /*!< Prepare write cancel */
@ -109,11 +113,11 @@ typedef struct {
* @brief Gatt authentication request type
*/
typedef enum {
ESP_GATT_AUTH_REQ_NONE = 0,
ESP_GATT_AUTH_REQ_NO_MITM = 1, /* unauthenticated encryption */
ESP_GATT_AUTH_REQ_MITM = 2, /* authenticated encryption */
ESP_GATT_AUTH_REQ_SIGNED_NO_MITM = 3,
ESP_GATT_AUTH_REQ_SIGNED_MITM = 4,
ESP_GATT_AUTH_REQ_NONE = 0,
ESP_GATT_AUTH_REQ_NO_MITM = 1, /* unauthenticated encryption */
ESP_GATT_AUTH_REQ_MITM = 2, /* authenticated encryption */
ESP_GATT_AUTH_REQ_SIGNED_NO_MITM = 3,
ESP_GATT_AUTH_REQ_SIGNED_MITM = 4,
} esp_gatt_auth_req_t;
/**
@ -170,4 +174,8 @@ typedef enum {
typedef uint32_t esp_gatt_if_t; /*!< Gatt interface type, different application on GATT client use different gatt_if */
#ifdef __cplusplus
}
#endif
#endif /* __ESP_GATT_DEFS_H__ */

7
components/bt/bluedroid/api/include/esp_gattc_api.h Executable file → Normal file
View file

@ -20,6 +20,10 @@
#include "esp_gatt_defs.h"
#include "esp_err.h"
#ifdef __cplusplus
extern "C" {
#endif
/// GATT Client callback function events
typedef enum {
ESP_GATTC_REG_EVT = 0, /*!< When GATT client is registered, the event comes */
@ -572,5 +576,8 @@ esp_gatt_status_t esp_ble_gattc_unregister_for_notify (esp_gatt_if_t gatt_if,
esp_gatt_srvc_id_t *srvc_id,
esp_gatt_id_t *char_id);
#ifdef __cplusplus
}
#endif
#endif /* __ESP_GATTC_API_H__ */

View file

@ -21,6 +21,10 @@
#include "bta_gatt_api.h"
#include "esp_err.h"
#ifdef __cplusplus
extern "C" {
#endif
/// GATT Server callback function events
typedef enum {
ESP_GATTS_REG_EVT = 0, /*!< When register application id, the event comes */
@ -458,5 +462,8 @@ esp_err_t esp_ble_gatts_open(esp_gatt_if_t gatt_if, esp_bd_addr_t remote_bda, bo
*/
esp_err_t esp_ble_gatts_close(uint16_t conn_id);
#ifdef __cplusplus
}
#endif
#endif /* __ESP_GATTS_API_H__ */