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 ...
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.
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.
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.
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"
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.
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)
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)
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
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().