diff options
author | Seungyoun Ju <sy39.ju@samsung.com> | 2016-05-30 21:56:40 +0900 |
---|---|---|
committer | DoHyun Pyun <dh79.pyun@samsung.com> | 2016-06-01 09:02:33 +0900 |
commit | d289f1267172a124fceb2fb657895eec2a0c2e0b (patch) | |
tree | d7de5517c713a7b83734690193eb56ddaf0a2b4c | |
parent | 40a20bfe2461475e754b4740d4851bcc028b7125 (diff) | |
download | bluez-d289f1267172a124fceb2fb657895eec2a0c2e0b.tar.gz bluez-d289f1267172a124fceb2fb657895eec2a0c2e0b.tar.bz2 bluez-d289f1267172a124fceb2fb657895eec2a0c2e0b.zip |
Provide BLE pairing method as best effort waysubmit/tizen/20160602.084111accepted/tizen/wearable/20160602.231140accepted/tizen/tv/20160602.231142accepted/tizen/mobile/20160602.231206accepted/tizen/ivi/20160602.231152accepted/tizen/common/20160603.150602
[Model] SM-Z300F
[BinType] AP
[Customer] OPEN
[Issue#] N/A
[Request] Operator
[Occurrence Version] BPE5
[Problem] Basis Peak watch disconnects BLE connection if remote device
doesn't make BLE pairing within 5 seconds. But BLE service discovery requires
over 5 seconds so it is always disconnected.
[Cause & Measure] There is no way to make BLE pairing without BLE service
discovery. So it needs to provide BLE pairing way as best effort way.
[Checking Method] Make BLE connection with Basis Peak
[Team] Basic connection
[Developer] Seungyoun Ju
[Solution company] Samsung
[Change Type] Specification change
Change-Id: I8930a9546cfa8d66ade64c8d42a29155232bda43
Signed-off-by: DoHyun Pyun <dh79.pyun@samsung.com>
-rw-r--r-- | src/device.c | 22 |
1 files changed, 14 insertions, 8 deletions
diff --git a/src/device.c b/src/device.c index 64c1eaca..2b3c25fe 100644 --- a/src/device.c +++ b/src/device.c @@ -2908,8 +2908,14 @@ static DBusMessage *pair_device(DBusConnection *conn, DBusMessage *msg, return btd_error_already_exists(msg); else if (device_is_bonded(device, DEV_CONN_LE)) return btd_error_already_exists(msg); - } - else { + + if (device->bredr) + conn_type = DEV_CONN_BREDR; + else if (device->le) + conn_type = DEV_CONN_LE; + else + conn_type = DEV_CONN_BREDR; + } else { if (device_is_bonded(device, conn_type)) return btd_error_already_exists(msg); } @@ -2929,9 +2935,9 @@ static DBusMessage *pair_device(DBusConnection *conn, DBusMessage *msg, #endif #ifdef __TIZEN_PATCH__ - if ((device_is_bredrle(device) || bdaddr_type != BDADDR_BREDR) && - conn_type == DEV_CONN_LE) { - DBG("Le Connect request"); + if (conn_type == DEV_CONN_LE && + (device_is_bredrle(device) || bdaddr_type != BDADDR_BREDR)) { + DBG("LE Connect request"); connect_le = TRUE; } #endif @@ -2945,8 +2951,8 @@ static DBusMessage *pair_device(DBusConnection *conn, DBusMessage *msg, io_cap = IO_CAPABILITY_NOINPUTNOOUTPUT; #ifdef __TIZEN_PATCH__ - if (((conn_type == DEV_CONN_DEFAULT && bdaddr_type != BDADDR_BREDR) || - (connect_le))) + if ((conn_type == DEV_CONN_LE && bdaddr_type != BDADDR_BREDR) || + connect_le) bonding = bonding_request_new(msg, device, bdaddr_type, agent); else bonding = bonding_request_new(msg, device, BDADDR_BREDR, agent); @@ -2970,7 +2976,7 @@ static DBusMessage *pair_device(DBusConnection *conn, DBusMessage *msg, * this in the ATT connect callback) */ #ifdef __TIZEN_PATCH__ - if (((conn_type == DEV_CONN_DEFAULT && bdaddr_type != BDADDR_BREDR) || + if (((conn_type == DEV_CONN_LE && bdaddr_type != BDADDR_BREDR) || (connect_le)) && !device->le_state.connected) err = device_connect_le(device); else if (connect_le) /* Send bonding request if LE is already connected*/ |