Commit graph

82 commits

Author SHA1 Message Date
Hrishikesh Dhayagude
32fd3a3215 components/bt: Fix a probable memory leak for BTA_GATTS_CONF_EVT event (backport v3.0)
Multiple modules register their callback BTA_GATTS_AppRegister().

If any of the callbacks do not free the allocated pointer in
BTA_GATTS_CONF_EVT event, then this can result in memory leak.

So, free the pointer after the callback function is called and remove
the calls to free in the callback functions as it is now not required

Signed-off-by: Hrishikesh Dhayagude <hrishi@espressif.com>
2018-08-27 11:57:14 +05:30
Jiang Jiang Jian
d881fcd380 Merge branch 'bugfix/btdm_modify_open_API_params' into 'release/v3.0'
Component/bt: modify open API params for v3.0

See merge request idf/esp-idf!2166
2018-03-30 19:41:31 +08:00
zhiweijian
058a38a141 Component/bt: fix connect fail when remote addr type is random 2018-03-30 17:10:56 +08:00
Jiang Jiang Jian
a80e687f8c Merge branch 'bugfix/btdm_fix_service_change_event_param_error' into 'master'
Component/bt: fix service change event params error

See merge request idf/esp-idf!2150

(cherry picked from commit b26ab188af)

f5d58142 Component/bt: fix service change event params error
2018-03-30 14:57:24 +08:00
Jiang Jiang Jian
e4357d9cf3 Merge branch 'cherry-pick-0f6f762b' into 'release/v3.0'
cherry pick 'bugfix/btdm_add_char_descr_uuid_error' into 'release/v3.0'

See merge request idf/esp-idf!2100
2018-03-21 10:21:54 +08:00
Jiang Jiang Jian
7f2a9f0359 Merge branch 'bugfix/btdm_fix_reconnect_fail_in_smp_v30' into 'release/v3.0'
Component/bt: fix reconnect fail in smp for v3.0

See merge request idf/esp-idf!2075
2018-03-20 18:49:13 +08:00
Jiang Jiang Jian
ecdeea9a85 Merge branch 'bugfix/btdm_add_char_descr_uuid_error' into 'master'
component/bt: Change the char_uuid to descr_uuid in the add descriptor callback params.

See merge request idf/esp-idf!2065

(cherry picked from commit 0f6f762be0)

c802ea84 component/bt: Change the char_uuid to descr_uuid in the add descriptor callback params.
2018-03-20 18:43:59 +08:00
zhiweijian
d0e553358a Component/bt: fix reconnect fail in smp 2018-03-19 11:15:38 +08:00
zwj
05b5671fc4 component/bt: fix gattc open api 2018-03-16 19:23:31 +08:00
Jiang Jiang Jian
54b595ed51 Merge branch 'bugfix/btdm_alarm_free_for_v3.0' into 'release/v3.0'
component/bt: free timer resources after using them

See merge request idf/esp-idf!1888
2018-02-24 10:17:15 +08:00
wangmengyang
fab14106c8 component/bt: free timer resources after using them
Bluedroid use a set of timer function pairs such as btu_start_timer/btu_stop_timer, btu_sys_start_timer/btu_sys_stop_timer for use, in a lack of timer release functions. Thus the timers may be exhausted after some event sequence such as repetition of connection/reconnection with different devices. The maximum timer number used in bluedroid is given by ALARM_CBS_NUM which is 30 for now. This bugfix borrowed some update from bluedroid in Andoroid 7.0, which add timer release functions which promote the recycle of timer resources.

# Conflicts:
#	components/bt/bluedroid/stack/btu/btu_task.c
#	components/bt/bluedroid/stack/gatt/gatt_main.c
#	components/bt/bluedroid/stack/rfcomm/port_utils.c
#	components/bt/bluedroid/stack/rfcomm/rfc_utils.c
2018-02-01 13:52:19 +08:00
zhiweijian
154294e79f Component/bt: fix stop adv no callback when adv has been stoped 2018-01-31 20:24:02 +08:00
Yulong
7e488b0c6b component/bt: Optimized broadcast callback function, send the callback function to the application after the controller confirms receipt of the broadcast start.
1. optimiz the ble stop adv callback function.
2. added the osi_mutex_unlock in the bta_gattc_wait4_service_change_ccc_cback function when the p_timer_param == NULL ||  p_conn == NULL.
2017-12-15 18:17:02 +08:00
Jiang Jiang Jian
7702e0f45b Merge branch 'bugfix/btdm_con_discon_test_crash_#16055' into 'master'
component/bt: Fix the bug when write ccc sometimes will lead to repeatedly release the memory.

