platform/core/connectivity/bluetooth-frwk.git
20 months agoFix Coverity Issue 29/299529/1 accepted/tizen_6.0_unified tizen_6.0 accepted/tizen/6.0/unified/20231010.005230
Anuj Kumar Singh [Mon, 19 Jun 2023 10:39:21 +0000 (16:09 +0530)]
Fix Coverity Issue

This patch fix the below coverity issue:
CID-1681323

Change-Id: I280653b636d73dacbd8d20fc0294da603668aa34
Signed-off-by: Anuj Kumar Singh <anujk.singh@samsung.com>
20 months agoFix remote device address in case of l2cap connection timeout 28/299528/1
Ayush Garg [Fri, 28 Apr 2023 10:59:31 +0000 (16:29 +0530)]
Fix remote device address in case of l2cap connection timeout

This patch will fill the correct remote address in the
connectionStateChangedCb when the le coc socket connection
got timeout error.

Change-Id: I483380029091ed9e1f8956132d44aca9f1fbba20
Signed-off-by: Ayush Garg <ayush.garg@samsung.com>
20 months agoFix remote device address in connectionStateChangedCb 27/299527/1
Ayush Garg [Mon, 26 Dec 2022 10:12:49 +0000 (15:42 +0530)]
Fix remote device address in connectionStateChangedCb

This patch will fill the correct remote address in the
connectionStateChangedCb when the socket connection got failed.

Change-Id: I1d468408b6e3afca3f26e3935cc9bb84de7af43f
Signed-off-by: Ayush Garg <ayush.garg@samsung.com>
20 months agoRefactoring of Code to improve SAM score Patch-5 26/299526/1
Anuj Jain [Wed, 31 Aug 2022 16:34:35 +0000 (22:04 +0530)]
Refactoring of Code to improve SAM score Patch-5

Remove Duplicate code:

- Move duplicate functions to common accessible file.
- Implement new function in common file for duplicate code segment.

Change-Id: Id2e205e587a21e195aba7474b9165f8ac36b06b7
Signed-off-by: Anuj Jain <anuj01.jain@samsung.com>
20 months agoModify authorize to FALSE in l2cap le connection 26/299426/2
Wootak Jung [Tue, 9 Aug 2022 04:19:22 +0000 (13:19 +0900)]
Modify authorize to FALSE in l2cap le connection

To avoid build conflict please merge this patch after merging bluez
patch:(Change-Id: I7f4f6ba5fe49b6d3fa05bfbc3a1b2bfdd269c6bb)

Change-Id: Icf4d8a51acc444765a9b61224a3a5d3fd26bfa65
Signed-off-by: Anuj Jain <anuj01.jain@samsung.com>
20 months agoLE CoC: rename function g_memdup2 to g_memdup 25/299425/2
Anuj Jain [Mon, 25 Sep 2023 05:46:30 +0000 (11:16 +0530)]
LE CoC: rename function g_memdup2 to g_memdup

To avoid build conflict please merge this patch after merging bluez
patch:(Change-Id: I7f4f6ba5fe49b6d3fa05bfbc3a1b2bfdd269c6bb)

Change-Id: I23da74af508b0c7c55225eb2e4e8bb112adbae6f
Signed-off-by: Anuj Jain <anuj01.jain@samsung.com>
20 months agoLE CoC: Fix LE_L2CAP socket connection timeout issue 24/299424/2
Anuj Jain [Mon, 4 Apr 2022 12:53:02 +0000 (18:23 +0530)]
LE CoC: Fix LE_L2CAP socket connection timeout issue

This patch fixes the issue of non occurence of authentication
pop-up upon connection request by client.

To avoid build conflict please merge this patch after merging bluez
patch:(Change-Id: I7f4f6ba5fe49b6d3fa05bfbc3a1b2bfdd269c6bb)

Change-Id: Iea5e1807c6c577baf8fe9b43da4053df97bbbc0b
Signed-off-by: Anuj Jain <anuj01.jain@samsung.com>
20 months agoLE CoC: Fix socket events not coming in client role 23/299423/2
Ayush Garg [Wed, 16 Mar 2022 07:25:18 +0000 (12:55 +0530)]
LE CoC: Fix socket events not coming in client role

This patch will add the support for registering
L2CAP LE socket client events.

To avoid build conflict please merge this patch after merging bluez
patch:(Change-Id: I7f4f6ba5fe49b6d3fa05bfbc3a1b2bfdd269c6bb)

Change-Id: If991e7f5ed3cb2b79070fbc6daceff47482b70fe
Signed-off-by: Ayush Garg <ayush.garg@samsung.com>
Signed-off-by: Anuj Jain <anuj01.jain@samsung.com>
20 months agoLE CoC: Fix build issue for aarch64 22/299422/2
Ayush Garg [Mon, 14 Mar 2022 06:39:44 +0000 (12:09 +0530)]
LE CoC: Fix build issue for aarch64

To avoid build conflict please merge this patch after merging bluez
patch:(Change-Id: I7f4f6ba5fe49b6d3fa05bfbc3a1b2bfdd269c6bb)

Change-Id: I2fc506e2ca46803d20275d4ec91c4693caee04be
Signed-off-by: Ayush Garg <ayush.garg@samsung.com>
Signed-off-by: Anuj Jain <anuj01.jain@samsung.com>
20 months agoLE CoC: Add FRWK APIs for L2CAP_LE type socket 21/299421/2
Ayush Garg [Mon, 7 Mar 2022 06:28:00 +0000 (11:58 +0530)]
LE CoC: Add FRWK APIs for L2CAP_LE type socket

