2016-11-05 08:40:07 -04:00
|
|
|
#ifndef __ESP_BT_DEFS_H__
|
|
|
|
#define __ESP_BT_DEFS_H__
|
2016-10-26 08:19:48 -04:00
|
|
|
|
2016-11-15 07:56:15 -05:00
|
|
|
#include <stdint.h>
|
|
|
|
#include <stdbool.h>
|
|
|
|
|
|
|
|
/* Status Return Value */
|
|
|
|
typedef enum {
|
|
|
|
ESP_BT_STATUS_SUCCESS = 0, /* Successful operation. */
|
|
|
|
ESP_BT_STATUS_FAILURE = 1, /* Generic failure. */
|
|
|
|
ESP_BT_STATUS_PENDING = 2, /* API cannot be completed right now */
|
|
|
|
ESP_BT_STATUS_BUSY = 3,
|
|
|
|
ESP_BT_STATUS_NO_RESOURCES = 4,
|
|
|
|
ESP_BT_STATUS_WRONG_MODE = 5,
|
|
|
|
} esp_bt_status_t;
|
2016-09-26 09:37:39 -04:00
|
|
|
|
2016-10-31 06:55:54 -04:00
|
|
|
#define ESP_BLE_CONN_PARAM_UNDEF 0xffff /* use this value when a specific value not to be overwritten */
|
2016-10-21 02:16:01 -04:00
|
|
|
|
2016-11-15 07:56:15 -05:00
|
|
|
#define ESP_BLE_IS_VALID_PARAM(x, min, max) (((x) >= (min) && (x) <= (max)) || ((x) == ESP_BLE_CONN_PARAM_UNDEF))
|
|
|
|
|
|
|
|
typedef struct {
|
|
|
|
#define ESP_UUID_LEN_16 2
|
|
|
|
#define ESP_UUID_LEN_32 4
|
|
|
|
#define ESP_UUID_LEN_128 16
|
|
|
|
uint16_t len;
|
|
|
|
union {
|
|
|
|
uint16_t uuid16;
|
|
|
|
uint32_t uuid32;
|
|
|
|
uint8_t uuid128[ESP_UUID_LEN_128];
|
|
|
|
} uuid;
|
|
|
|
}esp_bt_uuid_t; /* tBT_UUID in "bt_types.h" */
|
|
|
|
|
|
|
|
typedef enum {
|
|
|
|
ESP_BT_DEVICE_TYPE_BREDR = 0x01,
|
|
|
|
ESP_BT_DEVICE_TYPE_BLE = 0x02,
|
|
|
|
ESP_BT_DEVICE_TYPE_DUMO = 0x03,
|
|
|
|
} esp_bt_dev_type_t;
|
|
|
|
|
|
|
|
#define ESP_BD_ADDR_LEN 6
|
|
|
|
typedef uint8_t esp_bd_addr_t[ESP_BD_ADDR_LEN]; /* BD_ADDR in bt_types.h */
|
2016-10-21 02:16:01 -04:00
|
|
|
|
2016-10-26 08:19:48 -04:00
|
|
|
/// Own BD address source of the device
|
2016-11-15 07:56:15 -05:00
|
|
|
typedef enum {
|
2016-10-26 08:19:48 -04:00
|
|
|
/// Public Address
|
2016-11-15 07:56:15 -05:00
|
|
|
BD_ADDR_PUBLIC,
|
2016-10-26 08:19:48 -04:00
|
|
|
/// Provided random address
|
2016-11-15 07:56:15 -05:00
|
|
|
BD_ADDR_PROVIDED_RND,
|
2016-10-26 08:19:48 -04:00
|
|
|
/// Provided static random address
|
2016-11-15 07:56:15 -05:00
|
|
|
BD_ADDR_GEN_STATIC_RND,
|
2016-10-26 08:19:48 -04:00
|
|
|
/// Generated resolvable private random address
|
2016-11-15 07:56:15 -05:00
|
|
|
BD_ADDR_GEN_RSLV,
|
2016-10-26 08:19:48 -04:00
|
|
|
/// Generated non-resolvable private random address
|
2016-11-15 07:56:15 -05:00
|
|
|
BD_ADDR_GEN_NON_RSLV,
|
2016-10-26 08:19:48 -04:00
|
|
|
/// Provided Reconnection address
|
2016-11-15 07:56:15 -05:00
|
|
|
BD_ADDR_PROVIDED_RECON,
|
|
|
|
} esp_bd_addr_type_t;
|
2016-10-21 02:16:01 -04:00
|
|
|
|
2016-11-15 07:56:15 -05:00
|
|
|
typedef enum {
|
|
|
|
BLE_ADDR_TYPE_PUBLIC = 0x00,
|
|
|
|
BLE_ADDR_TYPE_RANDOM = 0x01,
|
|
|
|
BLE_ADDR_TYPE_RPA_PUBLIC = 0x02,
|
|
|
|
BLE_ADDR_TYPE_RPA_RANDOM = 0x03,
|
|
|
|
} esp_ble_addr_type_t;
|
2016-09-26 09:37:39 -04:00
|
|
|
|
2016-11-15 07:56:15 -05:00
|
|
|
#define APP_ID_MIN 0x0000
|
|
|
|
#define APP_ID_MAX 0x7fff
|
2016-09-26 09:37:39 -04:00
|
|
|
|
2016-11-15 07:56:15 -05:00
|
|
|
typedef void (* esp_profile_cb_t)(uint32_t event, void *param);
|
2016-10-26 08:19:48 -04:00
|
|
|
|
2016-11-15 07:56:15 -05:00
|
|
|
#define API_BLE_ISVALID_PARAM(x, min, max) (((x) >= (min) && (x) <= (max)) || ((x) == ESP_BLE_CONN_PARAM_UNDEF))
|
2016-10-26 08:19:48 -04:00
|
|
|
|
2016-11-05 08:40:07 -04:00
|
|
|
#endif ///__ESP_BT_DEFS_H__
|