See merge request !1599
2017-12-01 19:32:39 +08:00
yulong
a0992ad442 component/bt: Remove the p_tle->param reset to 0 when free the p_timer_param pointer. 2017-11-30 16:15:22 +08:00
Yulong
5b243b1d01 component/bt: Added the mutex lock protect the ccc free when disconnect. 2017-11-30 02:45:26 -05:00
yulong
7353307ca5 component/bt: reset the p_cmd_list pointer after release the mem. 2017-11-29 10:50:03 +08:00
yulong
5b9131cc60 compoent/bt: Fix the bug when do the BLE pressure test will lead to memory leak will appear WDT. 2017-11-28 15:43:33 +08:00
Yulong
c71318ce88 component/bt: Fix the bug when write ccc sometimes will lead to repeatedly release the memory. 2017-11-25 05:06:14 -05:00
island
7bd8133639 component/bt: delete api bta_gattc_cache_write 2017-11-16 16:40:18 +08:00
island
5789a8a6e9 component/bt: delete gattc cache write operation 2017-11-16 11:18:17 +08:00
Jiang Jiang Jian
ec9d93f4fc Merge branch 'bugfix/btdm_gattc_command_queue_fix' into 'master'
Bugfix/btdm gattc command queue fix

See merge request !1317
2017-11-15 10:54:02 +08:00
Yulong
b07a5f03cf component/bt: Change the gattc prepare write callback params. 2017-11-14 07:00:45 -05:00
island
2a4af8b83c component/bt: remove redundant open evt while calling gattc_open twice in the same app_id 2017-11-14 17:11:34 +08:00
Yulong
1d13b58c62 component/bt: Added the queue event when the gattc command is full. 2017-11-13 22:44:27 -05:00
Yulong
2be5e73090 rebase the origin to the local 2017-11-13 02:20:02 -05:00
Yulong
8352eb6fa2 component/bt: Added the prepare write check. 2017-11-13 02:12:33 -05:00
Yulong
ee43527108 compoent/bt: Modify bta_gattc_utils.c The value pointer copy is overwritten when a write event occurs. 2017-11-09 14:47:11 +08:00
Yulong
e6b2c19eea component/bt: Fix the write value not store in the queue command bug. 2017-11-09 14:47:11 +08:00
Yulong
68833fe94c component/bt: Change the bta_gattc_pop_command_to_send function to static. 2017-11-09 14:47:11 +08:00
Yulong
0ae5320f50 component/bt: Added the gattc command queue support. 2017-11-09 14:47:11 +08:00
Yulong
7a27e3c74d component/bt: added the queue to store the gattc commands. 2017-11-09 14:47:11 +08:00
Yulong
1ceef12238 compoent/bt: Modify bta_gattc_utils.c The value pointer copy is overwritten when a write event occurs. 2017-11-09 01:44:16 -05:00
Yulong
8ca40818eb component/bt: Fix the write value not store in the queue command bug. 2017-11-08 04:23:12 -05:00
Jiang Jiang Jian
b13cd4adf8 Merge branch 'feature/btdm_add_value_callback_when_send_notification_or_indicate_failed' into 'master'
component/bt: add value callback when send notification or indicate failed

See merge request !1457
2017-11-03 10:05:29 +08:00
zhiweijian
e7020460c6 Component/bt: add value callback when send notification or indicate failed 2017-11-01 11:00:08 +08:00
zhiweijian
481e436587 Component/bt: modify close event and disconnection event params
- modify close event params
- modify disconnection event params
- modify connect event params
2017-11-01 10:40:03 +08:00
zhiweijian
520b3340f6 Component/bt: fix crash when set attr value 0 2017-10-13 15:06:08 +08:00
Yulong
e02ff1ed89 component/bt: Change the bta_gattc_pop_command_to_send function to static. 2017-10-10 03:12:00 -04:00
Jiang Jiang Jian
a8dab7680a Merge branch 'bugfix/btdm_gattc_mutiple_read_bug' into 'master'
component/bt: Fixed the bug of mutiple read can not callback.