This patch adds the following:
- Export APIs to create and remove L2CAP_LE socket
- Export APIs to listen, connect and disconnect to
L2CAP_LE socket
- Implement event handler for connection, disconnection
and authorization.

To avoid build conflict please merge this patch after merging bluez
patch:(Change-Id: I7f4f6ba5fe49b6d3fa05bfbc3a1b2bfdd269c6bb)

Change-Id: I7808664b833da9f0625b75d7fe4640fdd3cd52b3
Signed-off-by: Ayush Garg <ayush.garg@samsung.com>
Signed-off-by: Anuj Jain <anuj01.jain@samsung.com>
20 months agoLE CoC: Add support for L2CAP_LE type socket in bt-service 20/299420/2
Ayush Garg [Wed, 23 Feb 2022 10:58:48 +0000 (16:28 +0530)]
LE CoC: Add support for L2CAP_LE type socket in bt-service

This patch adds the following:
- Implement methods to connect and listen to SOCK_TYPE_L2CAP_LE
Socket.
- Implement methods to authorize(accept/reject) incoming L2CAP_LE
connection.

To avoid build conflict please merge this patch after merging bluez
patch: (Change-Id: I7f4f6ba5fe49b6d3fa05bfbc3a1b2bfdd269c6bb)

Change-Id: If47da01dc9a867d892ced3f847927213da9b66cf
Signed-off-by: Ayush Garg <ayush.garg@samsung.com>
Signed-off-by: Anuj Jain <anuj01.jain@samsung.com>
20 months agoLE CoC: Add support for L2CAP_LE type socket in OAL 19/299419/2
Ayush Garg [Mon, 21 Feb 2022 10:44:26 +0000 (16:14 +0530)]
LE CoC: Add support for L2CAP_LE type socket in OAL

This patch adds support for OAL_SOCK_L2CAP_LE type
socket.

To avoid build conflict please merge this patch after merging bluez
patch: (Change-Id: I7f4f6ba5fe49b6d3fa05bfbc3a1b2bfdd269c6bb)

Change-Id: I190535687e7eb312535b5ff5584f51fcac47ec38
Signed-off-by: Ayush Garg <ayush.garg@samsung.com>
Signed-off-by: Anuj Jain <anuj01.jain@samsung.com>
20 months agoLE CoC: Add HAL implementation for L2CAP_LE type socket 18/299418/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

To avoid build conflict please merge this patch after merging bluez
patch: (Change-Id: I7f4f6ba5fe49b6d3fa05bfbc3a1b2bfdd269c6bb)

Change-Id: Ifd4297f77a327ded5b7f51a3bc56c72f1416c9f1
Signed-off-by: Ayush Garg <ayush.garg@samsung.com>
Signed-off-by: Anuj Jain <anuj01.jain@samsung.com>
2 years agoFix gatt attributes not freed issue 71/281571/1 accepted/tizen/6.0/unified/20220921.073130 submit/tizen_6.0/20220920.065522
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>
2 years agoFix gatt handle number limitation issue 70/281570/1
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>
2 years agoIncreases the number of gatt attributes 69/281569/1
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>
2 years agoFix the crash issue when name changed 07/278907/1 accepted/tizen/6.0/unified/20220901.111308 submit/tizen_6.0/20220831.064432
Wootak Jung [Thu, 28 Jul 2022 01:48:19 +0000 (10:48 +0900)]
Fix the crash issue when name changed

Change-Id: Ie2f9290f250d1def551c6c31272970c832ce36ed

2 years agoFix paired device array exceed issue 05/278905/2
Wootak Jung [Wed, 27 Jul 2022 23:28:30 +0000 (08:28 +0900)]
Fix paired device array exceed issue

bt-hal-adapter-dbus-handler.c: __bt_adapter_bonded_devices_cb(1765) >\
Send Adapter properties changed event to HAL user, Num Prop [1] total size [1031]

Change-Id: I516b66587484c4a4ace363a34bf497ef319515b7

3 years agoFix bt-service crash issue in FHub product 48/274848/1 accepted/tizen/6.0/unified/20220516.133708 submit/tizen_6.0/20220515.232700
Anuj Jain [Fri, 6 May 2022 07:19:32 +0000 (12:49 +0530)]
Fix bt-service crash issue in FHub product

This patch fixes bt-service crash occuring due to array overflow.

Change-Id: Idde2cccd6e31c2c5fdafc06add7fff6745339fcd
Signed-off-by: Anuj Jain <anuj01.jain@samsung.com>
3 years agoFix crash issue in FHub product 31/274531/1 submit/tizen_6.0/20220502.051452
Ayush Garg [Wed, 27 Apr 2022 10:25:45 +0000 (15:55 +0530)]
Fix crash issue in FHub product

Backtrace:
4  0xb62d7a4e in g_malloc0 (n_bytes=n_bytes@entry=4294967295) at ../glib/gmem.c:134 --> libglib (rpm)
5  0x00472432 in __bt_set_multi_adv_param (adv_setup=adv_setup@entry=0xbe0db954, adv_data=adv_data@entry=0xbe0dba5c, length=length@entry=2) at /usr/src/debug/bluetooth-frwk-0.6.0/bt-service/services/adapter/bt-service-core-adapter-le.c:1467 --> bluetooth-frwk-service (rpm)
6  0x004729b4 in _bt_set_scan_response_data (sender=0x518228 ":1.108", adv_handle=5764800, response=response@entry=0xbe0dba5c, length=2, use_reserved_slot=use_reserved_slot@entry=0) at /usr/src/debug/bluetooth-frwk-0.6.0/bt-service/services/adapter/bt-service-core-adapter-le.c:1768 --> bluetooth-frwk-service (rpm)

