Commit Graph

24341 Commits

Author SHA1 Message Date
Luiz Augusto von Dentz
5c6ef1c396 client: Rename set-timeout to timeout
Make the command return the current value if no parameters:

[bluetooth]# timeout 1
[bluetooth]# timeout
Timeout: 1 sec
2018-01-19 11:44:09 -02:00
Luiz Augusto von Dentz
f309255a99 client: Rename set-duration to duration
Make the command return the current value if no parameters:

[bluetooth]# duration 1
[bluetooth]# duration
Duration: 1 sec
2018-01-19 11:44:09 -02:00
Luiz Augusto von Dentz
aebb7e1973 client: Rename set-appearance to appearance
Make the command return the current value if no parameters:

[bluetooth]# appearance 0x0001
[bluetooth]# appearance
Appearance: Unknown (0x0001)
2018-01-19 11:44:09 -02:00
Luiz Augusto von Dentz
821ad2ecd4 client: Rename set-name to name
Make the command return the current value if no parameters:

[bluetooth]# name blah
[bluetooth]# name
LocalName: blah
2018-01-19 11:44:09 -02:00
Luiz Augusto von Dentz
0c33c99102 client: Rename set-tx-power to tx-power
Make the command return the current value if no parameters:

[bluetooth]# tx-power on
[bluetooth]# tx-power
Tx Power: on
2018-01-19 11:44:09 -02:00
Luiz Augusto von Dentz
045e6b9a10 client: Rename set-manufacturer to manufacturer
Make the command return the current value if no parameters:

[bluetooth]# manufacturer 2 00
[bluetooth]# manufacturer
Manufacturer: 2
  00
2018-01-19 11:44:09 -02:00
Luiz Augusto von Dentz
65eff5c2eb client: Rename set-service to service
Make the command return the current value if no parameters:

[bluetooth]# service 0x1820 00 00 00
[bluetooth]# service
	UUID: Internet Protocol Support (0x1820)
  00 00 00                                         ...
2018-01-19 11:44:09 -02:00
Luiz Augusto von Dentz
6f20dba32d 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
2018-01-19 11:44:09 -02:00
Szymon Janc
b916c9decc device: Fix Connect and ConnectProfile returing InProgress error
Calling Connect or ConnectProfile for device without resolved services
results in doing SDP browse first. After search is complete code was
suppose to continue with profile connection but was always returning
"InProgress" error due to browsing request not being cleared yet.
2018-01-19 14:33:06 +01:00
Grzegorz Kolodziejczyk
0c7f43be78 tools/btpclient: Add connected, disconnected event
This patch adds conntected, disconnected events for btp client.
2018-01-17 13:26:16 +01:00
Grzegorz Kolodziejczyk
2bc4a12a14 tools/btpclient: Add connect, disconnect commands
This patch adds start and stop connect, disconnect commands for btp
client.
2018-01-17 13:26:16 +01:00
Grzegorz Kolodziejczyk
70b4be8c53 tools/btpclient: Add start, stop advertising commands
This patch adds start and stop advertising commands for btp client.
2018-01-17 13:26:16 +01:00
Szymon Janc
5a392a82cd shared/btp: Use bdaddr_t for storing address
This is more convenient as it allows to use common helpers for address
comparison and convertion.
2018-01-17 11:29:20 +01:00
Szymon Janc
1e8da2a0fb tools/btpclient: Use address convertion function from libbluetooth
There is no need for internal helper.
2018-01-17 11:29:20 +01:00
Luiz Augusto von Dentz
7b0e377b0d 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.
2018-01-16 17:02:53 -02:00
Grzegorz Kolodziejczyk
00f4a456ec tools/btpclient: Fix setting/reseting connectable flag
Defined setting flag is presented as mask.
2018-01-15 14:25:46 +01:00
Marcel Holtmann
2c7190715e tools: Add utility for Realtek config file parsing 2018-01-05 21:46:38 +01:00
Luiz Augusto von Dentz
d80f68286c client: Remove use of double const argument 2018-01-02 14:19:26 -02:00
ERAMOTO Masaya
c75500df32 tools/obexctl: Add generator for session/transfer 2018-01-02 14:15:58 -02:00
ERAMOTO Masaya
fecdfcd323 tools/bluetooth-player: Add generator for player/item 2018-01-02 14:15:58 -02:00
ERAMOTO Masaya
203f5cb2f0 client: Use g_dbus_proxy_path_lookup() 2018-01-02 14:15:54 -02:00
ERAMOTO Masaya
529790b6a5 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.
2018-01-02 14:15:49 -02:00
ERAMOTO Masaya
6be85ab3bf tools/obexctl: Use g_dbus_proxy_lookup() instead of find_*
Uses g_dbus_proxy_lookup() instead of find_{session,transfer,message,opp,
map,ftp,pbap}
2018-01-02 14:15:48 -02:00
ERAMOTO Masaya
7407f970d8 tools/bluetooth-player: Use g_dbus_proxy_lookup() instead of find_*
Uses g_dbus_proxy_lookup() instead of find_{player,folder,item}
2018-01-02 14:15:47 -02:00
ERAMOTO Masaya
6bf4c63d66 client: Use g_dbus_proxy_lookup() 2018-01-02 14:15:46 -02:00
ERAMOTO Masaya
a5d01a31ab gdbus: Make proxy_lookup() global
Also adds the following feature to g_dbus_proxy_lookup().
 - It is more robust even if a proxy is NULL.
 - It checks if the passed interface is NULL.
 - It looks up from the position of the list specified by the index.
