btc_msg_t msg;
btc_ble_gattc_args_t arg;
+ if (app_id < ESP_APP_ID_MIN || app_id > ESP_APP_ID_MAX) {
+ return ESP_ERR_INVALID_ARG;
+ }
+
msg.sig = BTC_SIG_API_CALL;
msg.pid = BTC_PID_GATTC;
msg.act = BTC_GATTC_ACT_APP_REGISTER;
BLE_ADDR_TYPE_RPA_RANDOM = 0x03,
} esp_ble_addr_type_t;
-#define APP_ID_MIN 0x0000
-#define APP_ID_MAX 0x7fff
+#define ESP_APP_ID_MIN 0x0000
+#define ESP_APP_ID_MAX 0x7fff
typedef void (* esp_profile_cb_t)(uint32_t event, void *param);
-#define API_BLE_ISVALID_PARAM(x, min, max) (((x) >= (min) && (x) <= (max)) || ((x) == ESP_BLE_CONN_PARAM_UNDEF))
-
#endif ///__ESP_BT_DEFS_H__
disc_mode = BTA_DM_BLE_NON_DISCOVERABLE;
}
- if (!API_BLE_ISVALID_PARAM(ble_adv_params->adv_int_min, BTM_BLE_ADV_INT_MIN, BTM_BLE_ADV_INT_MAX) ||
- !API_BLE_ISVALID_PARAM(ble_adv_params->adv_int_max, BTM_BLE_ADV_INT_MIN, BTM_BLE_ADV_INT_MAX)) {
+ if (!BLE_ISVALID_PARAM(ble_adv_params->adv_int_min, BTM_BLE_ADV_INT_MIN, BTM_BLE_ADV_INT_MAX) ||
+ !BLE_ISVALID_PARAM(ble_adv_params->adv_int_max, BTM_BLE_ADV_INT_MIN, BTM_BLE_ADV_INT_MAX)) {
LOG_ERROR("Invalid advertisting interval parameters.\n");
return ;
}
static void btc_ble_set_scan_params(esp_ble_scan_params_t *scan_params,
tBLE_SCAN_PARAM_SETUP_CBACK scan_param_setup_cback)
{
- if (API_BLE_ISVALID_PARAM(scan_params->scan_interval, BTM_BLE_SCAN_INT_MIN, BTM_BLE_SCAN_INT_MAX) &&
- API_BLE_ISVALID_PARAM(scan_params->scan_window, BTM_BLE_SCAN_WIN_MIN, BTM_BLE_SCAN_WIN_MAX) &&
+ if (BLE_ISVALID_PARAM(scan_params->scan_interval, BTM_BLE_SCAN_INT_MIN, BTM_BLE_SCAN_INT_MAX) &&
+ BLE_ISVALID_PARAM(scan_params->scan_window, BTM_BLE_SCAN_WIN_MIN, BTM_BLE_SCAN_WIN_MAX) &&
(scan_params->scan_type == BTM_BLE_SCAN_MODE_ACTI || scan_params->scan_type == BTM_BLE_SCAN_MODE_PASS)) {
BTA_DmSetBleScanFilterParams(0 /*client_if*/,
scan_params->scan_interval,
#include "esp_bt_defs.h"
#include "esp_gap_ble_api.h"
+#define BLE_ISVALID_PARAM(x, min, max) (((x) >= (min) && (x) <= (max)) || ((x) == ESP_BLE_CONN_PARAM_UNDEF))
+
typedef enum {
BTC_GAP_BLE_ACT_CFG_ADV_DATA = 0,
BTC_GAP_BLE_ACT_SET_SCAN_PARAM,