The crash was occuring due to incorrect manufacturer
length.
This patch fixes the same.

Change-Id: I16cfd653e46615ed5fa386a6e8281591526ff689
Signed-off-by: Ayush Garg <ayush.garg@samsung.com>
3 years agoFix the ADV crash issue in FHub product 38/274338/2
Ayush Garg [Tue, 26 Apr 2022 10:26:15 +0000 (15:56 +0530)]
Fix the ADV crash issue in FHub product

Backtrace:
0  0xb2c5a112 in __bt_hal_parse_uuid (len=len@entry=44300, src=0x0, src@entry=0x102 <error: Cannot access memory at address 0x102>, dest=dest@entry=0xbe3747b4 "", length=0xbe3747ac, length@entry=0xbe37478c, is_solicit=is_solicit@entry=1) at /usr/include/bits/string_fortified.h:34 --> bluetooth-frwk-oal (rpm)
1  0xb2c5b2d2 in _bt_hal_set_advertising_data (adv_param_setup=...) at /usr/src/debug/bluetooth-frwk-0.6.0/bt-oal/bluez_hal/src/bt-hal-adapter-le.c:802 --> bluetooth-frwk-oal (rpm)

The crash was occuring due to parsing of wrong appearance
characteristic length.
This patch fixes the same.

Change-Id: I48524f69158b7fd3ac01811f05f2d9dbfe139fc6
Signed-off-by: Ayush Garg <ayush.garg@samsung.com>
Signed-off-by: Dohyun Pyun <dh79.pyun@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

4 years agoMerge "Mesh: Remove duplicate code" into tizen
Pyun DoHyun [Sun, 13 Sep 2020 22:21:22 +0000 (22:21 +0000)]
Merge "Mesh: Remove duplicate code" into tizen

4 years agoMerge "Mesh: Disallow group deletion if it is in use" into tizen
Pyun DoHyun [Sun, 13 Sep 2020 22:21:19 +0000 (22:21 +0000)]
Merge "Mesh: Disallow group deletion if it is in use" into tizen

4 years agoMerge "Mesh: Maintain group subscription list in cdb" into tizen
Pyun DoHyun [Sun, 13 Sep 2020 22:21:16 +0000 (22:21 +0000)]
Merge "Mesh: Maintain group subscription list in cdb" into tizen

4 years agoMesh: Add generic mesh messages opcodes 89/243989/1
Abhay Agarwal [Sat, 12 Sep 2020 08:00:21 +0000 (13:30 +0530)]
Mesh: Add generic mesh messages opcodes

This patch adds support for mesh generic mesh messages.

Change-Id: Id28df7b6782e5c6b8ce912945d937f98fee1d3ae
Signed-off-by: Abhay Agarwal <ay.agarwal@samsung.com>
4 years agoMesh: Remove duplicate code 56/243856/2
Abhay Agarwal [Thu, 10 Sep 2020 12:50:24 +0000 (18:20 +0530)]
Mesh: Remove duplicate code

This patch
- Removes duplicate code
- Fix coding style issues

Change-Id: I21a7b70dd74dadd882dae170fab3f64e66fd26d5
Signed-off-by: Abhay Agarwal <ay.agarwal@samsung.com>
4 years agoMesh: Disallow group deletion if it is in use 44/243844/2
Abhay Agarwal [Thu, 10 Sep 2020 11:06:31 +0000 (16:36 +0530)]
Mesh: Disallow group deletion if it is in use

Change-Id: I4ec8a71dd53371a3d57a066af91d13d6d77dcc69
Signed-off-by: Abhay Agarwal <ay.agarwal@samsung.com>
4 years agoFix dbus timeout issue 98/243798/1
Wootak Jung [Thu, 10 Sep 2020 06:18:17 +0000 (15:18 +0900)]
Fix dbus timeout issue

Remove deprecated recover logic

Change-Id: I2d737b7049effa9772a2d0ef36fe0d17ea3501e6
Signed-off-by: Wootak Jung <wootak.jung@samsung.com>
4 years agoUse shared connection instead of private connection 33/243633/2
Wootak Jung [Tue, 8 Sep 2020 23:24:26 +0000 (08:24 +0900)]
Use shared connection instead of private connection

private connection is not recommended except specific usecase

Change-Id: Iab62eb16860014fc99a99ea29416313ec89efef3
Signed-off-by: Wootak Jung <wootak.jung@samsung.com>
4 years agoMesh: Maintain group subscription list in cdb 43/243843/1
Abhay Agarwal [Wed, 2 Sep 2020 04:40:37 +0000 (10:10 +0530)]
Mesh: Maintain group subscription list in cdb

This patch updates the cdb when subscription status is received
on request of sub add, delete, delete all and sub overwrite.

Change-Id: I5b1d9b2748173ec70c971c0a64f63b073d602390
Signed-off-by: Abhay Agarwal <ay.agarwal@samsung.com>
4 years agoHandle no appearance data type (0x19) in adv data 33/243333/2 accepted/tizen/unified/20200909.014251 submit/tizen/20200907.031811
DoHyun Pyun [Sun, 6 Sep 2020 23:46:02 +0000 (08:46 +0900)]
Handle no appearance data type (0x19) in adv data

Change-Id: I51659c64f66a449d2135f1414bce7b18e890fef0
Signed-off-by: DoHyun Pyun <dh79.pyun@samsung.com>
4 years agoAllows value of Appearance advertisement data as 0x00 32/242832/1 accepted/tizen/unified/20200902.011928 accepted/tizen/unified/20200904.035418 submit/tizen/20200901.064142 submit/tizen/20200902.223427
Amit Purwar [Tue, 1 Sep 2020 06:12:01 +0000 (11:42 +0530)]
Allows value of Appearance advertisement data as 0x00

