test-audio: Add --interface option
mgmtops: Fix calling btd_adapter_start() for an off adapter

When the adapter mode is off and the controller is down, we should
not consider that the adapter is powered up.
core: Use defines instead of magic numbers

The error-handling code should use the defines instead of magic numbers.
AVDTP: Fix leaking remote sep capabilities

124 (32 direct, 92 indirect) bytes in 2 blocks are definitely lost in loss record 220 of 259
   at 0x4A0884D: malloc (vg_replace_malloc.c:263)
   by 0x4C7F2BE: g_malloc (in /usr/lib64/libglib-2.0.so.0.3200.3)
   by 0x4C936B1: g_slice_alloc (in /usr/lib64/libglib-2.0.so.0.3200.3)
   by 0x4C949F2: g_slist_append (in /usr/lib64/libglib-2.0.so.0.3200.3)
   by 0x1376D6: caps_to_list (avdtp.c:1325)
   by 0x13CA2F: session_cb (avdtp.c:2881)
   by 0x4C796E4: g_main_context_dispatch (in /usr/lib64/libglib-2.0.so.0.3200.3)
   by 0x4C79A17: ??? (in /usr/lib64/libglib-2.0.so.0.3200.3)
   by 0x4C79E11: g_main_loop_run (in /usr/lib64/libglib-2.0.so.0.3200.3)
   by 0x11FF72: main (main.c:545)
audio: Fix possible crash while exitting

This was probably introduced by a0f543f0eb8ee35f5cfac3b86f0a88e3f01809ff
as it changes the order now media is unloaded before control causing:

Invalid read of size 8
   at 0x13D743: media_player_free (media.c:987)
   by 0x12F942: player_destroy (avrcp.c:1340)
   by 0x4C94B0C: g_slist_foreach (in /usr/lib64/libglib-2.0.so.0.3200.3)
   by 0x4C94B2A: g_slist_free_full (in /usr/lib64/libglib-2.0.so.0.3200.3)
   by 0x1307E7: avrcp_unregister (avrcp.c:1358)
   by 0x1249CB: avrcp_server_remove (manager.c:1075)
   by 0x4C94B0C: g_slist_foreach (in /usr/lib64/libglib-2.0.so.0.3200.3)
   by 0x179124: adapter_remove (adapter.c:2219)
   by 0x174F81: manager_cleanup (manager.c:285)
   by 0x11FFA2: main (main.c:391)
 Address 0x63dc990 is 32 bytes inside a block of size 40 free'd
   at 0x4A079AE: free (vg_replace_malloc.c:427)
   by 0x4C7F3CE: g_free (in /usr/lib64/libglib-2.0.so.0.3200.3)
   by 0x122442: remove_interface (object.c:564)
   by 0x122F89: g_dbus_unregister_interface (object.c:1247)
   by 0x124CC8: media_server_remove (manager.c:1112)
   by 0x4C94B0C: g_slist_foreach (in /usr/lib64/libglib-2.0.so.0.3200.3)
   by 0x179124: adapter_remove (adapter.c:2219)
   by 0x174F81: manager_cleanup (manager.c:285)
   by 0x11FFA2: main (main.c:391)
AVCTP: Make use of sendmsg to avoid copying data

This use sendmsg to send headers and operands in separated buffers
avoiding memcpy.
core: Fix using mgmt status values instead of HCI
AVCTP: Fix not zeroing out buffer

This could cause use of unitialized memory
audio: Fix minor coding style issues
btio: Rescue lost errorneous numbers

The BT_IO_ERROR_* flags are not used for anything else and we just
loosing errorneous numbers set in the sockets that might be more
useful for handling specific errors.

A use case would be disconnect errors that should not allow BlueZ to
enable auto connections since the connection would never be possible in
some cases.

This patch removes BT_IO_ERROR_* flags and use the errors set in the
sockets instead. Now, the errors passed in connect/disconnect callbacks
should contain proper error numbers passed to them.
Add Paulo Alcantara to AUTHORS
Add Jefferson Delfes to AUTHORS
Fix not setting class of device in adapter

Set class of device in adapter when new class is received from kernel.
This fix adapters property Class being always zero.
core: Fix memory leak while reading device records

btd_device_get_record does not free the current list of records when
reloading it from the storage:

   at 0x4A0884D: malloc (vg_replace_malloc.c:263)
   by 0x18EB85: sdp_list_append (sdp.c:1749)
   by 0x172798: create_stored_records_from_keys (storage.c:930)
   by 0x16FA73: textfile_foreach (textfile.c:475)
   by 0x1729C8: read_records (storage.c:966)
   by 0x17E439: btd_device_get_record (device.c:2991)
   by 0x17E4DC: device_services_from_record (device.c:1586)
   by 0x17677B: create_stored_device_from_profiles (adapter.c:1702)
   by 0x16FA73: textfile_foreach (textfile.c:475)
   by 0x1762BC: load_devices (adapter.c:1971)
   by 0x17A409: adapter_init (adapter.c:2422)
   by 0x175650: btd_manager_register_adapter (manager.c:364)
monitor: Fix endianness conversion

Flags field has 32-bit size. Same issue was fixed for mgmtops in
1801a4d45d74c29cebacaab79a07e9961300be41.
btmgmt: Fix endianness conversion

Flags field has 32-bit size. Same issue was fixed for mgmtops in
1801a4d45d74c29cebacaab79a07e9961300be41.
network: Check full BNEP UUID

This patch fixes an issue where only the 2 bytes containing the service
ID was checked from the BNEP UUID. Fixes behavior for BT test cases
TP/PAN/MISC/UUID/BV-01-C & TP/PAN/MISC/UUID/BV-02-C.
mgmt: Add reason to device disconnect event

Extend the management API with the disconnect reason, as now reported
by the Kernel in MGMT_EV_DEVICE_DISCONNECTED.
core: Fix not updating storage when mode changes

With mgmt interface bluetoothd is no longer requesting mode change for
things like DiscoverableTimeout as the kernel will do that automatically
when the timer expires.
network: Fix bnep setup failure handle bug

This patch initializes rsp varialbe again for the remain failure
procedure.