2018-01-02 14:15:27 -02:00
Grzegorz Kolodziejczyk
40306fda0b tools/btpclient: Add set connectable command
This patch adds set connectable command for btp client.
2018-01-02 10:18:43 +01:00
Grzegorz Kolodziejczyk
4dedbf6fd2 tools/btpclient: Add start, stop discovery commands
This patch adds start and stop discovery command for btp client.
2018-01-02 10:18:40 +01:00
Grzegorz Kolodziejczyk
c236f8cf55 tools/btpclient: Add device found event
This patch adds device found event handler. It's called when rssi
property of device changes and new device interface is added.
2018-01-02 10:17:58 +01:00
Grzegorz Kolodziejczyk
d3ca1bcc39 tools/btpclient: Add advertising proxy to adapter
Advertising manager proxy is required to handle advertise related
operations in adapter context.
2018-01-02 10:17:58 +01:00
Grzegorz Kolodziejczyk
bdc4b854ec tools/btpclient: Move string to address conversion to helper
This patch makes local helper with string to address conversion.
2018-01-02 10:17:58 +01:00
Marcel Holtmann
0d1e3b9c57 Release 5.48 2017-12-27 00:02:06 +01:00
Johan Hedberg
8f90b38846 monitor: Fix uuid.h includes
Commit e0e7eb08d5 tried to fix this, but
missed most of the files concerned.

Without the fix an out-of-tree build (e.g. make distcheck) will throw
errors like this:

  CC       monitor/l2cap.o
../monitor/l2cap.c:41:18: fatal error: uuid.h: No such file or directory
 #include "uuid.h"
2017-12-26 22:47:24 +02:00
Steve Brown
b80e4f58f6 mesh: meshctl: Correct display security
The case of a security command without an argument is not handled
and throws a segv.
2017-12-25 21:05:35 +02:00
Szymon Janc
6005a23b49 AUTHORS: Update Grzegorz's email 2017-12-22 13:23:18 +01:00
Grzegorz Kolodziejczyk
66b7839b83 shared/btp: Define gap device found flags as bit mask
This patch modifies gap device found flags to be bit masks as in other
defined flags groups in btp.
2017-12-22 11:49:01 +01:00
Szymon Janc
1432f11937 android/tester: Fix race in discovering devices
This makes sure that emulated device starts advertising only after
discovery is ongoing and that tests go further only after device
was found. Otherwise tests were randomly failing.
2017-12-22 10:14:22 +01:00
Szymon Janc
04503d8ed5 android/tester: Clarify default properties match names 2017-12-22 10:14:22 +01:00
Luiz Augusto von Dentz
e0e7eb08d5 monitor: Fix out of the tree build
When building outside the tree including uuid.h may not be found:

../monitor/packet.c:52:18: fatal error: uuid.h: No such file or directory
2017-12-21 16:56:49 +01:00
Szymon Janc
4c948b8e91 android/tester: Fix remote advertising data
Advertising Data doesn't have terminator field like EIR. This was
causing error logs from kernel when data length was corrected.
2017-12-21 16:56:45 +01:00
Luiz Augusto von Dentz
a58b0d05fc monitor: Use bt_appear_to_str
Remove appearance table used to decode appearance.
2017-12-21 10:08:22 -02:00
Luiz Augusto von Dentz
52e2d7a8c8 shared/util: Introduce bt_appear_to_str
This adds bt_appear_to_str which can decode the appearance code to a
human readable string.
2017-12-21 10:08:22 -02:00
Luiz Augusto von Dentz
7a03b61ee8 tools: Remove monitor/uuid.{c,h}
Use the shared/util.h helpers instead.
2017-12-21 10:08:22 -02:00
Luiz Augusto von Dentz
709bcef1fa shared/util: Add helpers to decode UUIDs strings
This adds helpers functions to decode UUIDs strings.
2017-12-21 10:08:22 -02:00
Szymon Janc
9fbde4dfc6 shared/gatt-client: Fix memory leak of ready callback
72 bytes in 3 blocks are definitely lost in loss record 161 of 244
   at 0x4C2FB6B: malloc (vg_replace_malloc.c:299)
   by 0x48D07D: btd_malloc (util.c:45)
   by 0x493992: bt_gatt_client_ready_register (gatt-client.c:1924)
   by 0x472BD7: gatt_client_init (device.c:4785)
   by 0x472BD7: device_attach_att (device.c:4919)
   by 0x4740A2: att_connect_cb (device.c:4963)
   by 0x445024: connect_cb (btio.c:232)
   by 0x50CEBB6: g_main_context_dispatch (in /usr/lib64/libglib-2.0.so.0.5400.2)
   by 0x50CEF5F: ??? (in /usr/lib64/libglib-2.0.so.0.5400.2)
   by 0x50CF271: g_main_loop_run (in /usr/lib64/libglib-2.0.so.0.5400.2)
   by 0x40BDE8: main (main.c:770)
