+++ /dev/null
-// Copyright 2015-2016 Espressif Systems (Shanghai) PTE LTD
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-#include <stdlib.h> // standard library
-#include <string.h>
-
-#include "esp_sec_api.h"
-
-
-extern void srand (unsigned int seed);
-extern int random (void);
-
-/// Application Security Environment Structure
-tAPP_SEC_ENV app_sec_env;
-
-
-/*******************************************************************************
-**
-** Function app_ble_sec_gen_tk
-**
-** Description This function is called to generate the ble tk
-**
-** Returns the generate tk value
-**
-*******************************************************************************/
-UINT32 app_ble_sec_gen_tk(void)
-{
- // Generate a PIN Code (Between 100000 and 999999)
- return (100000 + (random() % 900000));
-}
-
-/*******************************************************************************
-**
-** Function app_ble_sec_gen_ltk
-**
-** Description This function is called to generate the ble ltk
-**
-** Returns NULL
-**
-*******************************************************************************/
-void app_ble_sec_gen_ltk(UINT8 key_size)
-{
- // Counter
- UINT8 i;
- app_sec_env.key_size = key_size;
-
- // Randomly generate the LTK and the Random Number
- for (i = 0; i < RAND_NB_LEN; i++) {
- app_sec_env.rand_nb.nb[i] = random() % 256;
- }
-
- // Randomly generate the end of the LTK
- for (i = 0; i < SEC_KEY_LEN; i++) {
- app_sec_env.ltk.key[i] = (((key_size) < (16 - i)) ? 0 : random() % 256);
- }
-
- // Randomly generate the EDIV
- app_sec_env.ediv = random() % 65536;
-}
-
-
-/*******************************************************************************
-**
-** Function app_ble_sec_init
-**
-** Description This function is init the security env and function
-**
-** Returns NULL
-**
-*******************************************************************************/
-void app_ble_sec_init()
-{
- // Reset Security Environment
- memset(&app_sec_env, 0, sizeof(app_sec_env));
-}
-
-
-/*******************************************************************************
-**
-** Function app_ble_security_start
-**
-** Description This function is called by the slave when the seurity start
-**
-** Returns NULL
-**
-*******************************************************************************/
-void app_ble_security_start(void)
-{
-
-}
-
-
-
-
-
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_gap_args_t), NULL) == BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
}
-esp_err_t esp_ble_gap_set_device_name(char *name)
+esp_err_t esp_ble_gap_set_device_name(const char *name)
{
btc_msg_t msg;
btc_ble_gap_args_t arg;
+++ /dev/null
-// Copyright 2015-2016 Espressif Systems (Shanghai) PTE LTD
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-#include "esp_gap_bt_api.h"
-#include "bta_api.h"
-#include "bt_trace.h"
-
**
** @brief Close a connection to a GATT server.
**
-** @param[in] conn_id: connectino ID to be closed.
+** @param[in] conn_id: connection ID to be closed.
**
** @return ESP_OK - success, other - failed
**
** @brief This function is called to read a service's characteristics of
** the given characteritisc ID.UTH_REQ_NO_SCATTERNET
**
-** @param[in] conn_id - connectino ID.
-** @param[in] srvc_id - serivcie ID.
+** @param[in] conn_id - connection ID.
+** @param[in] srvc_id - service ID.
** @param[in] char_id - characteritic ID to read.
** @param[in] auth_req - authenticate request type
**
** @brief This function is called to read a characteristics descriptor.
**
** @param[in] conn_id - connection ID.
-** @param[in] srvc_id - serivcie ID.
+** @param[in] srvc_id - service ID.
** @param[in] descr_id - characteritic descriptor ID to read.
** @param[in] auth_req - authenticate request type
**
** @brief This function is called to write characteristic value.
**
** @param[in] conn_id - connection ID.
-** @param[in] srvc_id - serivcie ID.
+** @param[in] srvc_id - service ID.
** @param[in] char_id - characteristic ID to write.
** @param[in] value_len: length of the value to be written.
** @param[in] value - the value to be written.
** @brief This function is called to write characteristic descriptor value.
**
** @param[in] conn_id - connection ID
-** @param[in] srvc_id - serivcie ID.
+** @param[in] srvc_id - service ID.
** @param[in] char_id - characteristic ID.
** @param[in] descr_id - characteristic descriptor ID to write.
** @param[in] value_len: length of the value to be written.
}
-esp_err_t esp_ble_gatts_add_include_service(uint16_t service_handle, uint16_t included_service_handle)
+esp_err_t esp_ble_gatts_add_included_service(uint16_t service_handle, uint16_t included_service_handle)
{
btc_msg_t msg;
btc_ble_gatts_args_t arg;
+++ /dev/null
-// Copyright 2015-2016 Espressif Systems (Shanghai) PTE LTD
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-#include "esp_sdp_api.h"
-
-
-esp_err_t esp_bt_sdp_enable(bt_sdp_cb_t *cback)
-{
- tBTA_SDP_STATUS status = BTA_SdpEnable((tBTA_SDP_DM_CBACK *)cback);
-
- return (status == BTA_SDP_SUCCESS) ? ESP_OK : ESP_FAIL;
-}
-
-esp_err_t esp_bt_sdp_search(esp_bd_addr_t bd_addr, esp_bt_uuid_t *uuid)
-{
- tBTA_SDP_STATUS status = BTA_SdpSearch(bd_addr, (tSDP_UUID *)uuid);
- return (status == BTA_SDP_SUCCESS) ? ESP_OK : ESP_FAIL;
-}
-
-esp_err_t esp_bt_sdp_create_record_by_user(void *user_data)
-{
- tBTA_SDP_STATUS status = BTA_SdpCreateRecordByUser(user_data);
- return (status == BTA_SDP_SUCCESS) ? ESP_OK : ESP_FAIL;
-}
-
-esp_err_t esp_bt_sdp_remove_record_by_user(void *user_data)
-{
- tBTA_SDP_STATUS status = BTA_SdpRemoveRecordByUser(user_data);
- return (status == BTA_SDP_SUCCESS) ? ESP_OK : ESP_FAIL;
-}
-
-
-/**********************************************************************************************/
-/**********************************************************************************************/
-/* API into SDP for local service database updates */
-/* these APIs are indended to be called in callback function in the context of stack task,
- * to handle BT_SDP_CREATE_RECORD_USER_EVT and BT_SDP_REMOVE_RECORD_USER_EVT
- */
-uint32_t esp_bt_sdp_create_record(void)
-{
- return SDP_CreateRecord();
-}
-
-bool esp_bt_sdp_delete_record(uint32_t handle)
-{
- return SDP_DeleteRecord(handle);
-}
-
-int32_t esp_bt_sdp_read_record(uint32_t handle, uint8_t *data, int32_t *data_len)
-{
- return SDP_ReadRecord(handle, data, data_len);
-}
-
-bool esp_bt_sdp_add_attribute (uint32_t handle, uint16_t attr_id,
- uint8_t attr_type, uint32_t attr_len,
- uint8_t *p_val)
-{
- return SDP_AddAttribute(handle, attr_id, attr_type, attr_len, p_val);
-}
-
-bool esp_bt_sdp_add_sequence (uint32_t handle, uint16_t attr_id,
- uint16_t num_elem, uint8_t type[],
- uint8_t len[], uint8_t *p_val[])
-{
- return SDP_AddSequence(handle, attr_id, num_elem, type, len, p_val);
-}
-
-bool esp_bt_sdp_add_uuid_sequence (uint32_t handle, uint16_t attr_id,
- uint16_t num_uuids, uint16_t *p_uuids)
-{
- return SDP_AddUuidSequence(handle, attr_id, num_uuids, p_uuids);
-}
-
-
-bool esp_bt_sdp_add_protocol_list (uint32_t handle, uint16_t num_elem,
- sdp_proto_elem_t *p_elem_list)
-{
- return SDP_AddProtocolList(handle, num_elem, (tSDP_PROTOCOL_ELEM *)p_elem_list);
-}
-
-bool esp_bt_sdp_add_addition_protocol_lists(uint32_t handle, uint16_t num_elem,
- sdp_proto_list_elem_t *p_proto_list)
-{
- return SDP_AddAdditionProtoLists(handle, num_elem, (tSDP_PROTO_LIST_ELEM *)p_proto_list);
-}
-
-bool esp_bt_sdp_add_profile_dscp_list (uint32_t handle,
- uint16_t profile_uuid,
- uint16_t version)
-{
- return SDP_AddProfileDescriptorList(handle, profile_uuid, version);
-}
-
-bool esp_bt_sdp_add_lang_base_attr_id_list(uint32_t handle,
- uint16_t lang, uint16_t char_enc,
- uint16_t base_id)
-{
- return SDP_AddLanguageBaseAttrIDList(handle, lang, char_enc, base_id);
-}
-
-bool esp_bt_sdp_add_service_class_id_list(uint32_t handle,
- uint16_t num_services,
- uint16_t *p_service_uuids)
-{
- return SDP_AddServiceClassIdList(handle, num_services, p_service_uuids);
-}
-
-bool esp_bt_sdp_delete_attribute(uint32_t handle, uint16_t attr_id)
-{
- return SDP_DeleteAttribute(handle, attr_id);
-}
-
-/**********************************************************************************************/
-/**********************************************************************************************/
** @return ESP_OK - success, other - failed
**
*******************************************************************************/
-esp_err_t esp_ble_gap_set_device_name(char *name);
+esp_err_t esp_ble_gap_set_device_name(const char *name);
/*******************************************************************************
** @return pointer of ADV data
**
*******************************************************************************/
-uint8_t *esp_ble_resolve_adv_data( uint8_t *p_adv, uint8_t type, uint8_t *p_length );
+uint8_t *esp_ble_resolve_adv_data(uint8_t *p_adv, uint8_t type, uint8_t *p_length);
#endif /* __ESP_GAP_BLE_API_H__ */
+++ /dev/null
-// Copyright 2015-2016 Espressif Systems (Shanghai) PTE LTD
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-#ifndef __ESP_GAP_BT_API_H__
-#define __ESP_GAP_BT_API_H__
-
-#include <stdint.h>
-
-#include "esp_err.h"
-#include "esp_bt_defs.h"
-
-typedef enum {
- BT_SCAN_MODE_NONE = 0,
- BT_SCAN_MODE_CONNECTABLE,
- BT_SCAN_MODE_CONNECTABLE_DISCOVERABLE
-} bt_scan_mode_t;
-
-esp_err_t esp_bt_gap_set_scan_mode(bt_scan_mode_t mode);
-
-#endif /* __ESP_GAP_BT_API_H__ */
**
** @brief Close a connection to a GATT server.
**
-** @param[in] conn_id: connectino ID to be closed.
+** @param[in] conn_id: connection ID to be closed.
**
** @return ESP_OK - success, other - failed
**
** @brief This function is called to read a service's characteristics of
** the given characteritisc ID.UTH_REQ_NO_SCATTERNET
**
-** @param[in] conn_id - connectino ID.
-** @param[in] srvc_id - serivcie ID.
+** @param[in] conn_id - connection ID.
+** @param[in] srvc_id - service ID.
** @param[in] char_id - characteritic ID to read.
** @param[in] auth_req - authenticate request type
**
** @brief This function is called to read a characteristics descriptor.
**
** @param[in] conn_id - connection ID.
-** @param[in] srvc_id - serivcie ID.
+** @param[in] srvc_id - service ID.
** @param[in] descr_id - characteritic descriptor ID to read.
** @param[in] auth_req - authenticate request type
**
** @brief This function is called to write characteristic value.
**
** @param[in] conn_id - connection ID.
-** @param[in] srvc_id - serivcie ID.
+** @param[in] srvc_id - service ID.
** @param[in] char_id - characteristic ID to write.
** @param[in] value_len: length of the value to be written.
** @param[in] value - the value to be written.
** @brief This function is called to write characteristic descriptor value.
**
** @param[in] conn_id - connection ID
-** @param[in] srvc_id - serivcie ID.
+** @param[in] srvc_id - service ID.
** @param[in] char_id - characteristic ID.
** @param[in] descr_id - characteristic descriptor ID to write.
** @param[in] value_len: length of the value to be written.
**
** @function esp_ble_gatts_app_register
**
-** @brief This function is called to register application identity
+** @brief This function is called to register application identifier
**
**
** @return ESP_OK - success, other - failed
/*******************************************************************************
**
-** @function esp_ble_gatts_add_include_service
+** @function esp_ble_gatts_add_included_service
**
** @brief This function is called to add an included service. After included
** service is included, a callback event BTA_GATTS_ADD_INCL_SRVC_EVT
** @return ESP_OK - success, other - failed
**
*******************************************************************************/
-esp_err_t esp_ble_gatts_add_include_service(uint16_t service_handle, uint16_t included_service_handle);
+esp_err_t esp_ble_gatts_add_included_service(uint16_t service_handle, uint16_t included_service_handle);
**
** @brief Close a connection a remote device.
**
-** @param[in] conn_id: connectino ID to be closed.
+** @param[in] conn_id: connection ID to be closed.
**
** @return ESP_OK - success, other - failed
**
+++ /dev/null
-// Copyright 2015-2016 Espressif Systems (Shanghai) PTE LTD
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-#ifndef __ESP_SDP_API_H__
-#define __ESP_SDP_API_H__
-
-#include <stdint.h>
-#include "esp_err.h"
-#include "esp_bt_defs.h"
-#include "bta_sdp_api.h"
-#include "bt_sdp.h"
-
-#define BT_SDP_STAT_SUCCESS BTA_SDP_SUCCESS
-#define BT_SDP_STAT_FAILURE BTA_SDP_FAILURE
-#define BT_SDP_STAT_BUSY BTA_SDP_BUSY
-
-#define BT_SDP_ENABLE_EVT BTA_SDP_ENABLE_EVT
-#define BT_SDP_SEARCH_EVT BTA_SDP_SEARCH_EVT
-#define BT_SDP_SEARCH_COMP_EVT BTA_SDP_SEARCH_COMP_EVT
-#define BT_SDP_CREATE_RECORD_USER_EVT BTA_SDP_CREATE_RECORD_USER_EVT
-#define BT_SDP_REMOVE_RECORD_USER_EVT BTA_SDP_REMOVE_RECORD_USER_EVT
-#define BT_SDP_MAX_EVT BTA_SDP_MAX_EVT
-
-#define BT_SDP_MAX_RECORDS BTA_SDP_MAX_RECORDS
-
-typedef tBTA_SDP_STATUS bt_sdp_status_t;
-
-typedef tBTA_SDP_EVT bt_sdp_evt_t;
-
-typedef bluetooth_sdp_record bt_sdp_record_t;
-
-/* tBTA_SEARCH_COMP, bta_sdp_api.h */
-typedef struct {
- bt_sdp_status_t status;
- esp_bd_addr_t remote_addr;
- esp_bt_uuid_t uuid;
- int record_count;
- bt_sdp_record_t records[BT_SDP_MAX_RECORDS];
-} bt_sdp_search_comp_t;
-
-/* tBTA_SDP, bta_sdp_api.h */
-typedef union {
- bt_sdp_status_t status;
- bt_sdp_search_comp_t sdp_search_comp;
-} bt_sdp_t;
-
-typedef void (bt_sdp_cb_t)(bt_sdp_evt_t event, bt_sdp_t *p_data, void *user_data);
-
-esp_err_t esp_bt_sdp_enable(bt_sdp_cb_t *cback);
-
-esp_err_t esp_bt_sdp_search(esp_bd_addr_t bd_addr, esp_bt_uuid_t *uuid);
-
-esp_err_t esp_bt_sdp_create_record_by_user(void *user_data);
-
-esp_err_t esp_bt_sdp_remove_record_by_user(void *user_data);
-
-
-/**********************************************************************************************/
-/**********************************************************************************************/
-/* API into SDP for local service database updates
- * these APIs are indended to be called in callback function in the context of stack task,
- * to handle BT_SDP_CREATE_RECORD_USER_EVT and BT_SDP_REMOVE_RECORD_USER_EVT
- */
-
-/* This structure is used to add protocol lists and find protocol elements */
-#define ESP_BT_SDP_MAX_PROTOCOL_PARAMS SDP_MAX_PROTOCOL_PARAMS // bt_target.h
-typedef struct {
- uint16_t protocol_uuid;
- uint16_t num_params;
- uint16_t params[ESP_BT_SDP_MAX_PROTOCOL_PARAMS];
-} sdp_proto_elem_t; // tSDP_PROTOCOL_ELEM, sdp_api.h
-
-#define ESP_BT_SDP_MAX_LIST_ELEMS SDP_MAX_LIST_ELEMS // sdp_api.h
-typedef struct {
- uint16_t num_elems;
- sdp_proto_elem_t list_elem[ESP_BT_SDP_MAX_LIST_ELEMS];
-} sdp_proto_list_elem_t; // tSDP_PROTO_LIST_ELEM, sdp_api.h
-
-
-uint32_t esp_bt_sdp_create_record(void);
-
-bool esp_bt_sdp_delete_record(uint32_t handle);
-
-int32_t esp_bt_sdp_read_record(uint32_t handle, uint8_t *data, int32_t *data_len);
-
-bool esp_bt_sdp_add_attribute (uint32_t handle, uint16_t attr_id,
- uint8_t attr_type, uint32_t attr_len,
- uint8_t *p_val);
-
-bool esp_bt_sdp_add_sequence (uint32_t handle, uint16_t attr_id,
- uint16_t num_elem, uint8_t type[],
- uint8_t len[], uint8_t *p_val[]);
-
-bool esp_bt_sdp_add_uuid_sequence (uint32_t handle, uint16_t attr_id,
- uint16_t num_uuids, uint16_t *p_uuids);
-
-
-bool esp_bt_sdp_add_protocol_list (uint32_t handle, uint16_t num_elem,
- sdp_proto_elem_t *p_elem_list);
-
-bool esp_bt_sdp_add_addition_protocol_lists(uint32_t handle, uint16_t num_elem,
- sdp_proto_list_elem_t *p_proto_list);
-
-bool esp_bt_sdp_add_profile_dscp_list (uint32_t handle,
- uint16_t profile_uuid,
- uint16_t version);
-
-bool esp_bt_sdp_add_lang_base_attr_id_list(uint32_t handle,
- uint16_t lang, uint16_t char_enc,
- uint16_t base_id);
-
-bool esp_bt_sdp_add_service_class_id_list(uint32_t handle,
- uint16_t num_services,
- uint16_t *p_service_uuids);
-
-bool esp_bt_sdp_delete_attribute(uint32_t handle, uint16_t attr_id);
-
-#endif /* __ESP_SDP_API_H__ */
+++ /dev/null
-// Copyright 2015-2016 Espressif Systems (Shanghai) PTE LTD
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-#ifndef __ESP_SEC_API_H__
-#define __ESP_SEC_API_H__
-
-#include "bt_types.h"
-
-#define APP_SEC_IRK_FLAG (0)
-#define RAND_NB_LEN 0x08
-#define SEC_KEY_LEN 0x10
-
-/*
- * STRUCTURES DEFINITIONS
- ****************************************************************************************
- */
-
-
-/// Generic Security key structure
-typedef struct {
- /// Key value MSB -> LSB
- UINT8 key[SEC_KEY_LEN];
-} smp_sec_key;
-
-///Random number structure
-typedef struct {
- ///8-byte array for random number
- UINT8 nb[RAND_NB_LEN];
-} rand_nb;
-
-typedef struct {
- // LTK
- smp_sec_key ltk;
- // Random Number
- rand_nb rand_nb;
- // EDIV
- UINT16 ediv;
- // LTK key size
- UINT8 key_size;
-
- // Last paired peer address type
- UINT8 peer_addr_type;
- // Last paired peer address
- BD_ADDR peer_addr;
-
- // authentication level
- UINT8 auth;
-
-} tAPP_SEC_ENV;
-
-extern tAPP_SEC_ENV app_sec_env;
-
-/*
-* GLOBAL FUNCTIONS DECLARATIONS
-****************************************************************************************
-*/
-
-void app_ble_sec_init(void);
-
-void app_ble_sec_pairing_cmp_evt_send(UINT8);
-
-UINT32 app_ble_sec_gen_tk(void);
-
-void app_ble_sec_gen_ltk(UINT8 key_size);
-
-void app_ble_security_start(void);
-
-#endif /* __ESP_SEC_API_H__ */
**
** Description Close a connection to a GATT server.
**
-** Parameters conn_id: connectino ID to be closed.
+** Parameters conn_id: connection ID to be closed.
**
** Returns void
**
** Description This function is called to read a service's characteristics of
** the given characteritisc ID.
**
-** Parameters conn_id - connectino ID.
+** Parameters conn_id - connection ID.
** p_char_id - characteritic ID to read.
**
** Returns None
** Description This function is called to read multiple characteristic or
** characteristic descriptors.
**
-** Parameters conn_id - connectino ID.
+** Parameters conn_id - connection ID.
** p_read_multi - pointer to the read multiple parameter.
**
** Returns None
APPL_TRACE_ERROR("connection request on gatt_if[%d] is not interested", gatt_if);
}
} else {
- APPL_TRACE_ERROR("request received on unknown connectino ID: %d", conn_id);
+ APPL_TRACE_ERROR("request received on unknown connection ID: %d", conn_id);
}
}
**
** Description Close a connection a remote device.
**
-** Parameters conn_id: connectino ID to be closed.
+** Parameters conn_id: connection ID to be closed.
**
** Returns void
**
**
** Description Close a connection to a GATT server.
**
-** Parameters conn_id: connectino ID to be closed.
+** Parameters conn_id: connection ID to be closed.
**
** Returns void
**
** Description This function is called to read a service's characteristics of
** the given characteritisc ID.
**
-** Parameters conn_id - connectino ID.
+** Parameters conn_id - connection ID.
** p_char_id - characteritic ID to read.
**
** Returns None
** Description This function is called to read multiple characteristic or
** characteristic descriptors.
**
-** Parameters conn_id - connectino ID.
+** Parameters conn_id - connection ID.
** p_read_multi - read multiple parameters.
**
** Returns None
**
** Description Close a connection a remote device.
**
-** Parameters conn_id: connectino ID to be closed.
+** Parameters conn_id: connection ID to be closed.
**
** Returns void
**
+++ /dev/null
-// Copyright 2015-2016 Espressif Systems (Shanghai) PTE LTD
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-#include "esp_gap_bt_api.h"
-#include "bta_api.h"
-#include "bt_trace.h"
-
-esp_err_t esp_bt_gap_set_scan_mode(bt_scan_mode_t mode)
-{
- tBTA_DM_DISC disc_mode;
- tBTA_DM_CONN conn_mode;
-
- switch (mode) {
- case BT_SCAN_MODE_NONE:
- disc_mode = BTA_DM_NON_DISC;
- conn_mode = BTA_DM_NON_CONN;
- break;
-
- case BT_SCAN_MODE_CONNECTABLE:
- disc_mode = BTA_DM_NON_DISC;
- conn_mode = BTA_DM_CONN;
- break;
-
- case BT_SCAN_MODE_CONNECTABLE_DISCOVERABLE:
- disc_mode = BTA_DM_GENERAL_DISC;
- conn_mode = BTA_DM_CONN;
- break;
-
- default:
- // BTIF_TRACE_ERROR("invalid scan mode (0x%x)", mode);
- return ESP_ERR_INVALID_ARG;
- }
-
- // BTIF_TRACE_EVENT("set property scan mode : %x", mode);
- BTA_DmSetVisibility(disc_mode, conn_mode, BTA_DM_IGNORE, BTA_DM_IGNORE);
-
- return ESP_OK;
-}
** p_select_cback: callback function to return application
** selection.
**
-** Returns BOOLEAN: selective connectino procedure is started.
+** Returns BOOLEAN: selective connection procedure is started.
**
*******************************************************************************/
BOOLEAN btm_ble_start_select_conn(BOOLEAN start, tBTM_BLE_SEL_CBACK *p_select_cback)
** p_select_cback: callback function to return application
** selection.
**
-** Returns BOOLEAN: selective connectino procedure is started.
+** Returns BOOLEAN: selective connection procedure is started.
**
*******************************************************************************/
void btm_ble_initiate_select_conn(BD_ADDR bda)
** Description This function sends the client request or confirmation message
** to server.
**
-** Parameter p_tcb: pointer to the connectino control block.
+** Parameter p_tcb: pointer to the connection control block.
** clcb_idx: clcb index
** op_code: message op code.
** p_msg: pointer to message parameters structure.
#define BTM_BLE_CONN_INT_MIN_DEF 24 /* recommended min: 30ms = 24 * 1.25 */
#endif
-/* default connectino interval max */
+/* default connection interval max */
#ifndef BTM_BLE_CONN_INT_MAX_DEF
#define BTM_BLE_CONN_INT_MAX_DEF 40 /* recommended max: 50 ms = 56 * 1.25 */
#endif
esp_err_t ret;
nvs_flash_init();
- system_init();
initialise_wifi();
//vTaskDelay(3000 / portTICK_PERIOD_MS);