Change-Id: Idfa18fc7777aedae7a8c9afdf8caa39555e4c132
Signed-off-by: Amit Purwar <amit.purwar@samsung.com>
4 years agoMesh: Fix model message execution 19/242819/1
Abhay Agarwal [Tue, 1 Sep 2020 05:33:52 +0000 (11:03 +0530)]
Mesh: Fix model message execution

Change-Id: I5ed5de49eb724357cbc3d2ccbedceaa7bfbeebac
Signed-off-by: Abhay Agarwal <ay.agarwal@samsung.com>
4 years agoAdd the log in set advertisement data 16/242716/2
Amit Purwar [Mon, 31 Aug 2020 09:04:13 +0000 (14:34 +0530)]
Add the log in set advertisement data

Change-Id: I94ed82eaff293091e41f9128e0dda6e34a23b91c
Signed-off-by: Amit Purwar <amit.purwar@samsung.com>
4 years agoFix 64bit build error 53/242553/1 accepted/tizen/unified/20200831.002545 accepted/tizen/unified/20200901.042009 submit/tizen/20200827.215651 submit/tizen/20200831.035527
DoHyun Pyun [Thu, 27 Aug 2020 23:13:07 +0000 (08:13 +0900)]
Fix 64bit build error

Change-Id: I2c9f95dd6015826e5db41981d3644aa58f1096c2
Signed-off-by: DoHyun Pyun <dh79.pyun@samsung.com>
4 years agoMerge "Mesh: Enable simultaneous LE scan operations" into tizen
Pyun DoHyun [Thu, 27 Aug 2020 21:42:43 +0000 (21:42 +0000)]
Merge "Mesh: Enable simultaneous LE scan operations" into tizen

4 years agoMesh: Enable simultaneous LE scan operations 89/241889/3
Abhay Agarwal [Thu, 20 Aug 2020 07:35:01 +0000 (13:05 +0530)]
Mesh: Enable simultaneous LE scan operations

Mesh operations over PB-ADV requires continous LE scan on HCI.
When using HCI RAW channel for mesh operations, LE scan
should not be disabled for their continous execution.
This patch modifies to allow such simulataneous LE scan operations
on bluetoothd and meshd.

Change-Id: I6f1825d3a48536269fa1b520fd2171b7283f60b4
Signed-off-by: Abhay Agarwal <ay.agarwal@samsung.com>
4 years agoFix gatt disconnected event occured twice issue 50/242450/1
Wootak Jung [Thu, 27 Aug 2020 05:04:59 +0000 (14:04 +0900)]
Fix gatt disconnected event occured twice issue

gatt server start > gatt connected > gatt disconnected from client
> two disconnected event occured

Remove client info if existing even if remote client disconnected

Change-Id: I969ecb97c4ae4c1597cb72538cf8fe476652f59f
Signed-off-by: Wootak Jung <wootak.jung@samsung.com>
4 years agoMerge "Mesh: Save vendor & model info post net create" into tizen
Pyun DoHyun [Thu, 27 Aug 2020 04:56:05 +0000 (04:56 +0000)]
Merge "Mesh: Save vendor & model info post net create" into tizen

4 years agoMesh: Save vendor & model info post net create 13/242413/2
Anupam Roy [Wed, 26 Aug 2020 17:24:12 +0000 (22:54 +0530)]
Mesh: Save vendor & model info post net create

This patch handles following:-

Vendor & model info of local config client
node was not saved to Configuration database
after network is created which caused Network
Load operation to fail due to missing Vendor
& Model Info.

With this patch, all vendor & model info are now
saved to CDB. Dduring Network Load, all data are
fetched from Conf DB and node data is prepared,
which is eventually used to attach to the Network.

Change-Id: Id2d59a6d8bebb32a9a251781b3c0cab494daea1f
Signed-off-by: Anupam Roy <anupam.r@samsung.com>
4 years agoMesh: Handle meshd init failure 01/242401/2
Abhay Agarwal [Wed, 26 Aug 2020 09:24:26 +0000 (14:54 +0530)]
Mesh: Handle meshd init failure

Change-Id: I69802928eb8c03591039d3166ade05c03211811e
Signed-off-by: Abhay Agarwal <ay.agarwal@samsung.com>
4 years agoMerge "Fix: GATT connect Failure if Adv. enabled on slot 0" into tizen accepted/tizen/unified/20200827.105818 submit/tizen/20200825.221936
Pyun DoHyun [Tue, 25 Aug 2020 22:01:46 +0000 (22:01 +0000)]
Merge "Fix: GATT connect Failure if Adv. enabled on slot 0" into tizen

4 years agoMesh: Handle timeout for missing request 55/242355/1
Abhay Agarwal [Tue, 25 Aug 2020 12:52:26 +0000 (18:22 +0530)]
Mesh: Handle timeout for missing request

This patch handles
- Fix reset scan and provision states on app deinit.
- Fix group message response processing
- Handles timeout for publication get/set
- Handles timeout for model appkey bind/unbind.

Change-Id: I6a4425f39f6db3697d6f610bf614129dfa7e0e33
Signed-off-by: Abhay Agarwal <ay.agarwal@samsung.com>
4 years agoFix: GATT connect Failure if Adv. enabled on slot 0 72/242172/2
himanshu [Mon, 24 Aug 2020 17:11:05 +0000 (22:41 +0530)]
Fix: GATT connect Failure if Adv. enabled on slot 0