See merge request !1286
2017-09-30 15:45:56 +08:00
Yulong
3d3bcd6275 component/bt: Added the gattc command queue support. 2017-09-30 13:59:14 +08:00
Yulong
fb93a59619 component/bt: added the queue to store the gattc commands. 2017-09-30 13:59:14 +08:00
Yulong
f7a2cc37b3 component/bt: Fix the bug of total attr didn't reset when init the gattc cache. 2017-09-28 02:09:02 -04:00
Yulong
f325ba3942 component/bt: Change the cmpl_evt command in the bta_gattc_read_cmpl function. 2017-09-20 04:28:52 -04:00
Yulong
e815660824 component/bt: Fixed the bug of mutiple read can not callback. 2017-09-19 04:50:26 -04:00
Yulong
1759a47060 This is a combination of 4 commits.
squash again all the commit.

component/bt: Change all the gattc API && bta gattc layer.

component/bt: Debug the code and change the btc_ble_gattc_get_db method.

component/bt: Change the gatt read API interface.

component/bt: Reconstruction the BTA_gattc_cache code.

component/bt: Change back the bluedroid_get_status to marco.

component/bt: Added the serch service res start_handle & end_handle to the result.

component/bt: Change the gattc docs format.

component/bt: Change the docs format.

component/bt: fix the read char value bug.

component/bt: change the gattc_get_attr_count method.

component/bt: Change back the bta_gattc write ccc code.

component/bt: Change the gattc api docs format

component/bt: Change the gattc API docs.

component/bt: Change the prepare write descriptor method to avoid the exection.

Component/bt: modify gatt clinet demo with new API

component/bt: Change the p_src_data->read.p_value to avoid exection.

compoent/bt: Change the bugfix of gattc unreg for the notify.

Modify gattc security demo

component/bt: Change the log error.

Component/bt: modify gattc_multi_connect demo

componnet/bt: Change the bta_gattc_cache sdp include.

component/bt: Change the start_handle & end_handle not from the service.

component/bt: Change the gattc API docs.

component/bt: Change the return issues.

component/bt: Fixed the include service bug.

component/bt: Modify gattc_multi_connect demo , add scan log

component/bt: Fixed the BTA_GATTC_GetIncludeService start handle & end handle error bug.

component/bt: Fix the invalid handle of the get all char issues.

component/bt: Fix the bug with get_db_size_with_type of the start handle & end_handle not correted issue.

component/bt: Fixed the get secondly service num not correct issue.

component/bt: Fixed the last service handle not correted issue.
2017-09-12 07:36:02 -04:00
zhiweijian
f1c4eda373 Component/bt: add set local MTU API
- add esp_ble_gatt_set_local_mtu( ) API
- modify esp_ble_gattc_config_mtu(esp_gatt_if_t gattc_if, uint16_t conn_id)
- modify  gattc demo
2017-09-01 21:55:28 +08:00
zhiweijian
1a9b02ccbc component/bt: fix connection parameters update
- update connection parameters timeout due to master update illegal connection parameters
- slave returns error status when slave check the connection parameters
- slave connection parameters update callback get that interval_max is equal to interval_min
2017-08-30 11:29:25 +08:00
Ivan Grokhotkov
de10032717 Merge branch 'feature/btdm_remove_gki' into 'master'
component/bt : remove all GKI reference

See merge request !1122
2017-08-23 18:01:54 +08:00
Tian Hao
e4f63819a1 component/bt : remove all GKI reference
1. remove GKI(not use osi_free_and_reset)
2. modify mutex/semaphore to individual directory
3. set osi_malloc as malloc(previously use calloc)
4. change osi allocator debug osi_free
5. fix rebase of remove GKI
2017-08-23 15:29:30 +08:00