ERAMOTO Masaya [Wed, 14 Feb 2018 07:20:31 +0000 (16:20 +0900)]
obexd: Fix null response name
Prints out "<unknown>" string if there is no response name as below:
obexd[8117]: obexd/src/obex.c:cmd_connect()
obexd[8117]: CONNECT(0x0), (null)(0xffffffff)
Change-Id: I3229def9a31f1397001f9c101550e0f30da17641
Signed-off-by: Amit Purwar <amit.purwar@samsung.com>
Matt Schulte [Wed, 7 Feb 2018 07:48:56 +0000 (23:48 -0800)]
advertising: only parse adv from adv interfaces
client_proxy_added is called for every interface on an object passed in
to the dbus RegisterAdvertisement method. This can cause a NULL
dereference to occur and a failure status in the reply on dbus
RegisterAdvertisement method calls. The fix is to return early from
client_proxy_added if the proxy interface is not
org.bluez.LEAdvertisement1. If this early return is not there, two
different error paths could occur.
1) client_proxy_added is first called with the
org.bluez.LEAdvertisement1 interface and then with another interface.
The second call will fail the parse_advertisement call and possibly
cause a NULL dereference on the dbus_message_unref if
add_client_complete has already occurred.
2) client_proxy_added is first called with an unknown interface and then
org.bluez.LEAdvertisement1. The first call will cause
parse_advertisement to fail and a failure to be replied to the client
calling RegisterAdvertisement. The advertisement may be successfully
registered on the second client_proxy_added call but a NULL dereference
will occur on the call to dbus_message_new_method_return in
add_client_complete.
Change-Id: I5fa0dbaad9568d0ebdd1c358246f10b20cbe2bcc
Signed-off-by: Amit Purwar <amit.purwar@samsung.com>
Konstantin Zhukov [Mon, 12 Feb 2018 10:40:30 +0000 (14:40 +0400)]
shared/gatt-db: Fix declaration attributes permission
According to Bluetooth Core specification v4.2 (Vol. 3, part G,
section 3.1), service declararion attributes should have only READ
permission. The same obligation has charateristic declaration and
include service declaration attributes.
Without this permission connected clients could corrupt GATT database
by writing to declaration attributes. After thatm service discovery
fails in other clients.
Change-Id: Ib18c4de213e9c242a09a770d9f24cd850a1af6a0
Signed-off-by: Amit Purwar <amit.purwar@samsung.com>
ERAMOTO Masaya [Fri, 9 Feb 2018 09:11:41 +0000 (18:11 +0900)]
obexd: Emit Size property of transfer after open()
Emits the Size property of transfer after calling ->open() because it
may update the size information.
Change-Id: I343e2f9c5993a9c91107e75f7a0af747f262308c
Signed-off-by: Amit Purwar <amit.purwar@samsung.com>
ERAMOTO Masaya [Fri, 9 Feb 2018 09:10:57 +0000 (18:10 +0900)]
obexd: Use emitting function wrapped for transfer
Also replaces emit_transfer_progress() with the new wrapper function
because the total/transferred arguments have not been used since commit
a5c2b6e8 ("obexd: Align client and server spec of org.bluez.obex.Transfer1")
and g_dbus_emit_property_changed_full() checks if the path argument is
NULL.
Change-Id: I2733ee5de2de15d008d45724abffafefa87fc045
Signed-off-by: Amit Purwar <amit.purwar@samsung.com>
Luiz Augusto von Dentz [Fri, 9 Feb 2018 10:46:55 +0000 (12:46 +0200)]
shared/gatt-client: Reset callbacks when unregistering
If user application is unregistering a notification handler its
callbacks shall not be called even CCC write is still holding a
reference to notify_data.
Change-Id: Ib16702e9d0437478487daf6571844b55ceac5266
Signed-off-by: Amit Purwar <amit.purwar@samsung.com>
Szymon Janc [Thu, 8 Feb 2018 16:03:06 +0000 (17:03 +0100)]
adapter: Remove spurious propery changed signal
There is no "Connectable" property on Adapter1 interface.
Change-Id: I2673bfc3bf9a5b18ceac1dffacbf47b05181e1a4
Signed-off-by: Amit Purwar <amit.purwar@samsung.com>
Szymon Janc [Wed, 7 Feb 2018 10:02:24 +0000 (11:02 +0100)]
advertising: Configure discoverable flag based on adapter settings
Until now advertising as peripheral was always setting General Discoverable
flag set. With this patch this is set based on adapter discoverable setting.
Change-Id: Ic4db27d37f94ab6a99250f919d9e9432cfa40886
Signed-off-by: Amit Purwar <amit.purwar@samsung.com>
Luiz Augusto von Dentz [Wed, 7 Feb 2018 11:35:07 +0000 (09:35 -0200)]
core: Fixes order InterfaceAdded
Registering on the callback of MGMT_OP_READ_ADV_FEATURES causes
InterfacesAdded to be reschedule after the device objects which causes
tools such as PulseAudio to consider it invalid.
Fixes https://bugzilla.redhat.com/show_bug.cgi?id=1534857
Change-Id: I5e485ccbeb9d0cd81b0a34bbe970306333ef948e
Signed-off-by: Amit Purwar <amit.purwar@samsung.com>
Luiz Augusto von Dentz [Tue, 6 Feb 2018 10:01:19 +0000 (08:01 -0200)]
client: Fix not cleaning up notify pipe
If remote unsubscribe, disconnects or the daemon closes the socket the
io shall be destroyed properly otherwise it will prevent new
subscriptions.
Change-Id: I9cd77b61e7bfdd38ecd160edd0b9316d8285c7b0
Signed-off-by: Amit Purwar <amit.purwar@samsung.com>
Luiz Augusto von Dentz [Tue, 6 Feb 2018 09:00:14 +0000 (07:00 -0200)]
gatt: Fix memory leak
If bt_gatt_client_register_notify fails the client shall be freed.
Change-Id: Ie478a2df0edb4129129daa1fb3448c44cfcc7efa
Signed-off-by: Amit Purwar <amit.purwar@samsung.com>
Luiz Augusto von Dentz [Mon, 5 Feb 2018 12:02:43 +0000 (10:02 -0200)]
client: Don't set generators for modes
Commands that already have all values set on the argument string don't
need to add a generator since bt_shell can now auto complete them.
Change-Id: I6a1876b4754a574ae68b1dfb7f80b16885e6d83a
Signed-off-by: Amit Purwar <amit.purwar@samsung.com>
Szymon Janc [Fri, 2 Feb 2018 09:18:11 +0000 (10:18 +0100)]
build: Bump ELL dependency to 0.3
This is first version that supports D-Bus proxy API used by btpclient.
Change-Id: If8dfb4a3f2744fc42c128de72e088ee17893ab18
Signed-off-by: Amit Purwar <amit.purwar@samsung.com>
Luiz Augusto von Dentz [Wed, 31 Jan 2018 10:55:30 +0000 (08:55 -0200)]
adapter: Use g_dbus_send_reply whenever possible
This convert calls of g_dbus_create_reply + g_dbus_send_message to just
g_dbus_send_reply as that is simpler to maintain and saver as that always
check if the reply could be constructed properly.
Change-Id: I7514f10f22e4c629892796c929cb556a0fb07a97
Signed-off-by: Amit Purwar <amit.purwar@samsung.com>
Luiz Augusto von Dentz [Sun, 28 Jan 2018 13:44:32 +0000 (11:44 -0200)]
gdbus: Fail to send NULL messages
This should make it safe to call g_dbus_send_message with a NULL
message which is more likely to happen now that g_dbus_create_reply
returns NULL when the message is marked with NO_REPLY flag.
Change-Id: Ie5d51fab161acf06a4813c64d05689f3ecc627df
Signed-off-by: Amit Purwar <amit.purwar@samsung.com>
Luiz Augusto von Dentz [Sun, 28 Jan 2018 13:22:26 +0000 (11:22 -0200)]
gdbus: Fix replying to messages marked with NOREPLY flag
When a sender flags a D-Bus message as not expecting a reply, it is
against D-Bus policy to send a reply — sending one can result in an
error as reported in:
https://bugzilla.kernel.org/show_bug.cgi?id=198453
Signed-off-by: Amit Purwar <amit.purwar@samsung.com>
Change-Id: I64f927691a7e135b3855ee2ed10f202f0a1cd632
Luiz Augusto von Dentz [Wed, 24 Jan 2018 13:06:16 +0000 (11:06 -0200)]
obexd: Fix property Size of server transfer
OBJECT_SIZE_DELETE is shall not be consider a valid size.
Change-Id: I84ec5c9f7397dee6597a99263cb200243b0def5f
Signed-off-by: Amit Purwar <amit.purwar@samsung.com>
ERAMOTO Masaya [Tue, 23 Jan 2018 09:45:34 +0000 (18:45 +0900)]
obexd: Clean up unneeded list in src/obex.c
Cleans up the sessions list which has been unneeded by commit
8572afb4
("obexd: Make use of transport drivers and some cleanups").
Change-Id: Ie06072fa6d052bd7e5bdc824e8250362bd914cae
Signed-off-by: Amit Purwar <amit.purwar@samsung.com>
Marcel Holtmann [Mon, 22 Jan 2018 11:06:31 +0000 (12:06 +0100)]
shared: Add missing ecc_valid_public_key function
Change-Id: I955d675fcf2d8fe6c2d50da9a54100c1e7041bd9
Signed-off-by: Amit Purwar <amit.purwar@samsung.com>
Luiz Augusto von Dentz [Fri, 19 Jan 2018 13:12:09 +0000 (11:12 -0200)]
client: Print advertising details
Print advertising details when active.
Change-Id: Idc4372ad9dbc7d1e8839f7fe67f4490f5de5433e
Signed-off-by: Amit Purwar <amit.purwar@samsung.com>
Luiz Augusto von Dentz [Thu, 14 Dec 2017 18:09:39 +0000 (16:09 -0200)]
client: Rename set-uuids to uuids
Make the command return the current value if no parameters:
[bluetooth]# uuids 0x1820
[bluetooth]# uuids
UUID: Internet Protocol Support (0x1820
Change-Id: Ia0fa56d8374f1efcfdbc03a2929a2ea8131ba00d
Signed-off-by: Amit Purwar <amit.purwar@samsung.com>
Luiz Augusto von Dentz [Tue, 16 Jan 2018 19:01:03 +0000 (17:01 -0200)]
client: Fix register-{characteristic, descriptor}
Flags parameter should be found in the third parameter not the second
since bt_shell don't omit the command anymore.
Change-Id: I7d38136b3a7d8a6a73411b954a85de908cd15c70
Luiz Augusto von Dentz [Tue, 2 Jan 2018 16:19:26 +0000 (14:19 -0200)]
client: Remove use of double const argument
Change-Id: Ia7869ba6fadb083393b2cda5f62b5de4214ea50a
Signed-off-by: Amit Purwar <amit.purwar@samsung.com>
ERAMOTO Masaya [Thu, 28 Dec 2017 05:44:18 +0000 (14:44 +0900)]
client: Use g_dbus_proxy_path_lookup()
Change-Id: Icee4a0543cd13cbd516f5156862450b350631264
Signed-off-by: Amit Purwar <amit.purwar@samsung.com>
ERAMOTO Masaya [Thu, 28 Dec 2017 05:44:15 +0000 (14:44 +0900)]
gdbus: Introduce g_dbus_proxy_path_lookup()
g_dbus_proxy_path_lookup() returns the path of the proxy that matches the
passed path. It also returns the index of the proxy coming next to the
matched proxy in the passed list.
Change-Id: Id14371c3c692728ef632987be35190146703be3f
Signed-off-by: Amit Purwar <amit.purwar@samsung.com>
Wootak Jung [Thu, 28 Mar 2019 04:53:30 +0000 (13:53 +0900)]
Add default a2dp role setting logic for headless
Change-Id: I25f5fa87779790eb189d0ac6070a25d5cead09db
Wootak Jung [Mon, 18 Mar 2019 02:26:03 +0000 (11:26 +0900)]
Fix OPP Server dbus rejection issue
Change-Id: Icd6098a74a6336d5f93cbc985761cf3de9463fd1
DoHyun Pyun [Mon, 18 Mar 2019 00:36:27 +0000 (09:36 +0900)]
Apply the review comments in A2DP multistream
Change-Id: I7e0ff1040067be3062f1433847913808b5923fdd
Signed-off-by: DoHyun Pyun <dh79.pyun@samsung.com>
Seungyoun Ju [Wed, 23 Jan 2019 06:52:15 +0000 (15:52 +0900)]
Support getting LE Local OOB Data
[Problem] There is no interface to get LE local OOB Data
[Cause & Measure] Send MGMT_OP_READ_LOCAL_OOB_EXT_DATA to kernel to get
LE local OOB Data.
Result:
$ dbus-send --system --print-reply --dest=org.bluez /org/bluez/hci0 org.bluez.OutOfBand.LEReadLocalData
method return time=
1548225479.022260 sender=:1.392 -> destination=:1.400 serial=94 reply_serial=2
array of bytes [
08 1b 86 a6 6a d6 ae 08 00 02 1c 01 11 22 71 05 07 3e 23 98 9b 54 c4 56
c4 b0 af 35 12 30 11 23 c4 3c 10 96 94 ad 99 19 9f 58 03 57 e7 5a ac 33
02 01 00
]
< ACL Data TX: Handle 65 flags 0x00 dlen 11
SMP: Pairing Request (0x01) len 6
IO capability: KeyboardDisplay (0x04)
OOB data: Authentication data from remote device present (0x01)
Authentication requirement: Bonding, MITM, SC, No Keypresses (0x0d)
Max encryption key size: 16
Initiator key distribution: EncKey IdKey Sign (0x07)
Responder key distribution: EncKey IdKey Sign (0x07)
> ACL Data RX: Handle 65 flags 0x02 dlen 11
SMP: Pairing Response (0x02) len 6
IO capability: DisplayOnly (0x00)
OOB data: Authentication data not present (0x00)
Authentication requirement: Bonding, MITM, SC, No Keypresses (0x0d)
Max encryption key size: 16
Initiator key distribution: EncKey IdKey Sign (0x07)
Responder key distribution: EncKey IdKey Sign (0x07)
< ACL Data TX: Handle 65 flags 0x00 dlen 69
SMP: Pairing Public Key (0x0c) len 64
X: cfb9cf0a6922f4c5368c7025f15193e183e895a7ba354d6283cbb6c9ac34aafc
Y: 9c0a76d625852440b0ccc08d56587f38f3f22a11950e3f2824e4ccc2505fd70f
> HCI Event: Number of Completed Packets (0x13) plen 5
Num handles: 1
Handle: 65
Count: 2
> ACL Data RX: Handle 65 flags 0x02 dlen 27
> ACL Data RX: Handle 65 flags 0x01 dlen 27
> ACL Data RX: Handle 65 flags 0x01 dlen 15
SMP: Pairing Public Key (0x0c) len 64
X: acec5a11f457c40138809e618865b8ead2ea1c5f71b38deb8e3bb76c64b219a8
Y: 9bc8d28c0f96d175c9661ec012af89b5b34f936a9a8ec6c39b75e12540eeaf76
< ACL Data TX: Handle 65 flags 0x00 dlen 21
SMP: Pairing Random (0x04) len 16
Random value:
a307ddd44443bfbba384cc26bd51012f
> ACL Data RX: Handle 65 flags 0x02 dlen 21
SMP: Pairing Random (0x04) len 16
Random value:
36bd1b4d18a5a3dfcdaefeae72cb380e
< ACL Data TX: Handle 65 flags 0x00 dlen 21
SMP: Pairing DHKey Check (0x0d) len 16
E:
02cb188687306cd5a10cd3788bd317f3
> HCI Event: Number of Completed Packets (0x13) plen 5
Num handles: 1
Handle: 65
Count: 2
> ACL Data RX: Handle 65 flags 0x02 dlen 21
SMP: Pairing DHKey Check (0x0d) len 16
E:
1970e360950cc322587d322f0c4e333a
< HCI Command: LE Start Encryption (0x08|0x0019) plen 28
Handle: 65
Random number: 0x0000000000000000
Encrypted diversifier: 0x0000
Long term key:
a818945751ab5c2e10c6de92ed1c9130
> HCI Event: Command Status (0x0f) plen 4
LE Start Encryption (0x08|0x0019) ncmd 1
Status: Success (0x00)
> HCI Event: Encryption Change (0x08) plen 4
Status: Success (0x00)
Handle: 65
Encryption: Enabled with AES-CCM (0x01)
Change-Id: I9e8e9bbc6c06b20938c653b71066d4f27a4028ad
Seungyoun Ju [Thu, 8 Nov 2018 08:51:03 +0000 (17:51 +0900)]
Delete temp files
[Problem] Storage directory's size becomes huge (over 6MB)
after infinite rebooting test.
[Cause & Measure] Over 1,500 temp files were created as followings.
g_file_contents_set() creates temp file and writes contents to it. After that,
rename temp file to destination file for atomic operation. If a device turned
off before renaming, temp file remains and never be deleted.
This patch deletes temp files before creating temp files.
4.0K /opt/var/lib/bluetooth/FC:A6:21:B2:E1:7B/settings.CKX5BZ
4.0K /opt/var/lib/bluetooth/FC:A6:21:B2:E1:7B/settings.OA76BZ
4.0K /opt/var/lib/bluetooth/FC:A6:21:B2:E1:7B/settings.1BFTBZ
4.0K /opt/var/lib/bluetooth/FC:A6:21:B2:E1:7B/settings.3CB9BZ
[Checking Method] Reboot device while booting
Change-Id: Ie159ef06eab6295b1f40514e4dde386a512eb5d1
Seungyoun Ju [Fri, 2 Nov 2018 11:12:35 +0000 (20:12 +0900)]
Fix : Multi advertising is not working
[Problem] Multi advertising is not working.
[Cause & Measure] There is a condition to check if multiple advertising
is supported or not. But the condition is not valid now so it has been
removed.
Change-Id: I76387667f19b8c58a40416faf4fa42462782b4cb
Seungyoun Ju [Thu, 25 Oct 2018 09:11:59 +0000 (18:11 +0900)]
Send LE Set Random Address and check response
[Problem] HCI command Tx timeout happens.
[Cause & Measure] Vendor command is sent before Command complete event comes
for LE Set Random Address. It causes bluetooth chip's malfunction.
This commit fixs to check the response about LE Set Random Address. So
that next vendor command is sent after LE Set Random Address is
processed properly by chipset.
[Checking Method] Turn on Bluetooth > Start advertising
Change-Id: Ie757398be6d8ad71da1cc23b72ac132789df9e49
Szymon Janc [Thu, 26 Jul 2018 14:34:00 +0000 (16:34 +0200)]
shared/gatt-client: Fix crash on ext prop read failure
[Problem] bluetoothd crash happens.
[Cause & Measure] There is no routine for failure case of extended
property read response. It causes invalid memory access. There is
upstream patch for this issue. So this patch applies the upstream patch.
[Checking Method] Disconnect BLE during GATT service discovery. This is
some times issue.
[Original upstream patch]
commit
6e2eb99f666ea7084067196472ff8d49e06f90d9
Author: Szymon Janc <szymon.janc@codecoup.pl>
Date: Thu Jul 26 16:34:00 2018 +0200
shared/gatt-client: Fix crash on ext prop read failure
Program received signal SIGSEGV, Segmentation fault.
Program received signal SIGSEGV, Segmentation fault.
ext_prop_read_cb (success=false, att_ecode=0 '\000', value=0x0,
length=0, user_data=0x72ad30) at src/shared/gatt-client.c:711
711 src/shared/gatt-client.c: No such file or directory.
(gdb) bt
0 ext_prop_read_cb (success=false, att_ecode=0 '\000', value=0x0,
length=0, user_data=0x72ad30)
at src/shared/gatt-client.c:711
1 0x000000000049b8cc in disc_att_send_op (data=0x7199b0)
at src/shared/att.c:547
2 0x000000000049cb44 in disconnect_cb (io=<optimized out>,
user_data=0x716070) at src/shared/att.c:580
3 0x00000000004a6405 in watch_callback (channel=<optimized out>,
cond=<optimized out>, user_data=<optimized out>)
at src/shared/io-glib.c:170
4 0x00007ffff78c704a in g_main_context_dispatch ()
from /lib/x86_64-linux-gnu/libglib-2.0.so.0
5 0x00007ffff78c73f0 in ?? ()
from /lib/x86_64-linux-gnu/libglib-2.0.so.0
6 0x00007ffff78c7712 in g_main_loop_run ()
from /lib/x86_64-linux-gnu/libglib-2.0.so.0
7 0x000000000040c620 in main (argc=1, argv=0x7fffffffe5a8)
at src/main.c:781
Change-Id: I6f0a0b1501761693ebdbd851773878e827cd6cce
Pyun DoHyun [Tue, 12 Feb 2019 04:22:17 +0000 (04:22 +0000)]
Merge "Don't try to reconnect for A2DP source connection" into tizen
DoHyun Pyun [Fri, 8 Feb 2019 07:46:48 +0000 (16:46 +0900)]
Don't try to reconnect for A2DP source connection
For A2DP multi connection function, we should disable
the reconnection logic for the stable streaming.
Change-Id: I57d217d9e65c7fcbcfd53cdf894236e7ee880dff
Signed-off-by: DoHyun Pyun <dh79.pyun@samsung.com>
Amit Purwar [Mon, 4 Feb 2019 06:36:08 +0000 (12:06 +0530)]
Modified the write fd for acquired write
Change-Id: I2bdc6b7e925bf8d316eb6bebd32ac35328465b2b
Signed-off-by: Amit Purwar <amit.purwar@samsung.com>
Pyun DoHyun [Wed, 30 Jan 2019 01:05:53 +0000 (01:05 +0000)]
Merge "A2DP profile multiple source support" into tizen
Amit Purwar [Mon, 28 Jan 2019 05:17:45 +0000 (10:47 +0530)]
Fixed disable notify for acquire notification
Change-Id: Icf807258aa50836ffb99a7bd67740561850e4cff
Signed-off-by: Amit Purwar <amit.purwar@samsung.com>
Avichal [Fri, 14 Dec 2018 11:18:48 +0000 (16:48 +0530)]
A2DP profile multiple source support
there will be two sources source1 and source2
pause source 1 when source2 plays and viceversa
Change-Id: I2d424ce76278f505f9c270684248a76141e8e2b9
Signed-off-by: Avichal <avichal.a@samsung.com>
Luiz Augusto von Dentz [Mon, 21 Jan 2019 12:23:10 +0000 (17:53 +0530)]
gatt: Switch from pipe2 to sockepair for Acquire*
This enables to use sendmsg with MSG_NOSIGNAL.
Change-Id: Ie28b0bfbec3730448e7d045d978909accab0f685
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
Signed-off-by: Avichal <avichal.a@samsung.com>
DoHyun Pyun [Wed, 2 Jan 2019 04:06:30 +0000 (13:06 +0900)]
Enable the connection request event for custom obex server
Change-Id: Icac1762393d4527d4fa920e5e123bcdf0ec485bf
Signed-off-by: DoHyun Pyun <dh79.pyun@samsung.com>
Wootak Jung [Fri, 21 Dec 2018 00:55:13 +0000 (09:55 +0900)]
Include btattach, btmon tools into bluez pkg
Change-Id: I71f7e2659ce03c0a11fdd489d1a15515255b7a06
DoHyun Pyun [Tue, 30 Oct 2018 02:24:14 +0000 (11:24 +0900)]
Remove the apach license in the spec file
Change-Id: I440381913b762cc81f732099cecc08348d8752dc
Signed-off-by: DoHyun Pyun <dh79.pyun@samsung.com>
Wootak Jung [Mon, 29 Oct 2018 04:05:31 +0000 (13:05 +0900)]
Fix bluez rpm installation priority
The attribute of hci* execution files is not set network_fw:network_fw,
if bluez rpm is installed before security-config rpm.
Change-Id: Ifadd19e93397a52b14aea872bb88df9f26edc4f9
Wootak Jung [Thu, 25 Oct 2018 06:15:33 +0000 (15:15 +0900)]
Fix profile check logic to distinguish ivi and iot
Change-Id: I801bb263df0a43386671df7f9775ccb5530b5fee
Abhishek Chandra [Mon, 10 Sep 2018 09:01:51 +0000 (14:31 +0530)]
connect_le is failing for autoconnect
[Problem] connect_le api is failing when user set
autoconnect as true .
[Cause] when auto connect is true ,
device_set_auto_connect is called
to set device autoconnect parametes and
it is return back . device_connect_le call is
not called in this case .
[Fix] Removed the dbus_message_new_method_return .
[Verification] verified by code review in upstream
bluez code and also tested by using unit test
in platform.
Change-Id: I09e3d8e1e9169cb734419f9516ba39800ee309ee
Signed-off-by: Abhishek Chandra <abhishek.ch@samsung.com>
Wootak Jung [Mon, 27 Aug 2018 02:06:12 +0000 (11:06 +0900)]
Modify dbus policies based on default deny
- Remove receive_sender policies
- Combine deny policies
Change-Id: Ic3d691111443589b2896d5bbfde4eae328e996aa
Deokhyun Kim [Thu, 16 Aug 2018 05:10:09 +0000 (14:10 +0900)]
Set HID security level to medium.
- HID should be connected after bonding completes
Change-Id: I48ac572ee7873796bae50194512a86a32262e794
Signed-off-by: Deokhyun Kim <dukan.kim@samsung.com>
Seungyoun Ju [Mon, 13 Aug 2018 08:34:18 +0000 (17:34 +0900)]
Fix : device_get_ida is failed
[Problem] device_get_ida returns unsupported error code for paired RPA device
[Cause & Measure] Paired RPA device's bdaddr type can be public because
device.bdaddr has identity address. But old condition assumes that bdaddr
type should be random. So unsupported error code is returned. This fix
checks each case and returns proper error codd or result.
Change-Id: I435a354d956a6208129e83cbad32a0b594aec39a
Anupam Roy [Mon, 6 Aug 2018 17:16:01 +0000 (22:46 +0530)]
Implement 'Get Phy Configuration' MGMT command
This patch implements MGMT_OP_GET_PHY_CONFIGURATION
operation if MGMT interface supports PHY Configuration
setting. It introduces two new adapter properties
(l2 2m phy and le coded phy). These properties are filled
upon getting response from kernel about supported phys's.
which are then exported to user by 'SupportedLEFeatures'
adapter property.
This mgmt command supports reading above parameters in bit fields,
based on LE PHY (1M, 2M & CODED) and also
BREDR packet types as following-
- BR 1M (1 SLOT, 3 SLOT, 5 SLOT)
- EDR 2M (1 SLOT, 3 SLOT, 5 SLOT)
- EDR 3M (1 SLOT, 3 SLOT, 5 SLOT)
- 1M TX, 1M RX
- 2M TX, 2M RX
- CODED TX, CODED RX
Verification logs based on BT 5.0 controller -
bluetoothd[637]: src/adapter.c:get_phy_configuration_resp() Supported phys: [0x7e00]
bluetoothd[637]: src/adapter.c:get_phy_configuration_resp() Configurable phys: [0x7800]
bluetoothd[637]: src/adapter.c:get_phy_configuration_resp() Selected phys: [0x600]
bluetoothd[637]: src/adapter.c:get_phy_configuration_resp() Adapter supports LE 2M PHY
bluetoothd[637]: src/adapter.c:get_phy_configuration_resp() Adapter supports LE CODED PHY
Change-Id: I9ec3565b5d1b9a0de3daea666d34754958bb1550
Signed-off-by: Anupam Roy <anupam.r@samsung.com>
Anupam Roy [Mon, 6 Aug 2018 17:03:39 +0000 (22:33 +0530)]
Add defines for BREDR packet types
This patch defines BREDR packet types
in management interface as following
- MGMT_PHY_BR_1M_1SLOT 0x00000001
- MGMT_PHY_BR_1M_3SLOT 0x00000002
- MGMT_PHY_BR_1M_5SLOT 0x00000004
- MGMT_PHY_EDR_2M_1SLOT 0x00000008
- MGMT_PHY_EDR_2M_3SLOT 0x00000010
- MGMT_PHY_EDR_2M_5SLOT 0x00000020
- MGMT_PHY_EDR_3M_1SLOT 0x00000040
- MGMT_PHY_EDR_3M_3SLOT 0x00000080
- MGMT_PHY_EDR_3M_5SLOT 0x00000100
Also, it fixes parameters for response of
MGMT_OP_GET_PHY_CONFIGURATION operation.
mgmt_rp_get_phy_confguration structure will now
contain three parameters as following
- Supported_phys;
- Configurable_phys;
- Selected_phys;
Change-Id: Ia3d0c83473807d91d48eb7594c44595eca9c2a0d
Signed-off-by: Anupam Roy <anupam.r@samsung.com>
Seungyoun Ju [Mon, 6 Aug 2018 11:25:58 +0000 (20:25 +0900)]
device : Return proper error code for get_ida
[Problem] There is no way to know if remote device is not bonded or it
doesn't support IDA (i.e. BR/EDR device, LE Static random address or
non-RPA used device).
[Cause & Measure] We consider only LE RPA device. So return not
supported error code for others.
[Checking Method] N/A
Change-Id: I734a468a64cc85fa6aac08a9f0621dd95c44217c
injun.yang [Mon, 21 May 2018 08:36:44 +0000 (17:36 +0900)]
Update rpa on VSC advertising
[Model] All
[BinType] AP
[Customer] OPEN
[Issue#] N/A
[Request] Internal
[Occurrence Version] N/A
[Problem] The updated rpa is not applied on VSC advertising
[Cause & Measure] When rpa changed, report it to bluetoothd.
If device doing multiple adv, bluetoothd will update rpa.
[Checking Method] When rpa updated, check the address of advertiser
[Team] Basic Connection
[Developer] Injun Yang
[Solution company] Samsung
[Change Type] Specification change
Change-Id: I967e8eca52d9de1a0e140ee70abcd18392a1ea1b
Signed-off-by: injun.yang <injun.yang@samsung.com>
Signed-off-by: DoHyun Pyun <dh79.pyun@samsung.com>
Anupam Roy [Mon, 6 Aug 2018 06:16:02 +0000 (11:46 +0530)]
monitor: Add PHY management support
This patch adds support of PHY management
and consolidation of code printing bitfield
Taken from following upstream commits-
commit
dad3ca2f417d9330f6f3bc33cfee5d0b24985a5d
commit
426693e8457326ee686e46a2c9f535b9367a55d7
commit
e566be15ce03283978c35b2ab8462504da3fee63
commit
e862f704eeff14818fcc00a57271bd6907285ad7
Change-Id: I3582308f50423b916cec7d900fcf41dc9b4c4dc6
Signed-off-by: Anupam Roy <anupam.r@samsung.com>
Anupam Roy [Wed, 1 Aug 2018 14:54:58 +0000 (20:24 +0530)]
btmgmt: Add PHY configuration get/set commands
Taken from following upstream commit-
commit
dca915f54c1f969d977e9433d336bf3f6264632b
Change-Id: Ic8842ad0687c607b4606648f0813221d0c18c4c7
Signed-off-by: Anupam Roy <anupam.r@samsung.com>
Atul Rai [Tue, 10 Jul 2018 11:37:38 +0000 (17:07 +0530)]
Fix Coverity issue (Id:860268)
Change-Id: I9e784c6eca9a94fb9b5b5ad340aee09b7bc2b65d
Signed-off-by: Atul Rai <a.rai@samsung.com>
injun.yang [Fri, 29 Jun 2018 04:38:42 +0000 (13:38 +0900)]
Change the name of dbus property of EIR manufacturer data
Same property for adv is introduced in upstream
Change-Id: I841c525a334ad337b41b3153c7958731358ea260
Signed-off-by: injun.yang <injun.yang@samsung.com>
Seungyoun Ju [Mon, 18 Jun 2018 10:10:53 +0000 (19:10 +0900)]
CFLAGS is accumulated each profile is built
[Problem] CFLAGS is accumulated each profile is built
[Cause & Measure] Store default CFLAGS and before compiling a profile
reset CFLAGS using saved one.
Change-Id: I5d2e37852a2829978ef5bf6a7a75942494b9fdba
Anupam Roy [Thu, 14 Jun 2018 06:49:59 +0000 (12:19 +0530)]
emulator: sync with upstream
This patch comes from below commits of upstream
=====================================================================
commit
98a77944e6d3d5706647bfa7235c175b32173436
Author: ERAMOTO Masaya <eramoto.masaya@jp.fujitsu.com>
Date: Mon Apr 23 18:00:37 2018 +0900
emulator/b1ee: Enable to specify host and port
Removes the DEFAULT_SERVER macro because the default host seems to be
unofficial since 2017.
commit
b54111d2a432cdbd4926cce8be5b119b298e8477
Author: Łukasz Rymanowski <lukasz.rymanowski@codecoup.pl>
Date: Fri Feb 9 18:26:25 2018 +0100
emulator: Add initial LE states to btdev and API to set new one
=====================================================================
Change-Id: I9f94927c0b6f6dcf712ca137548691dfda53783a
Signed-off-by: Anupam Roy <anupam.r@samsung.com>
Anupam Roy [Mon, 11 Jun 2018 04:19:20 +0000 (09:49 +0530)]
build: Add testing config option
This patch comes from below commit of upstream
========================================================
commit
df43b3dad829e8b7f79fd15c20d997f50e745ae7
Author: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
Date: Wed Jan 4 15:24:45 2017 +0200
build: Add testing config option
This adds --enable-testing that can be used to enable emulator and tester
which are no longer experimental but also are not meant for production.
========================================================
Change-Id: I41edb9f1b726340dde4a22bc705a68b5bceea4c9
Signed-off-by: Anupam Roy <anupam.r@samsung.com>
Wootak Jung [Mon, 4 Jun 2018 09:30:00 +0000 (18:30 +0900)]
Add headless device handling logic
Change-Id: Iee83a7af02901787e3697d95f86ecf79103b9b67
Wootak Jung [Mon, 4 Jun 2018 00:58:33 +0000 (09:58 +0900)]
Disable SSP mode in headless device
Change-Id: I873f64b49887825f5a079306b41a03961b22bbee
Pyun DoHyun [Fri, 1 Jun 2018 00:29:53 +0000 (00:29 +0000)]
Merge "Fix LE device found event" into tizen
Wootak Jung [Fri, 1 Jun 2018 00:02:41 +0000 (09:02 +0900)]
Add a debug log for debugging
Change-Id: Ibf98b251668fd5f73f518431da4330bc1e56d54b
Atul Rai [Thu, 31 May 2018 10:09:29 +0000 (15:39 +0530)]
Fix LE device found event
Issue: Paired devices are not detected during LE scan while
paired device is advertising
This patch fixes this issue.
Change-Id: I1b9f06c3d057204cb01fe88faedaa5ace399c26b
Signed-off-by: Abhishek Chandra <abhishek.ch@samsung.com>
Signed-off-by: Atul Rai <a.rai@samsung.com>
Wootak Jung [Thu, 31 May 2018 08:12:42 +0000 (17:12 +0900)]
Add headless device handling logic
Change-Id: I0b7fa8f982e4b455b245e5c66b1fdc7ecb6289ca
Wootak Jung [Thu, 31 May 2018 01:16:38 +0000 (10:16 +0900)]
Fix access deny issue on dbus policy
Deny policy in context="default" has been applied
because of incorrect policy in other context.
Change-Id: I6185a0d784c0f082276bb4a1e002e3b86ddd9bff
injun.yang [Tue, 29 May 2018 07:46:13 +0000 (16:46 +0900)]
Fix the crash
gdb) bt
0 0x00520b98 in ext_prop_read_cb (success=false, att_ecode=0 '\000', value=0x0, length=0, user_data=0xad5310) at src/shared/gatt-client.c:746
1 0x0051e62a in read_cb (opcode=<optimized out>, pdu=<optimized out>, length=<optimized out>, user_data=<optimized out>) at src/shared/gatt-client.c:2418
2 0x0051d5a6 in disc_att_send_op (data=0xad5cd0) at src/shared/att.c:569
3 0x0051dffc in disconnect_cb (io=<optimized out>, user_data=0xadb400) at src/shared/att.c:602
4 0x00524298 in watch_callback (channel=<optimized out>, cond=<optimized out>, user_data=<optimized out>) at src/shared/io-glib.c:170
5 0xf75318e8 in g_main_dispatch (context=0xac5f80) at gmain.c:3234
6 g_main_context_dispatch (context=context@entry=0xac5f80) at gmain.c:3887
7 0xf7531c78 in g_main_context_iterate (context=0xac5f80, block=block@entry=1, dispatch=dispatch@entry=1, self=<optimized out>) at gmain.c:3960
8 0xf7531fd8 in g_main_loop_run (loop=0xac5ee0) at gmain.c:4156
9 0x004b032c in main (argc=<optimized out>, argv=<optimized out>) at src/main.c:723
gdb) bt full 3
0 0x00520b98 in ext_prop_read_cb (success=false, att_ecode=0 '\000', value=0x0, length=0, user_data=0xad5310) at src/shared/gatt-client.c:746
op = 0xad5310
client = <optimized out>
discovering = 247
desc_attr = <optimized out>
1 0x0051e62a in read_cb (opcode=<optimized out>, pdu=<optimized out>, length=<optimized out>, user_data=<optimized out>) at src/shared/gatt-client.c:2418
req = <optimized out>
op = <optimized out>
success = <optimized out>
att_ecode = <optimized out>
value = 0x0
value_len = <optimized out>
2 0x0051d5a6 in disc_att_send_op (data=0xad5cd0) at src/shared/att.c:569
op = 0xad5cd0
Change-Id: I6f817e21a4a75c3c36f62d1d102e189be5088968
DoHyun Pyun [Wed, 23 May 2018 04:49:17 +0000 (13:49 +0900)]
Modify the deny policy
Change-Id: I56e778e62aca7c9fba729e740b11e84e96872fa9
Signed-off-by: DoHyun Pyun <dh79.pyun@samsung.com>
Pyun DoHyun [Tue, 22 May 2018 23:31:48 +0000 (23:31 +0000)]
Merge "Fix : Address is wrong in GATT Callback" into tizen
Atul Rai [Fri, 18 May 2018 06:44:46 +0000 (12:14 +0530)]
Removed unnecessary compilation flags
Change-Id: I2af88a3f6bd6645857826c58eefee97d5dbb46b5
Signed-off-by: Atul Rai <a.rai@samsung.com>
Atul Rai [Fri, 18 May 2018 03:00:26 +0000 (08:30 +0530)]
[Mesh] Adapt meshctl for Tizen platform
Change-Id: I094dd7ecd8f41f9db79cead816b870de18e0330b
Signed-off-by: Atul Rai <a.rai@samsung.com>
injun.yang [Thu, 17 May 2018 09:33:56 +0000 (18:33 +0900)]
Fix : Address is wrong in GATT Callback
[Problem] Address is wrong in GATT read/write callback
[Cause & Measure] Bluez pass IDA instead of first RPA.
If rpa existed then pass it into GATT read/write callback.
[Checking Method] GATT read/write in server
Change-Id: Id26144ca307572ae9ff6839a033f986f21285cb9
Pyun DoHyun [Fri, 18 May 2018 03:01:11 +0000 (03:01 +0000)]
Merge "Import meshctl & bt-shell related apis and fixes" into tizen
Pyun DoHyun [Thu, 17 May 2018 23:54:50 +0000 (23:54 +0000)]
Merge "Fix Memory leak" into tizen
Pyun DoHyun [Thu, 17 May 2018 23:54:41 +0000 (23:54 +0000)]
Merge "Fix possible invalid memory access" into tizen
Nagaraj D R [Thu, 17 May 2018 15:03:36 +0000 (20:33 +0530)]
Fix possible invalid memory access
Uninitialized data is read from local variable 'addr'
Change-Id: Id8288428e93a8dda08d67a507fd97caf5fae080e
Nagaraj D R [Thu, 17 May 2018 14:28:03 +0000 (19:58 +0530)]
Fix Memory leak
Memory associated with 'adv_data' will be leaked in case of
'generate_scan_rsp' failure
Change-Id: I57fdaa060ecfbf59f03ca16e074ddce7a8e14c9d
Nagaraj D R [Thu, 17 May 2018 12:42:59 +0000 (18:12 +0530)]
Fix improper usage of g_free
g_free should be used for only those memory allocations
done through glib APIs
Change-Id: I5d5275574b0d273594f86786956d86355794db94
Nagaraj D R [Thu, 17 May 2018 10:50:05 +0000 (16:20 +0530)]
src/device.c : Fix BREDR-ATT MTU issue
For BREDR-ATT, according to spec, ATT MTU is same has
L2CAP configured MTU on which ATT is running and there won't be
ATT MTU exchange procedure. So, set the MTU to L2CAP MTU for
BREDR-ATT and for LE-ATT adjust the ATT MTU based on
EXCHANGE_MTU request and response.
Change-Id: Icd402edbfa7ddb82e808ebf695096b7a872ebc14
Nagaraj D R [Thu, 17 May 2018 12:13:23 +0000 (17:43 +0530)]
Fix bluetoothd crash issue
Bluetoothd crashes when any application invokes "Introspect"
dbus method call on device-interface hosted by any device object path.
Declaration of device_signals is corrected
call stack
0 0xb6bfc3ee in strlen () from /lib/libc.so.6
1 0xb6bc69e4 in vfprintf () from /lib/libc.so.6
2 0xb6c65db0 in __vasprintf_chk () from /lib/libc.so.6
3 0xb6dbe404 in g_vasprintf () from /lib/libglib-2.0.so.0
4 0xb6da5dac in g_string_append_vprintf () from /lib/libglib-2.0.so.0
5 0xb6da5e7c in g_string_append_printf () from /lib/libglib-2.0.so.0
6 0xb6efbe94 in print_arguments (gstr=gstr@entry=0xb7f521a0,
args=0xb6f221fc, direction=direction@entry=0x0) at gdbus/object.c:123
7 0xb6efc624 in generate_interface_xml (iface=<optimized out>,
gstr=0xb7f521a0) at gdbus/object.c:187
8 generate_introspection_xml (data=0xb7f538a0, data=0xb7f538a0,
path=0xb7f462e0 "/org/bluez/hci0/dev_E4_FA_ED_DF_2C_2D", conn=0xb7f40590)
at gdbus/object.c:236
9 introspect (connection=0xb7f40590, message=0xb7f44908,
user_data=0xb7f538a0) at gdbus/object.c:263
10 0xb6efd13a in process_message (connection=connection@entry=0xb7f40590,
message=message@entry=0xb7f44908,
iface_user_data=iface_user_data@entry=0xb7f538a0,
method=0xb6f42324 <introspect_methods>,
method=0xb6f42324 <introspect_methods>) at gdbus/object.c:282
11 0xb6efd3b8 in generic_message (connection=0xb7f40590, message=0xb7f44908,
user_data=<optimized out>) at gdbus/object.c:1106
Change-Id: I8bd5c0e575f23f29945df49bbc3a807d55829989
Atul Rai [Thu, 17 May 2018 11:48:04 +0000 (17:18 +0530)]
Import meshctl & bt-shell related apis and fixes
This patch imports the new meshctl and bt-shell apis and fixes from
open source bluez (https://git.kernel.org/pub/scm/bluetooth/bluez.git).
Change-Id: Iffa5b474c3246938f2b907eabd58c43a7e36c34a
Signed-off-by: Atul Rai <a.rai@samsung.com>
injun.yang [Wed, 16 May 2018 07:28:36 +0000 (16:28 +0900)]
Revert "Fix : GATT Client invokes the callback of send_op when att_send_op is canceled"
This reverts commit
f822b480166cd56c3ca8ef2b507ce242453ed582.
Upstream patch (22737d...) has been applied
to fix an issue which was resolved by Tizen patch.
So this patch reverts the related Tizen patch.
Change-Id: I64987117adbec00cd8299b72434eb132f5a1d59e
Signed-off-by: injun.yang <injun.yang@samsung.com>
Pyun DoHyun [Mon, 14 May 2018 06:39:31 +0000 (06:39 +0000)]
Merge "SIGSEGV, Segmentation fault in gatt indication confirm" into tizen
DoHyun Pyun [Mon, 14 May 2018 05:17:24 +0000 (14:17 +0900)]
Fix TCT fail issue on ARTIK530
If LE discoverying is not completed successly, we should remove
le_discovery_list explictly. Because stop_le_discovery_complete
function will be not called in this exception case.
Change-Id: I1fd812d451121b795105ced5a1723e3187e1d86e
Signed-off-by: DoHyun Pyun <dh79.pyun@samsung.com>
DoHyun Pyun [Mon, 14 May 2018 03:58:31 +0000 (12:58 +0900)]
Add 'Requires' in extension-bredr and extension-le package
Change-Id: Ic8b6deb2446ed4a0e4b5232841ecf52aebc0b2be
Signed-off-by: DoHyun Pyun <dh79.pyun@samsung.com>
Wootak Jung [Tue, 8 May 2018 06:23:57 +0000 (15:23 +0900)]
Change file mode to 750 from 755
File mode need to be fixed to 750(user/group/other),
'other' should not access for this file.
Change-Id: Iab0dcf46d11d6f426c2fd38c94157890bcfc22d5
Wootak Jung [Fri, 4 May 2018 04:20:41 +0000 (13:20 +0900)]
Fix privilege violations
Need to check privilege for direct method call
Change-Id: Ic3bc8f74207cf46d56e8dab66ceb13b0cc86e6f4
Avichal Agarwal [Thu, 3 May 2018 12:40:48 +0000 (18:10 +0530)]
SIGSEGV, Segmentation fault in gatt indication confirm
Program received signal SIGSEGV, Segmentation fault.
0xf71fbcee in strlen () from /lib/libc.so.6
(gdb) bt
destroy=destroy@entry=0x0) at gdbus/client.c:909
Change-Id: Ib3dc7579970e80ff3f4fb808d0b42a869e819731
Wootak Jung [Tue, 17 Apr 2018 08:23:06 +0000 (17:23 +0900)]
Add default deny policy in conf files
Change-Id: I2cc23b5e6dfa06c52699e89a513dc378a18eb2a6
Pyun DoHyun [Tue, 10 Apr 2018 23:06:54 +0000 (23:06 +0000)]
Merge "Fix the coverity issue" into tizen
Hyuk Lee [Tue, 10 Apr 2018 06:40:08 +0000 (15:40 +0900)]
Fix the coverity issue
Change-Id: Iddc012db1b40444c7f47fa53267547dd9277d6c0
Signed-off-by: Hyuk Lee <hyuk0512.lee@samsung.com>
Hyuk Lee [Mon, 9 Apr 2018 06:32:05 +0000 (15:32 +0900)]
Remove the bluez service file
We changed the bluez's UID/GID to network_fw.
Daemon will be launched by bluez-start.service in bluetooth-tools.
Change-Id: I48b83b5647ac4665e90d08539aa54cba8593f7f4
Signed-off-by: Hyuk Lee <hyuk0512.lee@samsung.com>
Hyuk Lee [Wed, 28 Mar 2018 02:38:21 +0000 (11:38 +0900)]
Add the delay report property
Change-Id: I3abe8e8b71bb39027c2f0c29e326fc8acc3b6cdb
Signed-off-by: Hyuk Lee <hyuk0512.lee@samsung.com>
Amit Purwar [Wed, 4 Apr 2018 12:07:48 +0000 (17:37 +0530)]
Fix A2DP Sink device disconnect after pause and play
Change-Id: I35ced6cb1ef63f430c2120e3edc680e767929ea0
Signed-off-by: Amit Purwar <amit.purwar@samsung.com>
Pyun DoHyun [Thu, 29 Mar 2018 05:07:20 +0000 (05:07 +0000)]
Merge "Enable check-TESTS using %check section in bluez" into tizen
Atul Rai [Wed, 28 Mar 2018 10:58:55 +0000 (16:28 +0530)]
Enable check-TESTS using %check section in bluez
This patch enables check-TESTS (unit test case execution) for bluez at
build time using %check section in bluez.spec. This patch,
- Modifies unit/test-gobex.c, unit/test-gatt.c, unit/test-hog.c and
unit/test-gattrib.c to handle Tizen specific changes in BlueZ.
- Disables crypto test cases (unit/test-crypto) as QEMU (v2.7.0) in
Tizen does not support AF_ALG socket option for cypher algorithms.
Change-Id: I5a49ac00a26fe5c1baf92b02915cf1bcfa30f68b
Signed-off-by: Atul Rai <a.rai@samsung.com>
Abhishek Chandra [Tue, 27 Mar 2018 09:32:51 +0000 (15:02 +0530)]
[BlueZ] BlueZ Upgrade changes missed for OOB(out of band)
merged to fix TCT failures.
Change-Id: I6c8e71823a8d3f7254318d3f7759c334b6eb9a4d
Signed-off-by: Abhishek Chandra <abhishek.ch@samsung.com>
Hyuk Lee [Mon, 26 Mar 2018 01:40:57 +0000 (10:40 +0900)]
Add the bluetooth.service file to wearable profile
Change-Id: Ia04887e12d41ff49ef7dac3147df166f96e79efc
Signed-off-by: Hyuk Lee <hyuk0512.lee@samsung.com>
Avichal Agarwal [Thu, 22 Mar 2018 07:56:31 +0000 (13:26 +0530)]
Coverity Fix :CID 28838 :. leaked_storage: Variable uuid
going out of scope leaks the storage it points to
Change-Id: I948df8fae62bf440ac4d50a9a7cfa9cc95bdcec3