platform/core/connectivity/bluetooth-frwk.git
2 years agoLE CoC: Add HAL implementation for L2CAP_LE type socket 37/271437/2
Ayush Garg [Mon, 21 Feb 2022 07:43:45 +0000 (13:13 +0530)]
LE CoC: Add HAL implementation for L2CAP_LE type socket

This patch adds following
- Implement HAL interface to create and remove L2CAP_LE Socket
- Implement HAL interface to listen and connect to L2CAP_LE Socket
- Support for L2CAP_LE socket authorization

Change-Id: Ifd4297f77a327ded5b7f51a3bc56c72f1416c9f1
Signed-off-by: Ayush Garg <ayush.garg@samsung.com>
2 years agoStore EIR Manufacturer specific data into the device information 23/270223/1 accepted/tizen/unified/20220206.211909 submit/tizen/20220127.054201
dh79pyun [Thu, 27 Jan 2022 00:44:26 +0000 (09:44 +0900)]
Store EIR Manufacturer specific data into the device information

Change-Id: Ia3d9d62db972f394d30b9db934bbceee6977098f
Signed-off-by: dh79pyun <dh79.pyun@samsung.com>
2 years agoDon't allow the invalid ADV handle 12/269312/1 accepted/tizen/unified/20220117.135002 submit/tizen/20220112.235928
dh79pyun [Wed, 12 Jan 2022 23:40:52 +0000 (08:40 +0900)]
Don't allow the invalid ADV handle

Change-Id: Ieca085a04733bcfdc69d028d9fde8205d21f1c67
Signed-off-by: dh79pyun <dh79.pyun@samsung.com>
2 years agoMerge "Fix Svace Issues" into tizen submit/tizen/20220110.224444
Pyun DoHyun [Tue, 11 Jan 2022 22:55:55 +0000 (22:55 +0000)]
Merge "Fix Svace Issues" into tizen

2 years agoFix Svace Issues 73/269073/3
Anuj Jain [Fri, 7 Jan 2022 07:38:41 +0000 (13:08 +0530)]
Fix Svace Issues

This patch fixes scave issues:
473071: DIVISION_BY_ZERO
473376: MEMORY_LEAK

Change-Id: I8818accf1d7ff5a5b8adbbd2311e82d292f9b568
Signed-off-by: Anuj Jain <anuj01.jain@samsung.com>
2 years agoDisable the factory test mode in TV product 39/269039/1
dh79pyun [Fri, 7 Jan 2022 02:54:44 +0000 (11:54 +0900)]
Disable the factory test mode in TV product

Change-Id: I93dcce0afdf3425f7fd7763d5733426c852dc3b6
Signed-off-by: dh79pyun <dh79.pyun@samsung.com>
2 years agoReplace g_memdup to g_memdup2 84/267884/1 accepted/tizen/unified/20211222.230419 submit/tizen/20211212.233427
dh79pyun [Mon, 13 Dec 2021 02:25:50 +0000 (11:25 +0900)]
Replace g_memdup to g_memdup2

Change-Id: Ia7c3a7341073df0de79fb725435a3c47ccbca20c
Signed-off-by: dh79pyun <dh79.pyun@samsung.com>
2 years agoMerge "Add a function to find remote client info matched addr and inst id" into tizen
Pyun DoHyun [Tue, 7 Dec 2021 22:09:53 +0000 (22:09 +0000)]
Merge "Add a function to find remote client info matched addr and inst id" into tizen

2 years agoFix invalid unique name issue 74/267474/1 accepted/tizen/unified/20211207.133118 submit/tizen/20211206.062656
Wootak Jung [Mon, 6 Dec 2021 05:05:54 +0000 (14:05 +0900)]
Fix invalid unique name issue