This patch fix the issue of gatt connect call,
failure if advertising is running on slot 0.
If advertising is running on slot 0, the kernel
proceeds to initiate connection as a slave
in form of directed advertising.

The advertising should be hold and reinitiated
in such case.

Change-Id: Id7ba7df82aaabc25da0250b63ebaede5d33a0b96
Signed-off-by: himanshu <h.himanshu@samsung.com>
4 years agoMerge "Mesh: Remove Timer before destroying app object" into tizen accepted/tizen/unified/20200826.133059 submit/tizen/20200825.072855
Pyun DoHyun [Mon, 24 Aug 2020 22:28:42 +0000 (22:28 +0000)]
Merge "Mesh: Remove Timer before destroying app object" into tizen

4 years agoMerge "Mesh: Handle mesh application termination event" into tizen
Pyun DoHyun [Mon, 24 Aug 2020 22:28:26 +0000 (22:28 +0000)]
Merge "Mesh: Handle mesh application termination event" into tizen

4 years agoMerge "FRWK: Allows multiple service data in LE advertising" into tizen
Pyun DoHyun [Mon, 24 Aug 2020 22:27:19 +0000 (22:27 +0000)]
Merge "FRWK: Allows multiple service data in LE advertising" into tizen

4 years agoMerge "Mesh: Handle network proxy added event" into tizen
Pyun DoHyun [Mon, 24 Aug 2020 22:26:38 +0000 (22:26 +0000)]
Merge "Mesh: Handle network proxy added event" into tizen

4 years agoMesh: Remove Timer before destroying app object 71/242171/1
Anupam [Mon, 24 Aug 2020 16:35:49 +0000 (22:05 +0530)]
Mesh: Remove Timer before destroying app object

Change-Id: I4bf2b2b9a29fe43408147537a439299f81bd250e
Signed-off-by: Anupam <anupam.r@samsung.com>
4 years agoMesh: Handle mesh application termination event 48/242148/2
Anupam Roy [Fri, 21 Aug 2020 04:32:52 +0000 (04:32 +0000)]
Mesh: Handle mesh application termination event

This patch handles following
- Keeps track of Mesh Apps Init & Deinit requests
- Handle App termination event & cleanup of resouces
  upon termination
- Reset HAL global DBUS resources on mesh stack
  deinitializaiotn (network proxy & agent message)

Change-Id: I4c7bc7287492f945131b6a7bb586fafe43aae064
Signed-off-by: Anupam Roy <anupam.r@samsung.com>
4 years agoMesh: Handle network proxy added event 80/242080/1
Abhay Agarwal [Mon, 24 Aug 2020 04:56:22 +0000 (10:26 +0530)]
Mesh: Handle network proxy added event

This patch delays to handle the MESH INIT pending request
till the network proxy added callback is received.
This resolves the issue in which network proxy relates MESH API
calls from application like network creation can fail due to
non-availability of network proxy.

Change-Id: Iee712b76a9cd96b5cb8c903b2c12ce0a692f81e6
Signed-off-by: Abhay Agarwal <ay.agarwal@samsung.com>
4 years agoFRWK: Allows multiple service data in LE advertising 79/242079/1
Amit Purwar [Mon, 24 Aug 2020 04:40:45 +0000 (10:10 +0530)]
FRWK: Allows multiple service data in LE advertising

Change-Id: I138df1b79a53ca63edcf0fb987ea126c454769de
Signed-off-by: Amit Purwar <amit.purwar@samsung.com>
4 years agoCheck enabled before sending rfcomm details 56/242056/1
Deokhyun Kim [Mon, 6 Jul 2020 05:03:24 +0000 (14:03 +0900)]
Check enabled before sending rfcomm details

[Model] Noblesse
[BinType] AP
[Customer] OPEN

