GATT Client : Fix subscription state mis-matched 54/136654/1
authorSeungyoun Ju <sy39.ju@samsung.com>
Wed, 24 May 2017 12:42:31 +0000 (21:42 +0900)
committerSeungyoun Ju <sy39.ju@samsung.com>
Fri, 30 Jun 2017 14:41:15 +0000 (23:41 +0900)
commit2885e991596555603004b94d06fdf9bd8f80d3e3
treeb61db837fa5e3ebe231f7c1a344bf74bfe7ee94a
parentec4e369d7c59465fc7aaeaa02552314c1bc47eb0
GATT Client : Fix subscription state mis-matched

[Problem] When BLE is not paired and StartNotify is called via
 bluetooth_gatt_watch_characteristics(), pairing procedure is started.
 We use 5 seconds dbus timeout in that API. So during pairing,
 bluetooth_gatt_watch_characteristics() call is failed.
 But after pairing is done, bluez starts notify procedure.
 So that, subscription is done but application side doesn't know it
 and callback is not set.
[Cause & Measure] Too short timeout is used. ATT transaction timeout is
 30 seconds. If it is over, ATT connection will be dropped. So until
 that, this API shall not be returned. If application needs to be
 returned immediately, it should ensure that both devices are paired
 before bluetooth_gatt_watch_characteristics() is called.
[Checking Method] Try to pair using
 bluetooth_gatt_watch_characteristics() -> Accept pairing request after
 5 seconds.

Change-Id: I3d34f85d0e45cb08039dad843190091e2eeeecc8
bt-api/bt-gatt-client.c