I/BLUETOOTH_FRWK_SERVICE(  392): bt-service-main.c: __on_log_glib(85) >
g_variant_new_string: assertion 'g_utf8_validate (string, -1, NULL)' failed
E/CYNARA  (  392): Getting client credentials by calling dbus method
GetConnectionCredentials on Id <:1.19482`��U> failed with error
<GDBus.Error:org.freedesktop.DBus.Error.NameHasNoOwner: Could not get
credentials of name '[Invalid UTF-8]': no such name>

Change-Id: I296767876dc143449d8147e00cc3d302ce0378d8

2 years agoAdd a function to find remote client info matched addr and inst id 70/267470/1
Wootak Jung [Mon, 6 Dec 2021 04:26:36 +0000 (13:26 +0900)]
Add a function to find remote client info matched addr and inst id

Change-Id: Ifed5672d2302910a7d9521b2644535a475c432f8

2 years agoChange if statement order to set the visible mode 34/267234/1 accepted/tizen/unified/20211202.120751 submit/tizen/20211201.061349
dh79pyun [Tue, 30 Nov 2021 05:46:35 +0000 (14:46 +0900)]
Change if statement order to set the visible mode

The prioriy of the model name is higer than the
profile name.

Change-Id: Id28d03145f433da07d9b3b7ccc33848c5f6f92a5
Signed-off-by: dh79pyun <dh79.pyun@samsung.com>
2 years agoEnable the default connectable mode for the commom profile 76/267076/1 accepted/tizen/unified/20211126.111806 accepted/tizen/unified/20211130.125450 submit/tizen/20211124.060921 submit/tizen/20211129.075122
dh79pyun [Thu, 25 Nov 2021 04:29:08 +0000 (13:29 +0900)]
Enable the default connectable mode for the commom profile

Change-Id: Id7f4e80608d59e7df9dc0f6f3f6ee0ca71a5d017
Signed-off-by: dh79pyun <dh79.pyun@samsung.com>
3 years agoAdd the logic for checking privilege to container 45/266745/2
Wootak Jung [Thu, 18 Nov 2021 06:20:33 +0000 (15:20 +0900)]
Add the logic for checking privilege to container

Change-Id: Iffa438bd53b6ef0e5eee8165a5bb0f286f631898

3 years agoSet the connectable mode in IOT profile 22/266522/1 submit/tizen/20211114.231048
dh79pyun [Mon, 15 Nov 2021 02:11:24 +0000 (11:11 +0900)]
Set the connectable mode in IOT profile

Change-Id: I5fbdcf58781eeaef725fa46a625428762b740f9e
Signed-off-by: dh79pyun <dh79.pyun@samsung.com>
3 years agoCheck the privilege for register profile method 42/266342/1
dh79pyun [Wed, 10 Nov 2021 22:58:49 +0000 (07:58 +0900)]
Check the privilege for register profile method

Change-Id: I17e2b1977b22f1fa7bca19a84cc2d4d2269d4043
Signed-off-by: dh79pyun <dh79.pyun@samsung.com>
3 years agoAdd container request check logic 54/266254/2
Wootak Jung [Wed, 10 Nov 2021 01:21:28 +0000 (10:21 +0900)]
Add container request check logic

Change-Id: I8f7419f03e4937c9d41ece4a704b8f411ad04227

3 years agoIncrease the version 05/266105/2
dh79pyun [Mon, 8 Nov 2021 02:31:19 +0000 (11:31 +0900)]
Increase the version

Change-Id: I18d63c47d55e622fb7b8ace91e11e6b7e2798740
Signed-off-by: dh79pyun <dh79.pyun@samsung.com>
3 years agoRemove the trust logic in the Robot profile 04/266104/1
dh79pyun [Mon, 8 Nov 2021 02:26:39 +0000 (11:26 +0900)]
Remove the trust logic in the Robot profile

Change-Id: I77ca652fd7475c3e342c0a56e032e20f1af06c8f
Signed-off-by: dh79pyun <dh79.pyun@samsung.com>
3 years agoAdd container handling logic 10/266010/3 accepted/tizen/unified/20211108.181406 submit/tizen/20211104.234019
Wootak Jung [Thu, 4 Nov 2021 04:07:47 +0000 (13:07 +0900)]
Add container handling logic

bt-service is running in host only
All requests received from container will re-direct to host
Don't read vconf to check bt status

Change-Id: If2d42cde897c8f90f700aa5279232d8ab8f8a523

3 years agoDon't check the address for RESYNC svc change event 55/265855/1 accepted/tizen/unified/20211102.024812 submit/tizen/20211101.044616
dh79pyun [Sun, 31 Oct 2021 23:15:22 +0000 (08:15 +0900)]
Don't check the address for RESYNC svc change event

Change-Id: I9de5e4497c3a068a45f76796a92c2ea349d433ea
Signed-off-by: dh79pyun <dh79.pyun@samsung.com>
3 years agoHandle BT_GATT_CLIENT_SERVICE_RESYNC event 01/265801/1
dh79pyun [Fri, 29 Oct 2021 01:09:45 +0000 (10:09 +0900)]
Handle BT_GATT_CLIENT_SERVICE_RESYNC event

Change-Id: I1d7f1ee6196e15cbaf9cfdc8d67fd77c4b6c4559
Signed-off-by: dh79pyun <dh79.pyun@samsung.com>
3 years agoRemove unused code 21/265721/1
INSUN PYO [Wed, 27 Oct 2021 22:25:33 +0000 (07:25 +0900)]
Remove unused code

Change-Id: I6ab2e413f95bf4bcaf2d7e679c7c6142f36a5ec4

3 years agoAdd more conditions for the robot profile 49/265549/1 accepted/tizen/unified/20211028.122145 submit/tizen/20211028.013751
dh79pyun [Fri, 22 Oct 2021 00:53:44 +0000 (09:53 +0900)]
Add more conditions for the robot profile

Change-Id: I9dcb05d93c711231b2e46d45eb8018bcabb48ea9
Signed-off-by: dh79pyun <dh79.pyun@samsung.com>
3 years agoFix coverity issue 96/262296/1 accepted/tizen/6.5/unified/20211028.095929 accepted/tizen/unified/20210823.124243 submit/tizen/20210806.053226 submit/tizen/20210820.043301 submit/tizen_6.5/20211028.162201 tizen_6.5.m2_release
Wootak Jung [Fri, 6 Aug 2021 05:21:40 +0000 (14:21 +0900)]
Fix coverity issue

param should be initialized

Change-Id: I5da0ab3ad7f6a74322038b97357e7141f2983ac3
Signed-off-by: Wootak Jung <wootak.jung@samsung.com>
3 years agoGATT: Parse client address in StartNotify and StopNotify DBUS APIs 68/262168/1 accepted/tizen/unified/20210805.131629 submit/tizen/20210804.223925
Anuj Jain [Tue, 3 Aug 2021 08:44:07 +0000 (14:14 +0530)]
GATT: Parse client address in StartNotify and StopNotify DBUS APIs

This patch enables client address to be reported in
Notification Enable/Diable callback in Tizen CAPI.

In GATT server role, client address is parsed from incoming dbus
message and is passed up the stack.

This patchset should be merged with the following capi and bluez's
patchset in order to match API and avoid crash:
bluez Change-Id: I81a0994f2299e988f8ef6428537647c899700fda
capi Change-Id: Ic4868234a4fc682f9bff2c66ac1aee2683f3d6c6

Change-Id: Ib54ba54c318692b4ee0eaef9b2310c60dadeb661
Signed-off-by: Anuj Jain <anuj01.jain@samsung.com>
3 years agoFix gatt service uuid duplicated registration issue 68/261868/2 accepted/tizen/unified/20210803.123909 submit/tizen/20210801.230254
Wootak Jung [Wed, 28 Jul 2021 04:23:53 +0000 (13:23 +0900)]
Fix gatt service uuid duplicated registration issue

Change-Id: I33aa85aa436badf16d82226fcd69d7e65f85ce9d
Signed-off-by: Wootak Jung <wootak.jung@samsung.com>
3 years agoGATT: Clear dbus pending invocation list when gatt disconnection occurs. 14/260114/2
Anuj Jain [Sun, 20 Jun 2021 04:08:32 +0000 (09:38 +0530)]
GATT: Clear dbus pending invocation list when gatt disconnection occurs.

In GATT client role, When an application makes a dbus sync request
to BT-Service and is waiting for its reply,
Meanwhile BT-Service encounters GATT disconnection, because of which
it could not send the corresponding replies to application as the
connection info is already removed and thus causing dbus timeout error.

This patch will prevent such situation by sending BLUTOOTH_INTERNAL_ERROR
reply corresponding to all those pending dbus invocations when GATT
disconnection occurs.

Change-Id: Ib1cc93427a0d7156885381174e81616010cf9267
Signed-off-by: Anuj Jain <anuj01.jain@samsung.com>
Signed-off-by: Ayush Garg <ayush.garg@samsung.com>
3 years agoRevert "GATT: Clear dbus pending invocation list when gatt disconnection occurs."
Ayush Garg [Sun, 20 Jun 2021 04:48:55 +0000 (10:18 +0530)]
Revert "GATT: Clear dbus pending invocation list when gatt disconnection occurs."

This reverts commit 702713c02a0256416f1a3f2a1aa49eff30408316.

3 years agoGATT: Clear dbus pending invocation list when gatt disconnection occurs.
Anuj Jain [Sun, 20 Jun 2021 04:08:32 +0000 (09:38 +0530)]
GATT: Clear dbus pending invocation list when gatt disconnection occurs.

In GATT client role, When an application makes a dbus sync request
to BT-Service and is waiting for its reply,
Meanwhile BT-Service encounters GATT disconnection, because of which
it could not send the corresponding replies to application as the
connection info is already removed and thus causing dbus timeout error.

This patch will prevent such situation by sending BLUTOOTH_INTERNAL_ERROR
reply corresponding to all those pending dbus invocations when GATT
disconnection occurs.

Change-Id: Ib1cc93427a0d7156885381174e81616010cf9267
Signed-off-by: Anuj Jain <anuj01.jain@samsung.com>
Signed-off-by: Ayush Garg <ayush.garg@samsung.com>
3 years agoFix the coverity issue (Memory leak) 61/259561/1 accepted/tizen/unified/20210616.132535 submit/tizen/20210610.054148 submit/tizen/20210615.073416
DoHyun Pyun [Wed, 9 Jun 2021 23:25:05 +0000 (08:25 +0900)]
Fix the coverity issue (Memory leak)

Change-Id: I5d8c9e91f73e005606f274d071983d36b49c5b14
Signed-off-by: DoHyun Pyun <dh79.pyun@samsung.com>
3 years agoAdd auto accept and set trusted logic for robot 80/259180/1 accepted/tizen/unified/20210607.124412 submit/tizen/20210606.232858
Wootak Jung [Wed, 2 Jun 2021 02:01:30 +0000 (11:01 +0900)]
Add auto accept and set trusted logic for robot

Change-Id: If99c752a1163c611eb461503093f5b6f4723c5fe

3 years agoAdd robot socket channel 77/259177/3
Wootak Jung [Tue, 1 Jun 2021 00:15:30 +0000 (09:15 +0900)]
Add robot socket channel

Change-Id: Iab39beae121598e659f5e646d306ac7577600269
Signed-off-by: Wootak Jung <wootak.jung@samsung.com>
3 years agoAllow zero length for GATT server write request 03/259003/1
DoHyun Pyun [Mon, 31 May 2021 01:22:11 +0000 (10:22 +0900)]
Allow zero length for GATT server write request

Google's Chromecast app needs to response for zero
length write request in GATT server.

Change-Id: Ie925246c23078c070898f84a5fd8db908d2c854b
Signed-off-by: DoHyun Pyun <dh79.pyun@samsung.com>
3 years agoFix coverty issues 64/258764/1
anuj.bhumiya [Tue, 25 May 2021 08:58:41 +0000 (14:28 +0530)]
Fix coverty issues

Change-Id: I06b246df43582a066d071b899558b9a39b9be57d
Signed-off-by: anuj.bhumiya <anuj.bhumiya@samsung.com>
3 years agoFix the crash issue in FHub product 56/258256/1
DoHyun Pyun [Thu, 13 May 2021 02:40:01 +0000 (11:40 +0900)]
Fix the crash issue in FHub product

0xb60d394a in print_bt_properties (num_properties=1, properties=0xbe2d1160) at /usr/src/debug/bluetooth-frwk-0.6.0/bt-oal/common/oal-utils.c:205
        i = <optimized out>
        __func__ = "print_bt_properties"
Backtrace stopped: Cannot access memory at address 0x2d6c6166

Change-Id: I3dcbafb6ffd1b10a6db41f03df8658653e1d0b27
Signed-off-by: DoHyun Pyun <dh79.pyun@samsung.com>
3 years agoMerge "Mesh: added message response on Node Role" into tizen accepted/tizen/unified/20210427.085752 submit/tizen/20210426.061315
Pyun DoHyun [Mon, 26 Apr 2021 05:53:36 +0000 (05:53 +0000)]
Merge "Mesh: added message response on Node Role" into tizen

3 years agoMesh: added message response on Node Role 26/257126/4
anuj.bhumiya [Mon, 19 Apr 2021 10:00:19 +0000 (15:30 +0530)]
Mesh: added message response on Node Role

This patch implements the message response from node
side to Provisioner node when it receive any message
from provisioner.

Change-Id: Ic70c7589f9328dd80ebcf5de7a76937c9c640e6c
Signed-off-by: anuj.bhumiya <anuj.bhumiya@samsung.com>
3 years agoRemove unnecessary dependency 67/256867/1 accepted/tizen/unified/20210420.002128 submit/tizen/20210419.025911
Wootak Jung [Wed, 14 Apr 2021 04:31:51 +0000 (13:31 +0900)]
Remove unnecessary dependency

Change-Id: Iba251c1e6ce130c9269b0794aaf698ec9ad517eb
Signed-off-by: Wootak Jung <wootak.jung@samsung.com>
3 years agoCorrect the privilege check for BT_UPDATE_LE_CONNECTION_MODE 73/256773/2
DoHyun Pyun [Mon, 12 Apr 2021 23:17:51 +0000 (08:17 +0900)]
Correct the privilege check for BT_UPDATE_LE_CONNECTION_MODE

Change-Id: I974080862a48defc67752e3b3a0f5d23200182db
Signed-off-by: DoHyun Pyun <dh79.pyun@samsung.com>
3 years agoFix gatt attributes not freed issue 09/256509/1
Wootak Jung [Tue, 6 Apr 2021 04:15:36 +0000 (13:15 +0900)]
Fix gatt attributes not freed issue

next pointer should be set before removing gslist

Change-Id: I5a0e13ba2f9d35746a368d6fa42659b40f0ee91a
Signed-off-by: Wootak Jung <wootak.jung@samsung.com>
3 years agoPrevent the buffer overflow error for adv data 86/256386/1
DoHyun Pyun [Thu, 1 Apr 2021 23:04:41 +0000 (08:04 +0900)]
Prevent the buffer overflow error for adv data

0xb239567c in _bt_hal_set_advertising_data (adv_param_setup=...)
 adv_data = "\021\006", '\000' <repeats 14 times>, "\f]\021\006Z\266\f]Z\266\000@Z\266h"
 adv_data_str = "1106", '0' <repeats 29 times>, "C5D11065AB60C5D5AB600405AB668E"
 index = <optimized out>
 proxy = <optimized out>
 error = 0x0
 ret = <optimized out>
 temp = <optimized out>
 builder = <optimized out>
 event = <optimized out>
 length = 36
 i = <optimized out>
 slot_id = <optimized out>
 __func__ = "_bt_hal_set_advertising_data"

Change-Id: I20caf761dd9f006159783ae6eded349e7cc92948
Signed-off-by: DoHyun Pyun <dh79.pyun@samsung.com>
3 years agoMerge "Mesh: Implement Mesh Node Role API's" into tizen accepted/tizen/unified/20210331.054019 submit/tizen/20210330.044039
Pyun DoHyun [Tue, 30 Mar 2021 04:21:33 +0000 (04:21 +0000)]
Merge "Mesh: Implement Mesh Node Role API's" into tizen

3 years agoMesh: Implement Mesh Node Role API's 24/254324/5
anuj.bhumiya [Fri, 26 Feb 2021 11:15:25 +0000 (16:45 +0530)]
Mesh: Implement Mesh Node Role API's

This patch implements the Mesh node role for device.
Join API create a fresh node and set callbacks for join complete
and message execution callbacks.
Cancel API destroy the outgoing request initiated by Join API
and destroy the node from the application

Change-Id: I79fa3c390a08076d84c0e20450f7c32aec1bdf6e
Signed-off-by: anuj.bhumiya <anuj.bhumiya@samsung.com>
3 years agoFix the memory leak 21/255321/1 accepted/tizen/unified/20210317.115839 submit/tizen/20210316.231924
DoHyun Pyun [Tue, 16 Mar 2021 23:42:31 +0000 (08:42 +0900)]
Fix the memory leak

Change-Id: I95cc117fbc4ac314712f9e1e60e23d5cafd7e4ba
Signed-off-by: DoHyun Pyun <dh79.pyun@samsung.com>
3 years agoFix gatt handle number limitation issue 84/255184/6
Wootak Jung [Mon, 15 Mar 2021 04:41:41 +0000 (13:41 +0900)]
Fix gatt handle number limitation issue

Change-Id: I69771df30f0f3b6aa9f4be2bd9dacbd392bcda92
Signed-off-by: Wootak Jung <wootak.jung@samsung.com>
3 years agoSet trusted profile/device in ACCEPT_ALWAYS authorization case 62/254362/2 accepted/tizen/unified/20210303.130739 submit/tizen/20210303.003641
Ayush Garg [Mon, 1 Mar 2021 13:00:11 +0000 (18:30 +0530)]
Set trusted profile/device in ACCEPT_ALWAYS authorization case

If ACCEPT_ALWAYS option is selected in authorization popup,
This change will set Profile as trusted if the profile is
PBAP, MAP or SAP. Otherwise it will put device in the
trusted list.
This will allow the user to connect automatically
in future connections without asking for authorization.

Change-Id: I2033f34b8436987d4c4ea87db57c2193cfa7c34c
Signed-off-by: Ayush Garg <ayush.garg@samsung.com>
3 years agoMove haltest package to hal-api-bluetooth 20/253320/1 accepted/tizen/unified/20210218.042134 submit/tizen/20210216.223518
DoHyun Pyun [Mon, 8 Feb 2021 23:34:07 +0000 (08:34 +0900)]
Move haltest package to hal-api-bluetooth

Change-Id: I07ffaf4219c460fd5c3d053733b333efdee51669
Signed-off-by: DoHyun Pyun <dh79.pyun@samsung.com>
3 years agoChange systemd-devel package name 95/252895/1 accepted/tizen/unified/20210209.124408 submit/tizen/20210208.225345
INSUN PYO [Wed, 3 Feb 2021 04:27:36 +0000 (13:27 +0900)]
Change systemd-devel package name

Change-Id: I6b6b7b00cb866600c62a1bb1e76c860ac55b5b66

3 years agoGATT: Clear g_pending_write_list when GATT disconnection occurs 78/252678/2 accepted/tizen/unified/20210203.145608 submit/tizen/20210201.221911
Ayush Garg [Mon, 1 Feb 2021 08:54:08 +0000 (14:24 +0530)]
GATT: Clear g_pending_write_list when GATT disconnection occurs

This change will clear all the pending prepare_write_request
for a specific connection id when abrupt disconnection occurs
during GATT long write operation.

Change-Id: I6576329cb9d560c37f3d2b89243fa1f957424918
Signed-off-by: Ayush Garg <ayush.garg@samsung.com>
3 years agoFix the received-bytes merged issue 10/252510/1 accepted/tizen/unified/20210201.130258 submit/tizen/20210201.015438
Wootak Jung [Fri, 29 Jan 2021 05:06:11 +0000 (14:06 +0900)]
Fix the received-bytes merged issue

When multiple write-data come on fd in continuously, the data merged.

- reproduction sequnce
1. makes gatt connection
2. writes on characteristic continuously in client side
3. received-data merged on write_value_requested_cb

Change-Id: Ieed5e2a115220d9ebfa48eae03fbf45ebb4402d5
Signed-off-by: Wootak Jung <wootak.jung@samsung.com>
3 years agoMerge "GATT: Handle prepare_authorize parameter in WriteValue DBUS API" into tizen accepted/tizen/unified/20210128.132338 submit/tizen/20210127.232224
Pyun DoHyun [Wed, 27 Jan 2021 23:02:17 +0000 (23:02 +0000)]
Merge "GATT: Handle prepare_authorize parameter in WriteValue DBUS API" into tizen

3 years agoMerge "Implement Long Write Operations for Tizen TV" into tizen
Pyun DoHyun [Wed, 27 Jan 2021 23:02:13 +0000 (23:02 +0000)]
Merge "Implement Long Write Operations for Tizen TV" into tizen

3 years agoGATT: Handle prepare_authorize parameter in WriteValue DBUS API 05/252405/2
Ayush Garg [Wed, 27 Jan 2021 14:15:59 +0000 (19:45 +0530)]
GATT: Handle prepare_authorize parameter in WriteValue DBUS API

In GATT Server role, prepare_authorize parameter will be set
when bluez wants authorization permission from the application when
ATT_PREPARE_WRITE_REQUEST PDU receive for the first time in case
of long write.

This is an initial patchset to parse prepare_authorize parameter from
bluez and avoid crash. Subsequent patches will be added to handle
authorization completely.

This patchset should be merged with the following bluez's patchset
in order to match API and avoid crash:
bluez Change-Id: I93bc46151ebbe695c74b224c3a3579c6e5d0de14

Change-Id: Ic4397ae86760177e08ccd283e80d4526bd32e0c4
Signed-off-by: Ayush Garg <ayush.garg@samsung.com>
3 years agoImplement Long Write Operations for Tizen TV 42/252142/4
Ayush Garg [Sat, 23 Jan 2021 09:20:06 +0000 (14:50 +0530)]
Implement Long Write Operations for Tizen TV

In Tizen Platform, For long write operations, bluez handles
all the ATT_Prepare_Write_Req packets and sends the complete
data to the BT-Service when ATT_EXEC_WRITE_REQ is received.

Where as in Tizen TV, Bluedroid works in a different manner.
It sends every ATT_Prepare_Write_Req packet to bt-service using
OAL_EVENT_GATTS_REQUEST_WRITE event with flag is_prep=1 and thus,
allows upper layers to handle long write operation on its own.

This change will perform all the below operations(in case of bluedroid)
at bt-service level which bluez performs for GATT long write:
1. Appending all the Prepare_Write_Req data in a list and send
   prepare_write_resp.
2. Passing the complete data to the capi when
   OAL_EVENT_GATTS_EXEC_REQUEST_WRITE event comes.

Thus this change will help in maintaining uniformity at CAPI level
irrespective of Bluez or Bluedroid.

Change-Id: Iae005dc3643d54783dbd3ddd8c1dc70a1684be99
Signed-off-by: Ayush Garg <ayush.garg@samsung.com>
3 years agoAdd stack down functionality in bt-core 19/252219/6
Wootak Jung [Tue, 26 Jan 2021 01:26:42 +0000 (10:26 +0900)]
Add stack down functionality in bt-core

it's better to use actd instead of script

Change-Id: I0fbaf022fe7597c46d295a3edb84928ac338b1b6
Signed-off-by: Wootak Jung <wootak.jung@samsung.com>
3 years agoMerge "GATT: Fix bug in GATT Send indication" into tizen
Pyun DoHyun [Mon, 25 Jan 2021 00:23:39 +0000 (00:23 +0000)]
Merge "GATT: Fix bug in GATT Send indication" into tizen

3 years agoGATT: Fix bug in GATT Send indication 65/252065/1
Anupam Roy [Fri, 22 Jan 2021 07:14:33 +0000 (12:44 +0530)]
GATT: Fix bug in GATT Send indication

Issue: When remote device address is NULL,
fd is searched in fd list and returned error if not found.
But, it is possible that, fd is not found because,
GATT characteristic attribute is not acquired by stack.
In such case, currently, GATT FRWK is wrongly missing to send
GATT indication to remote device.

Fix: Handle GATT send indication in following way
- If device address is valid unicast, send DBUS indication
- If device addres is NULL or "00:00:00:00:00:00"
    a/ First, try to find fd for multicast over socket
    b/ if fd not found, fallback to multicast over DBUS

Change-Id: Ib0e4b9d49ca3a6f3b75d8a691a1a01750152893b
Signed-off-by: Anupam Roy <anupam.r@samsung.com>
3 years agoApply next HAL architecture 83/251483/5
Wootak Jung [Thu, 14 Jan 2021 07:38:49 +0000 (16:38 +0900)]
Apply next HAL architecture

Add cap_sys_module capability to bt-core

Change-Id: I428e77e429c277d21d8ba41dc8f7e4ce7d477b8e
Signed-off-by: Wootak Jung <wootak.jung@samsung.com>
3 years agoMerge "Revert "Fix svace issues"" into tizen accepted/tizen/unified/20210122.123002 submit/tizen/20210121.232353
Pyun DoHyun [Wed, 13 Jan 2021 04:27:59 +0000 (04:27 +0000)]
Merge "Revert "Fix svace issues"" into tizen

3 years agoRevert "Fix svace issues" 57/251357/1
Wootak Jung [Wed, 13 Jan 2021 03:48:28 +0000 (12:48 +0900)]
Revert "Fix svace issues"

This reverts commit e4ce93a114e464d34a1b59cba44848ecc54ae4da.

Change-Id: I4456ccd2a34e343cd543bb57a15cf4c4c49a6375
Signed-off-by: Wootak Jung <wootak.jung@samsung.com>
3 years agoFix memory leak 18/251318/1
anuj.bhumiya [Tue, 12 Jan 2021 06:00:44 +0000 (11:30 +0530)]
Fix memory leak

Change-Id: If43686456767f74d95fc879b99551ef4a07957ae
Signed-off-by: anuj.bhumiya <anuj.bhumiya@samsung.com>
3 years agoMerge "mesh: update interface registration return statements" into tizen
Pyun DoHyun [Tue, 29 Dec 2020 21:26:57 +0000 (21:26 +0000)]
Merge "mesh: update interface registration return statements" into tizen

3 years agoMerge "mesh: get/set IV index" into tizen
Pyun DoHyun [Tue, 29 Dec 2020 21:26:44 +0000 (21:26 +0000)]
Merge "mesh: get/set IV index" into tizen

3 years agoMerge "mesh: Add options to Send/DevKeySend" into tizen
Pyun DoHyun [Tue, 29 Dec 2020 21:26:26 +0000 (21:26 +0000)]
Merge "mesh: Add options to Send/DevKeySend" into tizen

3 years agoMerge "mesh: Add options to "Models" property" into tizen
Pyun DoHyun [Tue, 29 Dec 2020 21:26:17 +0000 (21:26 +0000)]
Merge "mesh: Add options to "Models" property" into tizen

3 years agomesh: update interface registration return statements 58/250558/1
Abhay Agarwal [Tue, 22 Dec 2020 10:44:35 +0000 (16:14 +0530)]
mesh: update interface registration return statements

Change-Id: Ic1798ce698a6a8b5e340fd9f46546c5d7299f592
Signed-off-by: Abhay Agarwal <ay.agarwal@samsung.com>
3 years agoDisplay yes/no popup for RequestAuthorization request 51/250351/2 accepted/tizen/unified/20201229.124650 submit/tizen/20201228.031005
Sangki Park [Tue, 22 Dec 2020 10:55:11 +0000 (19:55 +0900)]
Display yes/no popup for RequestAuthorization request

[Model] Wearable
[BinType] AP
[Customer] ALL

[Issue#] N/A
[Request] N/A
[Occurrence Version] N/A

[Problem] A pairing request is accepted on bluez automatically if
the I/O capability of peer device is No-Input-No-Output
[Cause & Measure] Security hole issue. To prevent, bt-frwk will launch
a bt-syspopup for user confirmation.
[Checking Method] receive a pairing request with No-Input-No-Output mode

[Team] Bluetooth
[Developer] Deokhyun Kim
[Solution company] Samsung
[Change Type] Specification change

Change-Id: I0d8609512bf6d8af9f0ddadcd397688c47502dc5
Signed-off-by: Deokhyun Kim <dukan.kim@samsung.com>
3 years agoMerge "Audio: Handle Profile Connection in progress error" into tizen
Pyun DoHyun [Thu, 24 Dec 2020 01:29:25 +0000 (01:29 +0000)]
Merge "Audio: Handle Profile Connection in progress error" into tizen

3 years agoAudio: Handle Profile Connection in progress error 70/250170/2
Anupam Roy [Sun, 20 Dec 2020 17:01:39 +0000 (22:31 +0530)]
Audio: Handle Profile Connection in progress error

Currently, bt-service does not check
if connection request for same device is
already under progress. This allows queuing
up multiple same requests in pending request list.
At the time of replying DBUS context, only one
request is returned & other requests are not freed.
In this patch, BLUETOOTH_ERROR_IN_PROGRESS error
is returned if same profile connection request
is pending.

Change-Id: I1e8ea43d8dc06e73b928c099bab8efc992b4125d
Signed-off-by: Anupam Roy <anupam.r@samsung.com>
3 years agomesh: get/set IV index 57/250557/1
Abhay Agarwal [Mon, 21 Dec 2020 10:44:44 +0000 (16:14 +0530)]
mesh: get/set IV index

This adds keeping track of IV index changes.
The updates are detected by observing PropertiesChanged signal
on local node's object path and reading "IvIndex" property.

Change-Id: I96d26f4aa6ba9bf2355fd6039b8b87ffaa30baad
Signed-off-by: Abhay Agarwal <ay.agarwal@samsung.com>
3 years agomesh: Add options to Send/DevKeySend 56/250556/1
Abhay Agarwal [Fri, 18 Dec 2020 10:36:06 +0000 (16:06 +0530)]
mesh: Add options to Send/DevKeySend

This adds a new dictionary paramenter (empty by default) when
invoking Send() and DevKeySend() methods.

Change-Id: I3366ef016140a8531bd2f1a8ceb6fe6d6a073719
Signed-off-by: Abhay Agarwal <ay.agarwal@samsung.com>
3 years agomesh: Add options to "Models" property 55/250555/1
anuj.bhumiya [Fri, 18 Dec 2020 06:55:04 +0000 (12:25 +0530)]
mesh: Add options to "Models" property

This adds options dictionary to "Models" property to stay
in sync with mesh-api changes.

Change-Id: Ie36b492c55e096330b8101795be5129e4c394733
Signed-off-by: Abhay Agarwal <ay.agarwal@samsung.com>
3 years agoIncreases the number of gatt attributes 55/249955/2
Wootak Jung [Fri, 18 Dec 2020 00:13:03 +0000 (09:13 +0900)]
Increases the number of gatt attributes

There is a conflict in att handle number
in case many characteristics are added like below

/com/1/service11/characteristic22/descriptor33
/com/1/service15/characteristic33

Change-Id: I30c79e9ca9588a6b65648797b9dee42b867cbd85
Signed-off-by: Wootak Jung <wootak.jung@samsung.com>
3 years agoFix svace issues 20/248720/1 accepted/tizen/unified/20201202.124927 submit/tizen/20201202.002505
Wootak Jung [Tue, 1 Dec 2020 23:57:38 +0000 (08:57 +0900)]
Fix svace issues

Change-Id: Iaa7584addb4a92bb6df9751005596489fc3ac314
Signed-off-by: Wootak Jung <wootak.jung@samsung.com>
3 years agoFix tds data check logic 75/248475/1
Wootak Jung [Fri, 27 Nov 2020 04:29:17 +0000 (13:29 +0900)]
Fix tds data check logic

length can be -1 if tds data is NULL

Change-Id: I8c601d24ef421cde142b99f7f8d21bfa8420f7f5
Signed-off-by: Wootak Jung <wootak.jung@samsung.com>
4 years agoFix the issue on AppControl share (BT) operation 65/247865/1 accepted/tizen/unified/20201119.125144 submit/tizen/20201118.015920
DoHyun Pyun [Tue, 17 Nov 2020 02:07:19 +0000 (11:07 +0900)]
Fix the issue on AppControl share (BT) operation

ug-bluetooth-efl did not have a permission to allow the dbus
method call to bt-share. This patchset adds the policy for it.

Change-Id: I7938e9d2dd6d0b374554e59d92705021beefc3a7
Signed-off-by: DoHyun Pyun <dh79.pyun@samsung.com>
4 years agoModify TDS transport type enums 38/247638/1
Wootak Jung [Fri, 13 Nov 2020 02:55:25 +0000 (11:55 +0900)]
Modify TDS transport type enums

Change-Id: I6b30a330133b103c663af5f100d4f5e7c19b2526
Signed-off-by: Wootak Jung <wootak.jung@samsung.com>
4 years agoAdd common TDS method call function 25/247625/1
Wootak Jung [Fri, 13 Nov 2020 01:34:22 +0000 (10:34 +0900)]
Add common TDS method call function

Change-Id: I6b45814ec4cfcc3f6e10996616cab49603fc0809
Signed-off-by: Wootak Jung <wootak.jung@samsung.com>
4 years agoAdd TDS transport type 32/247532/1 accepted/tizen/unified/20201113.130833 submit/tizen/20201113.003453
Wootak Jung [Thu, 12 Nov 2020 02:21:43 +0000 (11:21 +0900)]
Add TDS transport type

Change-Id: I597ec768551fc0a8d68462f27f988e3c9ec41589
Signed-off-by: Wootak Jung <wootak.jung@samsung.com>
4 years agoFix advertising interval value 30/247530/1
Wootak Jung [Thu, 12 Nov 2020 02:06:53 +0000 (11:06 +0900)]
Fix advertising interval value

Change-Id: Iccdcde94bf93b9689e41edbfa7a34114de470219
Signed-off-by: Wootak Jung <wootak.jung@samsung.com>
4 years agoMerge "Implement TDS functionalities" into tizen accepted/tizen/unified/20201112.124133 submit/tizen/20201112.015956
Pyun DoHyun [Thu, 12 Nov 2020 01:44:14 +0000 (01:44 +0000)]
Merge "Implement TDS functionalities" into tizen

4 years agoImplement TDS functionalities 87/246487/2
Wootak Jung [Fri, 30 Oct 2020 03:14:22 +0000 (12:14 +0900)]
Implement TDS functionalities

Change-Id: I5cb28e6ac1f43ae94a17c8fc0faf266c97b27b55
Signed-off-by: Wootak Jung <wootak.jung@samsung.com>
4 years agoTake BLE Advertising Interval min & max parameters in 0.625ms unit 15/247215/1 accepted/tizen/unified/20201111.124819 submit/tizen/20201109.212850
Ayush Garg [Sat, 7 Nov 2020 06:44:42 +0000 (12:14 +0530)]
Take BLE Advertising Interval min & max parameters in 0.625ms unit

Till now, the Ble advertsing interval min and max values were taken in the ms unit.
According to specs, the actual time value can be in decimal (ex: 28.125ms) but such cases are not properly handled currently.
So these changes will allow to take input in 0.625ms units.

Change-Id: Ia052cdc456aae067a6a453eac0a3780b9c59e9fd
Signed-off-by: Ayush Garg <ayush.garg@samsung.com>
4 years agoImplement RSSI scan filter 26/246526/1 accepted/tizen/unified/20201103.051959 submit/tizen/20201102.065935
Ayush Garg [Thu, 29 Oct 2020 11:21:29 +0000 (16:51 +0530)]
Implement RSSI scan filter

Change-Id: I7a443de481083328dc691c252188092a5559871d
Signed-off-by: ayushgrg04 <ayush.garg@samsung.com>
4 years agoFix LE discovery state miss-matching issue 24/245924/1 accepted/tizen/unified/20201029.125006 submit/tizen/20201027.003129
DoHyun Pyun [Tue, 20 Oct 2020 02:39:49 +0000 (11:39 +0900)]
Fix LE discovery state miss-matching issue

Change-Id: I30300567d185d493f840217706f7011d9ebb72a2
Signed-off-by: DoHyun Pyun <dh79.pyun@samsung.com>
4 years agoMerge "Handle AVRCP control function as A2DP connect for TV stack" into tizen
Pyun DoHyun [Wed, 14 Oct 2020 02:16:32 +0000 (02:16 +0000)]
Merge "Handle AVRCP control function as A2DP connect for TV stack" into tizen

4 years agoGATT: Refactor Sever Indication logic 69/245569/1
Anupam Roy [Mon, 12 Oct 2020 06:12:59 +0000 (11:42 +0530)]
GATT: Refactor Sever Indication logic

This patch handles following:-
- Use socket for multicast indication
& fallback to DBUS for unicast indication.
- Send Remote Client address from HAL to FRWK
when indication is enabled by remote client.

Change-Id: Idacecd5a28afab1b22b9588f092ed75ea95d9070
Signed-off-by: Anupam Roy <anupam.r@samsung.com>
4 years agoHandle AVRCP control function as A2DP connect for TV stack 50/245550/1
DoHyun Pyun [Mon, 12 Oct 2020 07:36:56 +0000 (16:36 +0900)]
Handle AVRCP control function as A2DP connect for TV stack

VD stack does not implement AVRCP control connect API. And
it uses the automatic connection after connecting A2DP.
But AVRCP Control connect C# API is exposed. And we should
handle it by TCT. To PASS it, we replace the function into
service adaptation layer.

Change-Id: Ic81a5d0d595b14e9608bd75b5a7b5ef47c1b199d
Signed-off-by: DoHyun Pyun <dh79.pyun@samsung.com>
4 years agoModify Avrcp Control getting function privilege 22/245522/1
Wootak Jung [Mon, 12 Oct 2020 02:46:52 +0000 (11:46 +0900)]
Modify Avrcp Control getting function privilege

Change-Id: I62cdb30e4a8f1a415a71b7835e9582e8ee319bb9
Signed-off-by: Wootak Jung <wootak.jung@samsung.com>
4 years agoSet permanent log buffer size to 512 Bytes 30/244930/1
Deokhyun Kim [Mon, 28 Sep 2020 05:06:38 +0000 (14:06 +0900)]
Set permanent log buffer size to 512 Bytes

Change-Id: I201477ac209e8ed118924e7280da864c6c973414
Signed-off-by: Deokhyun Kim <dukan.kim@samsung.com>
4 years agoMerge "Enable advertising after gatt server is connected" into tizen accepted/tizen_6.0_unified_hotfix tizen_6.0_hotfix accepted/tizen/6.0/unified/20201030.120317 accepted/tizen/6.0/unified/hotfix/20201103.045831 accepted/tizen/unified/20200923.093730 submit/tizen/20200917.075044 submit/tizen/20200923.005759 submit/tizen_6.0/20201029.205103 submit/tizen_6.0_hotfix/20201102.192503 submit/tizen_6.0_hotfix/20201103.114803 tizen_6.0.m2_release
Pyun DoHyun [Thu, 17 Sep 2020 07:35:19 +0000 (07:35 +0000)]
Merge "Enable advertising after gatt server is connected" into tizen

4 years agoMerge "Fix the coverity issues" into tizen
Pyun DoHyun [Thu, 17 Sep 2020 07:34:58 +0000 (07:34 +0000)]
Merge "Fix the coverity issues" into tizen

4 years agoMesh: Fix coverity issues 00/244300/1
Abhay Agarwal [Thu, 17 Sep 2020 05:12:05 +0000 (10:42 +0530)]
Mesh: Fix coverity issues

Change-Id: I0f10756c1e4ee5c66da595df29976870eed561f0
Signed-off-by: Abhay Agarwal <ay.agarwal@samsung.com>
4 years agoFix the coverity issues 84/244284/1
DoHyun Pyun [Wed, 16 Sep 2020 23:05:45 +0000 (08:05 +0900)]
Fix the coverity issues

Change-Id: I1998c8489a074fbaab3d4e9e1aa567db3b3f4f3e
Signed-off-by: DoHyun Pyun <dh79.pyun@samsung.com>
4 years agoEnable advertising after gatt server is connected 77/244177/2
Amit Purwar [Tue, 15 Sep 2020 12:49:01 +0000 (18:19 +0530)]
Enable advertising after gatt server is connected

This enables advertising on gatt server after gatt server
is connecteed with the remote gatt client. Advertisement slot
is allocated from slot-1 when multi advertisement is supported.

Change-Id: Ie6a6aee5cb21d6abfe56cfb5049428a29cf06d79
Signed-off-by: Amit Purwar <amit.purwar@samsung.com>
4 years agoMerge "Remove the obex unregister function" into tizen accepted/tizen/unified/20200915.014647 submit/tizen/20200914.220529
Pyun DoHyun [Mon, 14 Sep 2020 21:50:47 +0000 (21:50 +0000)]
Merge "Remove the obex unregister function" into tizen

4 years agoRemove the obex unregister function 32/244032/1
DoHyun Pyun [Mon, 14 Sep 2020 07:51:59 +0000 (16:51 +0900)]
Remove the obex unregister function

The previous code removes the obex server agent, when the interface
is removed. But the obex agent should unregister called obex deinit
function.

Change-Id: Ice17b1be0f89b133d246b5c180d5b1469355625d
Signed-off-by: DoHyun Pyun <dh79.pyun@samsung.com>
4 years agoAdd shared connection unref logic 01/244001/1
Wootak Jung [Mon, 14 Sep 2020 02:09:03 +0000 (11:09 +0900)]
Add shared connection unref logic

g_object_unref is required not only private conn but also shared conn

Change-Id: I504b3408158fc99aca36c4b9f08caed150949f48
Signed-off-by: Wootak Jung <wootak.jung@samsung.com>
4 years agoMerge "Use shared connection instead of private connection" into tizen
Pyun DoHyun [Sun, 13 Sep 2020 22:54:24 +0000 (22:54 +0000)]
Merge "Use shared connection instead of private connection" into tizen

4 years agoMerge "Mesh: Add generic mesh messages opcodes" into tizen accepted/tizen/unified/20200914.131331 submit/tizen/20200913.230045
Pyun DoHyun [Sun, 13 Sep 2020 22:21:26 +0000 (22:21 +0000)]
Merge "Mesh: Add generic mesh messages opcodes" into tizen