Return-Path: MIME-Version: 1.0 Reply-To: yunhanw@nestlabs.com In-Reply-To: References: From: Yunhan Wang Date: Tue, 10 Oct 2017 01:02:01 -0700 Message-ID: Subject: Re: notification has not yet been cleaned in server side when ble is disconnected. To: Luiz Augusto von Dentz , linux-bluetooth@vger.kernel.org Content-Type: text/plain; charset="UTF-8" Sender: linux-bluetooth-owner@vger.kernel.org List-ID: Hi, Luiz Please ignore the previous email. I am seeing a bluez gatt notification problem in gatt-database.c Here is scenario: 1. Assume server has one characteristic A that is subscribed by client and sending notification, 2. Then ble connection is disconnected by client directly or connection disappear without unsubscribing A. 3. Client tries to connect to ble successfully 4. Client fails to subscribe that characteristic A although ble connection is ok. 5. Another retry to make Ble connection and subscribe to A can work. It seems ble disconnect at step 2 only disconnect ble connection and does not cleanup notify_io and stop notification in step 3 at code, https://git.kernel.org/pub/scm/bluetooth/bluez.git/tree/src/gatt-database.c It seems retry in step 4 would trigger ccc_write_cb and release notify_io and stop notification so that step 5 would succeed. partial log from step 4: ccc_write_cb() External CCC write received with value: 0x0000 pipe_hup() 0x921290 closed Any idea? Thanks Best wishes Yunhan