[Issue#] P200703-06045
[Request] PLM
[Occurrence Version] R840XXU1BTG1

[Problem] Recovery fails after TX timeout
[Cause & Measure]
[Checking Method]

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

Change-Id: I163da5c056dd2baa3339dd20c0439c88694d6be9
Signed-off-by: Deokhyun Kim <dukan.kim@samsung.com>
Signed-off-by: Wootak Jung <wootak.jung@samsung.com>
4 years agoRemove abnormal logic for ARTIK530 Success is returned even though stop_scan fails... 52/241952/1
Deokhyun Kim [Fri, 21 Aug 2020 04:03:29 +0000 (13:03 +0900)]
Remove abnormal logic for ARTIK530 Success is returned even though stop_scan fails. It can cause dbus timeout.

Change-Id: I477be2638453de37cfbf2cc894a66c5db10d6a3b
Signed-off-by: Deokhyun Kim <dukan.kim@samsung.com>
Signed-off-by: Wootak Jung <wootak.jung@samsung.com>
4 years agoRestart BLE scan even if it's not stopped intentionally. 50/241950/1
Deokhyun Kim [Tue, 28 Jul 2020 05:05:25 +0000 (14:05 +0900)]
Restart BLE scan even if it's not stopped intentionally.

 In case gatt is connected by local api or remote request,
 BLE scan is stopped unexpectedly & does not update it to api layer.
 BLE scan should be restarted internally, in case of unexpected stop.

Change-Id: I8d7de20f37faacdfdebb16c87a6691fcb5af30a8
Signed-off-by: Deokhyun Kim <dukan.kim@samsung.com>
Signed-off-by: Wootak Jung <wootak.jung@samsung.com>
4 years agoUpdate LE connection interval after GATT connection completed 46/241946/2
injun.yang [Mon, 10 Aug 2020 01:51:27 +0000 (10:51 +0900)]
Update LE connection interval after GATT connection completed

[Model] All
[BinType] AP
[Customer] OPEN

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

[Problem] Connection interval 7.5ms maintained
[Cause & Measure] After GATT connection completed, update interval
[Checking Method] gatt connection

[Team] Convergence BT
[Developer] Injun Yang
[Solution company] Samsung
[Change Type] Specification change

Change-Id: Ia48fe3ac6290018631117e322d100d5d194e4cc3
Signed-off-by: injun.yang <injun.yang@samsung.com>
Signed-off-by: Wootak Jung <wootak.jung@samsung.com>
4 years agoHandle error value of hid agent 42/241942/2
Deokhyun Kim [Mon, 6 Jul 2020 06:40:56 +0000 (15:40 +0900)]
Handle error value of hid agent

Change-Id: If227159bde4292304583995417996c5af7b9f406
Signed-off-by: Deokhyun Kim <dukan.kim@samsung.com>
Signed-off-by: Wootak Jung <wootak.jung@samsung.com>
4 years agoMerge "Fix the svace issue (DEREF_OF_NULL)" into tizen
Pyun DoHyun [Fri, 21 Aug 2020 04:32:52 +0000 (04:32 +0000)]
Merge "Fix the svace issue (DEREF_OF_NULL)" into tizen

4 years agoFix mem leak 13/241913/1
Deokhyun Kim [Thu, 30 Jul 2020 07:56:46 +0000 (16:56 +0900)]
Fix mem leak

Change-Id: If133d1f4816cfcf0aad49f887a940bbdd1d318aa
Signed-off-by: Deokhyun Kim <dukan.kim@samsung.com>
Signed-off-by: Wootak Jung <wootak.jung@samsung.com>
4 years agoFix the svace issue (DEREF_OF_NULL) 05/241905/1
DoHyun Pyun [Thu, 20 Aug 2020 23:45:33 +0000 (08:45 +0900)]
Fix the svace issue (DEREF_OF_NULL)

Change-Id: Id9d1f17f169c6e290a3f6d346adadd7733205f5b
Signed-off-by: DoHyun Pyun <dh79.pyun@samsung.com>
4 years agoMesh: Release Network DBUS resources during deinit 98/241898/1 accepted/tizen/unified/20200825.142907 submit/tizen/20200821.002054
Anupam Roy [Thu, 20 Aug 2020 15:55:01 +0000 (21:25 +0530)]
Mesh: Release Network DBUS resources during deinit

When application wants to deinitialize mesh,
Network resources of that application shall be
released by stack. Currently, those resouces
are not released. Also, HAL retains the dynamic
resouces of the Networks, which should be cleaned.

This patch requests release of resources
by calling 'Release' API of stack, which
is introduced in Tizen. When dbus resouces
are cleaned, HAL will automatically release dynamic
resources of networks, upon removal of proxies.

After release, at any point of time, application
can again initialize mesh and 'Attach' the Networks,
that it had created before, with the help of
token, which was aquired during network creation.

Change-Id: I617110d10fdb6d9eaa711f77dcd5a92e6b93a55f
Signed-off-by: Anupam Roy <anupam.r@samsung.com>
4 years agoMesh: Handle Multi-application init & deinit logic 84/241384/2 accepted/tizen/unified/20200821.042426 submit/tizen/20200820.041741
Anupam Roy [Wed, 19 Aug 2020 15:33:01 +0000 (21:03 +0530)]
Mesh: Handle Multi-application init & deinit logic

This patch handles following:-
- Introduces Network Unload API. This API
  will be used by application to unload
  all network resources from bt-service.
  During mesh application deinit, FRWK
  library will call Network Unload to cleanup
  resources from service layer. CDB will remain
  unaffected due to this.

- Implements init/deinit logic for multiple apps.
  bt-service keeps reference count of applications.
  mesh stack launch/unlaunch is done single time
  based on app reference count logic. Don't allow
  to stop mesh stack service, if atleast one app
  is using mesh service.

Change-Id: I705c9c4d462036a657184dbdbb131c77af83b3a3
Signed-off-by: Anupam Roy <anupam.r@samsung.com>
4 years agoG_IO_HUP should be checked before G_IO_IN 26/241026/2
Deokhyun Kim [Fri, 3 Jul 2020 06:17:44 +0000 (15:17 +0900)]
G_IO_HUP should be checked before G_IO_IN

Change-Id: Id9a4ca2bd1fa59160723b831c97687df36db2d39
Signed-off-by: Deokhyun Kim <dukan.kim@samsung.com>
Signed-off-by: Wootak Jung <wootak.jung@samsung.com>
4 years agoMerge "Add busy return logic when connecting timer is existing" into tizen
Pyun DoHyun [Thu, 20 Aug 2020 01:33:49 +0000 (01:33 +0000)]
Merge "Add busy return logic when connecting timer is existing" into tizen

4 years agoMesh: Reset launch timer ID upon expiry 02/241302/2
Anupam Roy [Wed, 19 Aug 2020 05:40:19 +0000 (11:10 +0530)]
Mesh: Reset launch timer ID upon expiry

This patch resets timer ID, upon timer expiry.
If timer ID is not expired, other application
gets timed out on MESH INIT request, as status
remains in progress.

This patch also handles, stack initialization done
error in FRWK. Already done should be treated as
success.

Change-Id: Ic334498ccfbeca18c7c18efceffd1a03129f9241
Signed-off-by: Anupam Roy <anupam.r@samsung.com>
4 years agoMesh: Fix crash in node reset 50/241150/2
Abhay Agarwal [Tue, 18 Aug 2020 04:39:51 +0000 (10:09 +0530)]
Mesh: Fix crash in node reset

This patch fix crash due to g_free of node information in
delete node setup.
This patch also removes the lauch timer during deinit of mesh.

Change-Id: I29e3406b57fd06042fcdfb88c43ef047422ddbb6
Signed-off-by: Abhay Agarwal <ay.agarwal@samsung.com>
4 years agoMesh: Fix bug in fetching node vendor info 29/241129/1 accepted/tizen/unified/20200819.035932 submit/tizen/20200817.231237
Anupam Roy [Mon, 17 Aug 2020 17:29:21 +0000 (22:59 +0530)]
Mesh: Fix bug in fetching node vendor info

This patch handles following:
- Use Node's unicast address to search node in CDB.
Network UUID was wrongly used to search node in CDB,
as only local node's UUID will match with Network UUID,
rest of the nodes(provisioned) can be identified by
only their unique device UUID's. Therefore, unicast
address is the unique identifier of a node within
a network.

- NULL check was missing for node json entry before
returning not found result.

- Added few DEBUG prints.

Change-Id: I5374b21768355197e696b1ad5d12ac5d1bf143aa
Signed-off-by: Anupam Roy <anupam.r@samsung.com>
4 years agoMesh: Fix network proxy issue 70/240970/5
Abhay Agarwal [Mon, 10 Aug 2020 13:07:25 +0000 (18:37 +0530)]
Mesh: Fix network proxy issue

This patch fix an issue of proxy added callback not being called
for network interface due to simultaeneous operations to register
proxy callback and to launch bluetooth-meshd.

Change-Id: Ibab370d9200ba3563e09f5396c4e0e3434a532ed
Signed-off-by: Abhay Agarwal <ay.agarwal@samsung.com>
4 years agoMesh:Fix Svace issue in bluetooth-frwk 53/241053/2
anuj.bhumiya [Fri, 14 Aug 2020 06:34:45 +0000 (12:04 +0530)]
Mesh:Fix Svace issue in bluetooth-frwk

Change-Id: Iaa8072390d470a77bda655af99565f2eed774511
Signed-off-by: anuj.bhumiya <anuj.bhumiya@samsung.com>
4 years agoAdd busy return logic when connecting timer is existing 25/241025/2
Wootak Jung [Fri, 14 Aug 2020 05:04:29 +0000 (14:04 +0900)]
Add busy return logic when connecting timer is existing

Change-Id: I0c27ef5e18688220793fa0549380ebb9623bc3b0
Signed-off-by: Deokhyun Kim <dukan.kim@samsung.com>
Signed-off-by: Wootak Jung <wootak.jung@samsung.com>
4 years agoMesh: Add Node Reset API in FRWK 89/240989/1 accepted/tizen/unified/20200818.130013 submit/tizen/20200814.005814
Anupam Roy [Thu, 13 Aug 2020 10:23:08 +0000 (15:53 +0530)]
Mesh: Add Node Reset API in FRWK

Change-Id: I70a34fc3601861d383fb9c7a82028ce2ac45811b
Signed-off-by: Anupam Roy <anupam.r@samsung.com>
4 years agoMesh: Add support for Node Reset in OAL & HAL 88/240988/1
Anupam Roy [Thu, 13 Aug 2020 10:10:08 +0000 (15:40 +0530)]
Mesh: Add support for Node Reset in OAL & HAL

This patch adds HAL & OAL API's for remote
node reset functionality.

Change-Id: I6805c62e1edd1c3c1e9f1ec6c302df796a114986
Signed-off-by: Anupam Roy <anupam.r@samsung.com>
4 years agoReduce the predefined logic (PredefinedPreprocessor) 43/240843/1 accepted/tizen/unified/20200813.122623 submit/tizen/20200813.001605
DoHyun Pyun [Wed, 12 Aug 2020 05:37:18 +0000 (14:37 +0900)]
Reduce the predefined logic (PredefinedPreprocessor)

Change-Id: Idc1db93b8ab86ca21fd8b2a1f5d324646e057f0b
Signed-off-by: DoHyun Pyun <dh79.pyun@samsung.com>
4 years agoMerge "Fix SAM tool violations (GlobalVariable)" into tizen
Pyun DoHyun [Wed, 12 Aug 2020 04:16:04 +0000 (04:16 +0000)]
Merge "Fix SAM tool violations (GlobalVariable)" into tizen

4 years agoFix cleanup logic regarding notify fd 35/240835/1
Deokhyun Kim [Mon, 10 Aug 2020 07:57:01 +0000 (16:57 +0900)]
Fix cleanup logic regarding notify fd

Change-Id: I577cd0305e529d0dc259e4d38603ee3db5c2f08d
Signed-off-by: Deokhyun Kim <dukan.kim@samsung.com>
Signed-off-by: Wootak Jung <wootak.jung@samsung.com>
4 years agoFix SAM tool violations (GlobalVariable) 32/240832/1
DoHyun Pyun [Wed, 12 Aug 2020 02:29:35 +0000 (11:29 +0900)]
Fix SAM tool violations (GlobalVariable)

Change-Id: I1c590603b570d6dc9d0628ba22c597f073215a9e
Signed-off-by: DoHyun Pyun <dh79.pyun@samsung.com>
4 years agoSkip error handling in case of G_IO_NVAL, because the channel is invalid 34/240834/1
Deokhyun Kim [Fri, 7 Aug 2020 06:50:34 +0000 (15:50 +0900)]
Skip error handling in case of G_IO_NVAL, because the channel is invalid

Change-Id: I554ff309e0291b2e014e8e1d88eeaf957030019f
Signed-off-by: Deokhyun Kim <dukan.kim@samsung.com>
Signed-off-by: Wootak Jung <wootak.jung@samsung.com>
4 years agoMesh: Implement Network Destroy Request 03/240803/1 accepted/tizen/unified/20200812.143918 submit/tizen/20200811.230110
Anupam Roy [Tue, 11 Aug 2020 14:05:36 +0000 (19:35 +0530)]
Mesh: Implement Network Destroy Request

This patch handles handles destroying the
network, by which local configuration client
will leave the Mesh Network. Both Stack &
FRWK will consequently remove the DB &
other configuration entries.

Change-Id: I58f567664c49633786f31c760a058889ba7d73b6
Signed-off-by: Anupam Roy <anupam.r@samsung.com>
4 years agoMerge "Mesh: Fix provisioning and mesh message communication" into tizen
Pyun DoHyun [Mon, 10 Aug 2020 23:00:41 +0000 (23:00 +0000)]
Merge "Mesh: Fix provisioning and mesh message communication" into tizen

4 years agoMesh: Fix provisioning and mesh message communication 99/240699/1
Abhay Agarwal [Mon, 10 Aug 2020 13:08:00 +0000 (18:38 +0530)]
Mesh: Fix provisioning and mesh message communication

This patch fix
- Mesh provisioning of multiple devices
- Mesh model message response handler

Change-Id: I13a909ddf796206c193af41da3fe85a5eb0a592e
Signed-off-by: Abhay Agarwal <ay.agarwal@samsung.com>
4 years agoClear mesh event handlers in the mesh deinit time 95/240595/1
DoHyun Pyun [Mon, 10 Aug 2020 01:58:58 +0000 (10:58 +0900)]
Clear mesh event handlers in the mesh deinit time

Change-Id: I5c7bf72d4cf0930ff89ed4026ffdef9fa416bea2
Signed-off-by: DoHyun Pyun <dh79.pyun@samsung.com>
4 years agoMesh: Error handling in Model Publication Status 69/240569/1
Anupam Roy [Fri, 7 Aug 2020 14:34:21 +0000 (20:04 +0530)]
Mesh: Error handling in Model Publication Status

This patch adds logic to send error event
to application, when error is
received in "Model Publication Status" event
from a node. For example, if provisioner
sends wrong appkey index, node will send
error to indicate operation is failed.

Change-Id: Iea91de2812876c18c830ee1b2d4e4b7d91b55929
Signed-off-by: Anupam Roy <anupam.r@samsung.com>
4 years agoMerge "Add fd param to check fd is valid" into tizen
Pyun DoHyun [Thu, 6 Aug 2020 01:49:15 +0000 (01:49 +0000)]
Merge "Add fd param to check fd is valid" into tizen

4 years agoMerge "Modify the package version" into tizen
Pyun DoHyun [Thu, 6 Aug 2020 01:48:33 +0000 (01:48 +0000)]
Merge "Modify the package version" into tizen

4 years agoFix the 64bit build error 70/240370/1 accepted/tizen/unified/20200810.123222 submit/tizen/20200804.074118
DoHyun Pyun [Thu, 6 Aug 2020 01:19:15 +0000 (10:19 +0900)]
Fix the 64bit build error

error: format '%d' expects argument of type 'int', but argument 9 has type 'size_t' {aka 'long unsigned int'} [-Werror=format=]

Change-Id: I687a1a2603ddf8c9770d6699a045f1ee976ab63c
Signed-off-by: DoHyun Pyun <dh79.pyun@samsung.com>
4 years agoAdd fd param to check fd is valid 94/240294/2
Wootak Jung [Wed, 5 Aug 2020 06:03:03 +0000 (15:03 +0900)]
Add fd param to check fd is valid

Change-Id: I4dbf3c8576b2b8df8146cfaeaa008e5efc89967d
Signed-off-by: Wootak Jung <wootak.jung@samsung.com>
4 years agoModify the package version 36/240036/3
DoHyun Pyun [Mon, 3 Aug 2020 01:14:54 +0000 (10:14 +0900)]
Modify the package version

In order to distinguish the package history as tizen version,
we manage the package version from now.

Change-Id: I5d023755b527bbaf1e96f826e9037df497276518
Signed-off-by: DoHyun Pyun <dh79.pyun@samsung.com>
4 years agoMesh: Fix coding style 69/240169/1
Abhay Agarwal [Tue, 4 Aug 2020 05:37:12 +0000 (11:07 +0530)]
Mesh: Fix coding style

This patch handles following
- Fix style according to coding guidelines
- Rename few events

Change-Id: I63f059d203b0537d575d5e21ad7f35f3c834a9ce
Signed-off-by: Abhay Agarwal <ay.agarwal@samsung.com>
4 years agoMerge "Mesh: Fix issues in Mesh Model Subscrition" into tizen
Pyun DoHyun [Mon, 3 Aug 2020 00:50:30 +0000 (00:50 +0000)]
Merge "Mesh: Fix issues in Mesh Model Subscrition" into tizen

4 years agoMesh: Fix issues in Mesh Model Subscrition 16/240016/2
Anupam Roy [Fri, 31 Jul 2020 10:58:48 +0000 (16:28 +0530)]
Mesh: Fix issues in Mesh Model Subscrition

This patch fixes issues in following operations
- Get Mesh BT SIG & Vendor Model Subscription List
- Add missing Command timeout handling
- Fix gdbus data format for sending Model list
- Add missing privilege for Model Subscription List API

Change-Id: I671b3f109ae1b2c752115d30dcb26783e7133e1d
Signed-off-by: Anupam Roy <anupam.r@samsung.com>