2017-12-21 09:30:48 +01:00
Luiz Augusto von Dentz
4691b95198 shared/att: Fix possible crash when security is changed
When resending a PDU due to secure change the timeout_id shall also be
removed otherwise the following crash may occur:

Invalid read of size 8
   at 0x489639: timeout_cb (att.c:405)
   by 0x49417C: timeout_callback (timeout-glib.c:34)
   by 0x4E84AB2: ??? (in /lib/x86_64-linux-gnu/libglib-2.0.so.0.4800.2)
   by 0x4E84049: g_main_context_dispatch (in /lib/x86_64-linux-gnu/libglib-2.0.so.0.4800.2)
   by 0x4E843EF: ??? (in /lib/x86_64-linux-gnu/libglib-2.0.so.0.4800.2)
   by 0x4E84711: g_main_loop_run (in /lib/x86_64-linux-gnu/libglib-2.0.so.0.4800.2)
   by 0x40B51F: main (main.c:770)
 Address 0x6ce5830 is 32 bytes inside a block of size 192 free'd
   at 0x4C2EDEB: free (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
   by 0x48A89D: disconnect_cb (att.c:593)
   by 0x493D54: watch_callback (io-glib.c:170)
   by 0x4E84049: g_main_context_dispatch (in /lib/x86_64-linux-gnu/libglib-2.0.so.0.4800.2)
   by 0x4E843EF: ??? (in /lib/x86_64-linux-gnu/libglib-2.0.so.0.4800.2)
   by 0x4E84711: g_main_loop_run (in /lib/x86_64-linux-gnu/libglib-2.0.so.0.4800.2)
   by 0x40B51F: main (main.c:770)
2017-12-20 20:58:00 +01:00
Szymon Janc
2d58cc855d gdbus: Fix crash on proxy remove
If proxy was freed due to interface being removed remaining references
are left with NULL client pointer. We need to cancel pending calls that
require client when getting reply.

This fix following crash:
bluetoothd[2773]: src/gatt-database.c:proxy_removed_cb() Proxy removed - removing service: /test/app/hci0/service2
bluetoothd[2773]: src/gatt-database.c:gatt_db_service_removed() Local GATT service removed
bluetoothd[2773]: src/adapter.c:adapter_service_remove() /org/bluez/hci0
bluetoothd[2773]: src/adapter.c:remove_uuid() sending remove uuid command for index 0
bluetoothd[2773]: src/sdpd-service.c:remove_record_from_server() Removing record with handle 0x10008
bluetoothd[2773]: src/gatt-database.c:client_disconnect_cb() Client disconnected
==2773== Invalid read of size 8
==2773==    at 0x485220: proxy_added (client.c:288)
==2773==    by 0x485220: get_all_properties_reply (client.c:316)
==2773==    by 0x515A041: ??? (in /lib/x86_64-linux-gnu/libdbus-1.so.3.14.6)
==2773==    by 0x515DA60: dbus_connection_dispatch (in /lib/x86_64-linux-gnu/libdbus-1.so.3.14.6)
==2773==    by 0x47F2BF: message_dispatch (mainloop.c:72)
==2773==    by 0x4E84049: g_main_context_dispatch (in /lib/x86_64-linux-gnu/libglib-2.0.so.0.4800.2)
==2773==    by 0x4E843EF: ??? (in /lib/x86_64-linux-gnu/libglib-2.0.so.0.4800.2)
==2773==    by 0x4E84711: g_main_loop_run (in /lib/x86_64-linux-gnu/libglib-2.0.so.0.4800.2)
==2773==    by 0x40B51F: main (main.c:770)
==2773==  Address 0x88 is not stack'd, malloc'd or (recently) free'd
2017-12-20 10:48:53 -02:00
Steve Brown
0c6ec93755 mesh: meshctl: Make composition-get argument optional
It can't be both optional and required.

[config: Target = 0100]# composition-get 0
Unable to parse optional command arguments
2017-12-20 09:53:04 +01:00
Luiz Augusto von Dentz
f34557fbc8 gatt: Mark AcquireWrite and AcquireNotify as stable
AcquireWrite and AcquireNofify are required by meshctl.
2017-12-19 20:24:42 +01:00
Inga Stotland
c07b067ff1 mesh: meshctl: make model parsing more manageable
Extract functionality for finding an existing model from
parse_configuration_models() into new function find_configured_model().
This removes confusing logic from overloaded implementation of
parse_configuration_models().
2017-12-19 17:51:40 +01:00