OSDN Git Service
Marcel Holtmann [Tue, 21 Feb 2012 13:09:14 +0000 (14:09 +0100)]
mgmt-api: Update comments for setting handling and errors
Marcel Holtmann [Tue, 21 Feb 2012 12:26:52 +0000 (13:26 +0100)]
mgmt-api: Add comments for valid commands when power off
Marcel Holtmann [Mon, 20 Feb 2012 23:05:56 +0000 (00:05 +0100)]
mgmt-api: Add command for setting Device ID details
Johan Hedberg [Mon, 20 Feb 2012 22:20:27 +0000 (00:20 +0200)]
mgmt: Update stop_discovery and ev_discovering to match API spec
Johan Hedberg [Mon, 20 Feb 2012 22:17:58 +0000 (00:17 +0200)]
btmgmt: Add hs command
Marcel Holtmann [Mon, 20 Feb 2012 20:19:25 +0000 (21:19 +0100)]
mgmt-api: Add address type to stop discovery command and the event
Marcel Holtmann [Mon, 20 Feb 2012 20:15:06 +0000 (21:15 +0100)]
mgmt-api: The command status is never a positive response
Marcel Holtmann [Mon, 20 Feb 2012 20:10:09 +0000 (21:10 +0100)]
mgmt-api: Fix a small typo
Marcel Holtmann [Mon, 20 Feb 2012 20:07:30 +0000 (21:07 +0100)]
mgmt-api: Fix a few entries for command status vs command complete
Marcel Holtmann [Mon, 20 Feb 2012 19:17:45 +0000 (20:17 +0100)]
monitor: Add string tables for HCI commands and events
Marcel Holtmann [Mon, 20 Feb 2012 17:17:34 +0000 (18:17 +0100)]
monitor: Add basic packet processing
Marcel Holtmann [Mon, 20 Feb 2012 15:11:26 +0000 (16:11 +0100)]
monitor: Add skeleton for new monitoring tool
Marcel Holtmann [Mon, 20 Feb 2012 15:03:42 +0000 (16:03 +0100)]
tracer: Remove wrong attempt in building a HCI mointor in userspace
Johan Hedberg [Mon, 20 Feb 2012 12:44:09 +0000 (14:44 +0200)]
mgmtops: Fix pairable setting when powering down adapter
Johan Hedberg [Mon, 20 Feb 2012 12:11:06 +0000 (14:11 +0200)]
btmgmt: Add version command
Johan Hedberg [Sun, 19 Feb 2012 23:17:07 +0000 (01:17 +0200)]
mgmtops: Fail if read_version fails
If the mgmt_read_version command fails or indicates a too old version we
should just abort since mgmt will in this case be mostly non-functional.
Johan Hedberg [Sun, 19 Feb 2012 11:53:59 +0000 (13:53 +0200)]
btmgmt: Add block & unblock commands
Johan Hedberg [Sun, 19 Feb 2012 11:53:36 +0000 (13:53 +0200)]
core: Fix block/unblock events for non-exitent devices
Johan Hedberg [Sat, 18 Feb 2012 12:44:08 +0000 (14:44 +0200)]
mgmt: Move status return paramters into the cmd_complete header
Johan Hedberg [Sat, 18 Feb 2012 12:11:22 +0000 (14:11 +0200)]
mgmt: Swap cmd_status parameters to match API
Luiz Augusto von Dentz [Fri, 17 Feb 2012 14:17:36 +0000 (16:17 +0200)]
audio: Fix signature of MediaTransport.Acquire method
Acquire returns the input and output MTUs in addition to the file
descriptor, but the signature doesn't indicate that.
Marcel Holtmann [Fri, 17 Feb 2012 14:31:48 +0000 (15:31 +0100)]
mgmt-api: Add comments if command status or command complete is returned
Johan Hedberg [Fri, 17 Feb 2012 14:01:09 +0000 (16:01 +0200)]
mgmt-api: Reorder cmd_status parameters
It makes more sense for the opcode to come before the status (since it
is part of the context).
Johan Hedberg [Fri, 17 Feb 2012 14:00:31 +0000 (16:00 +0200)]
mgmt-api: Fix symmetry of (Un)Block command/reply parameters
Johan Hedberg [Fri, 17 Feb 2012 13:58:38 +0000 (15:58 +0200)]
mgmt-api: Fix symmetry of OOB command/reply parameters
Johan Hedberg [Fri, 17 Feb 2012 13:57:37 +0000 (15:57 +0200)]
mgmt-api: Clarify unpair_device disconnect parameter
Johan Hedberg [Fri, 17 Feb 2012 13:55:37 +0000 (15:55 +0200)]
mgmt-api: Fix PIN Code command & reponse parameters
Johan Hedberg [Fri, 17 Feb 2012 13:53:16 +0000 (15:53 +0200)]
mgmt-api: Add status parameter to command complete event
Since this is needed by almost all command responses it makes more sense
to just have it part of the command complete event.
Johan Hedberg [Fri, 17 Feb 2012 13:51:51 +0000 (15:51 +0200)]
mgmt-api: Add address_type to start_discovery response
Johan Hedberg [Fri, 17 Feb 2012 13:51:04 +0000 (15:51 +0200)]
mgmt-api: Remove bogus old_key_type parameter
Johan Hedberg [Fri, 17 Feb 2012 12:30:31 +0000 (14:30 +0200)]
mgmt: Update implementation to match latest API
This patch adds an address type parameter to all places where the latest
API expects there to be one.
Johan Hedberg [Fri, 17 Feb 2012 11:41:14 +0000 (13:41 +0200)]
mgmt-api: Add Address_Type to all messages with an Address
Strictly speaking the address type isn't needed in all messages (e.g.
those specific to BR/EDR or pre-2.1) but for consistency it's cleaner to
have it everywhere. The only exception is the read_controller_info reply
where it really doesn't make sense to have it.
Johan Hedberg [Fri, 17 Feb 2012 11:41:02 +0000 (13:41 +0200)]
mgmt-api: Fix typo with wrong capitalization
Johan Hedberg [Thu, 16 Feb 2012 23:02:39 +0000 (01:02 +0200)]
btmgmt: Add support for Set SSP command
Johan Hedberg [Thu, 16 Feb 2012 21:55:33 +0000 (23:55 +0200)]
btmgmt: Add support for Set Link Security command
Anderson Lizardo [Wed, 15 Feb 2012 12:38:19 +0000 (08:38 -0400)]
thermometer: Fix re-enabling notification/indication on reconnection
If a result callback is not specified for gatt_write_char() it is
assumed that Write Command will be used. This is not valid for
Characteristic Descriptors, which only support Write Request.
Anderson Lizardo [Wed, 15 Feb 2012 12:38:18 +0000 (08:38 -0400)]
thermometer: Fix handling of missing Temperature Type
According to HTS 1.0 (Table 3.1, and Sections 3.1.1.4 and 3.2), the
Temperature Type Characteristic is optional. The only restriction is
that it shall not be present if the Temperature Type is non-static, for
which case the "Temperature Type" field shall be present on the
Temperature Measurement Characteristic value.
Given there is no default value specified when the Temperature Type is
static and unknown, the "Type" entry for MeasurementReceived() on the
Thermometer API was made optional.
Bruna Moreira [Wed, 15 Feb 2012 12:38:17 +0000 (08:38 -0400)]
thermometer: Fix device driver probe
The probe() function for GATT profiles should be transport agnostic.
There is a btd_device_get_primaries() method which can be used to return
a list of discovered GATT Primary Services, and it works for BR/EDR and
LE. It is already used for Proximity, for instance.
device_services_from_record() is BR/EDR specific and should not be used
by GATT profile code.
It also fixes a memory leak, given device_services_from_record() returns
a heap allocated GSList.
Anderson Lizardo [Tue, 14 Feb 2012 16:06:04 +0000 (12:06 -0400)]
device: Fix memory leak during GATT service update
GATT service updates are not supported yet. This patch avoids a memory
leak and GATT service storage corruption due to trying to register GATT
services twice.
After adding support for Services Changed characteristic notification
(which is mandatory for GATT clients), this check can be removed.
Anderson Lizardo [Tue, 14 Feb 2012 16:06:03 +0000 (12:06 -0400)]
device: Fix invalid D-Bus calls during Reverse GATT Discovery
There is no D-Bus client active during Reverse GATT Discovery, therefore
BlueZ should not send any D-Bus replies. This fixes errors reported by
D-Bus internal checks:
process 453: arguments to dbus_message_new_method_return() were
incorrect, assertion "method_call != NULL" failed in file dbus-message.c
line 1111.
Anderson Lizardo [Tue, 14 Feb 2012 16:06:02 +0000 (12:06 -0400)]
device: Fix invalid memory read during GATT discovery
device->browse should be set to NULL before calling
browse_request_free(), otherwise it points to freed memory.
Anderson Lizardo [Tue, 14 Feb 2012 16:06:01 +0000 (12:06 -0400)]
device: Fix NULL pointer dereference during GATT service discovery
If reverse service discovery for GATT is triggered,
device_browse_primary() is called with a NULL "conn" parameter. This fix
is based on similar code found in device_browse_sdp().
This fixes errors like:
process 871: arguments to dbus_connection_ref() were incorrect,
assertion "connection != NULL" failed in file dbus-connection.c line
2549.
This is normally a bug in some application using the D-Bus library.
process 871: arguments to dbus_connection_get_object_path_data() were
incorrect, assertion "connection != NULL" failed in file
dbus-connection.c line 5639.
This is normally a bug in some application using the D-Bus library.
process 871: arguments to dbus_connection_register_object_path() were
incorrect, assertion "connection != NULL" failed in file
dbus-connection.c line 5461.
This is normally a bug in some application using the D-Bus library.
Johan Hedberg [Wed, 15 Feb 2012 12:01:41 +0000 (14:01 +0200)]
btmgmt: Update opcode and event tables
Johan Hedberg [Wed, 15 Feb 2012 11:52:53 +0000 (13:52 +0200)]
btmgmt: Add read_commands support
Johan Hedberg [Wed, 15 Feb 2012 11:17:01 +0000 (13:17 +0200)]
test-discovery: Make output a bit more readable
Add an empty line between device found entries to make the output more
readable.
Anderson Lizardo [Mon, 13 Feb 2012 13:12:25 +0000 (09:12 -0400)]
mgmtops: Improve event size mismatch messages
This makes them consistent, and updates the function names.
Vinicius Costa Gomes [Fri, 10 Feb 2012 21:47:52 +0000 (18:47 -0300)]
adapter: Fix possible invalid memory access
Vinicius Costa Gomes [Fri, 10 Feb 2012 21:40:06 +0000 (18:40 -0300)]
hciconfig: Fix compiler warnings related to unaligned memory access
Vinicius Costa Gomes [Fri, 10 Feb 2012 21:40:05 +0000 (18:40 -0300)]
hciconfig: Fix using old-style initializers
Vinicius Costa Gomes [Fri, 10 Feb 2012 21:40:02 +0000 (18:40 -0300)]
mgmtops: Fix doing a useless memset()
The buffers were already allocated using g_try_malloc0().
Vinicius Costa Gomes [Fri, 10 Feb 2012 21:40:01 +0000 (18:40 -0300)]
network: Fix clang compiler warnings related to unaligned memory access
Vinicius Costa Gomes [Fri, 10 Feb 2012 21:39:59 +0000 (18:39 -0300)]
audio: Fix clang compiler warnings regarding implicit enum conversion
It was expected that source_get_state() returned a source_state_t, and
that sink_get_state() returned a sink_state_t.
Vinicius Costa Gomes [Fri, 10 Feb 2012 21:39:55 +0000 (18:39 -0300)]
dun: Fix using old-style initializers
Vinicius Costa Gomes [Fri, 10 Feb 2012 21:39:49 +0000 (18:39 -0300)]
tools: Fix using old-style initializers
Vinicius Costa Gomes [Fri, 10 Feb 2012 21:39:51 +0000 (18:39 -0300)]
lib: Fix using old-style initializers
Claudio Takahasi [Thu, 9 Feb 2012 16:02:21 +0000 (13:02 -0300)]
attrib-server: Fix invalid IO channel unref
This patch fixes an invalid read for incoming connections when
the remote initiates the link disconnection.
Claudio Takahasi [Thu, 9 Feb 2012 15:56:09 +0000 (12:56 -0300)]
GAttrib: Remove unused function
GAttrib disconnection tracking is being moved to device.c
Claudio Takahasi [Thu, 9 Feb 2012 15:56:08 +0000 (12:56 -0300)]
device: Add common ATT connection cleanup function
Claudio Takahasi [Thu, 9 Feb 2012 15:56:07 +0000 (12:56 -0300)]
device: Remove GAttrib disconnect callback
This patch replaces the usage of GAttrib disconnection callback by
GIOChannel watch to track ATT channel disconnection. Connection
management is being centralized in device to allow multi-profile
implementations.
Claudio Takahasi [Thu, 9 Feb 2012 15:56:06 +0000 (12:56 -0300)]
attrib-server: Remove GAttrib disconnect callback
This patch replaces the usage of GAttrib disconnection callback by
GIOChannel watch to track ATTIO channel disconnection aiming to achieve
less dependencies between attrib server, device and GAttrib.
Vinicius Costa Gomes [Thu, 9 Feb 2012 15:56:05 +0000 (12:56 -0300)]
device: Fix trying to connect if already connected
Claudio Takahasi [Thu, 9 Feb 2012 15:56:04 +0000 (12:56 -0300)]
device: Fix notifying ATTIO drivers when browsing
If disconnection happens during the primary service discovery ATTIO
drivers should not be notified.
Claudio Takahasi [Thu, 9 Feb 2012 15:56:03 +0000 (12:56 -0300)]
device: Consolidate ATT connection management
This patch centralizes the connection management for ATT channels
grouping the common code. Based on the result of the ATT connection
result, error or success callback is called.
Mikel Astiz [Tue, 14 Feb 2012 09:06:34 +0000 (10:06 +0100)]
audio: do not disconnect on gateway SCO failure
Failure on BlueZ-initiated SCO requests should not drop the RFCOMM
connection to the gateway. Instead, considering the stream as suspended
should be enough.
Mikel Astiz [Tue, 14 Feb 2012 09:06:33 +0000 (10:06 +0100)]
a2dp: return NotSupported error if no server found
With both sink and sources disabled, the A2DP server is not even
registered in audio_manager_init. When trying to register the endpoint,
this should result in the same error as if the server existed but the
profile was disabled.
Mikel Astiz [Tue, 14 Feb 2012 09:06:32 +0000 (10:06 +0100)]
audio: gateway_unlock together with in_use = FALSE
Calling gateway_unlock seems safer in gateway_suspend_complete, in
combination with the update of transport->in_use. This avoids the
transitional state of having the gateway unlocked but the transport
still in use.
This approach is also more consistent with the way headset and a2dp
handle it.
Johan Hedberg [Fri, 10 Feb 2012 10:18:12 +0000 (12:18 +0200)]
mgmt-api: Reorder parameters for read_commands
It makes more sense to have the num_commands and num_events parameters
in the beginning so that the message length can be validated up front.
Johan Hedberg [Thu, 9 Feb 2012 16:24:26 +0000 (18:24 +0200)]
mgmt: Add mgmt_rp_read_commands struct definition
Marcel Holtmann [Thu, 9 Feb 2012 16:18:12 +0000 (17:18 +0100)]
mgmt-api: Add proper management supported commands command
Claudio Takahasi [Thu, 9 Feb 2012 15:41:38 +0000 (12:41 -0300)]
device: Remove unused variable
Claudio Takahasi [Thu, 9 Feb 2012 15:41:37 +0000 (12:41 -0300)]
GAttrib: Fix leak when remote disconnects
Claudio Takahasi [Thu, 9 Feb 2012 15:41:36 +0000 (12:41 -0300)]
GAttrib: Add debug message for GAttrib references
Johan Hedberg [Thu, 9 Feb 2012 14:58:00 +0000 (16:58 +0200)]
mgmtops: Add support for mgmt_ev_device_unpaired
Johan Hedberg [Thu, 9 Feb 2012 14:57:42 +0000 (16:57 +0200)]
event: Add btd_event_device_unpaired callback
Johan Hedberg [Thu, 9 Feb 2012 14:57:01 +0000 (16:57 +0200)]
btmgmt: Add Device Unpaired event decoding support
Johan Hedberg [Thu, 9 Feb 2012 14:02:51 +0000 (16:02 +0200)]
adapter_opts: Add address type to block() and unblock()
Johan Hedberg [Thu, 9 Feb 2012 13:41:15 +0000 (15:41 +0200)]
adapter_ops: Add address type to confirm_reply and passkey_reply
Johan Hedberg [Thu, 9 Feb 2012 12:32:30 +0000 (14:32 +0200)]
adapter_ops: Add address type to disconnect()
Johan Hedberg [Thu, 9 Feb 2012 12:06:04 +0000 (14:06 +0200)]
adapter_ops: Add address type to remove_bonding()
Johan Hedberg [Thu, 9 Feb 2012 11:33:54 +0000 (13:33 +0200)]
mgmt: Update implementation to match latest API
Anderson Lizardo [Fri, 3 Feb 2012 13:42:56 +0000 (09:42 -0400)]
proximity: Fix Proximity API to match documentation
Recently, the documented D-Bus interface for Proximity was changed to
prepare for the upcoming Proximity Reporter API.
Andre Guedes [Wed, 8 Feb 2012 20:35:49 +0000 (17:35 -0300)]
device: Remove unused fields from browse_req
Andre Guedes [Wed, 8 Feb 2012 20:35:48 +0000 (17:35 -0300)]
device: Move GAttrib reference to device
Save GAttrib reference directly in struct btd_device instead of the
temporary browse_req. GAttrib instance scope should not be restricted to
primary service browsing context only, it needs to be shared to upper
layers.
Andre Guedes [Wed, 8 Feb 2012 20:35:47 +0000 (17:35 -0300)]
device: Remove unused function parameter
This patch removes the unused shutdown parameter from
browse_request_free function.
Andre Guedes [Wed, 8 Feb 2012 20:35:46 +0000 (17:35 -0300)]
device: Use att_io in device_browse_primary
In order to have the same approach as att_connect function,
device_browse_primary function should save the reference to GIOChannel
at device->att_io. This way, we can properly shut it down if the browse
request is canceled during the connection attempt.
Anderson Lizardo [Wed, 8 Feb 2012 20:04:17 +0000 (16:04 -0400)]
mgmtops: Fix memory leak when parsing EIR
Andre Guedes [Wed, 8 Feb 2012 19:05:10 +0000 (16:05 -0300)]
device: Shutdown connection if ATTIO list is empty
Shutdown the ongoing connection attempt if the last ATTIO callback is
removed from the list.
Andre Guedes [Wed, 8 Feb 2012 17:55:08 +0000 (14:55 -0300)]
device: Reply ATT requests during bonding
Unlike BR/EDR which has a dynamically allocated L2CAP data channel, LE
has a fixed L2CAP channel where data are transmitted (CID 4). This means
that once the LE link is established the remote device is able to send
data (ATT messages) to the local device.
Due to the ATT sequential request-response protocol, once a client sends
a request to a server, that client shall send no other request to the
same server until a response PDU has been received. If the response PDU
arrives in 30 secs the remote device disconnects.
This way, in order to be able to reply ATT requests which may come
through channel ID 4 during the pairing, we first establish an ATT
connection and then we start the pairing process.
That issue was discovered during test sessions in UPF. We found some LE
devices sending ATT Requests in CID 4 while pairing was still in
progress
Andre Guedes [Wed, 8 Feb 2012 17:55:07 +0000 (14:55 -0300)]
device: Fix invalid read in att_connect_cb
We should keep a reference to GIOChannel created in att_connect so we
can properly shut it down if the device is removed during a connection
attempt. After establishing the connection, we drop the GIOChannel
reference because GAttrib will take the responsability of disconnect the
link based on the registered ATTIO connection callbacks.
This patch fixes the following invalid read reported by valgrind when
the device is removed and we have a ongoing connection attempt:
Invalid read of size 4
at 0x1A90D8: att_connect_cb (device.c:1712)
by 0x17EDB9: connect_cb (btio.c:169)
by 0x4E6E29C: g_main_context_dispatch (in /usr/lib/libglib-2.0.so.0.2800.8)
by 0x4E6EA77: ??? (in /usr/lib/libglib-2.0.so.0.2800.8)
by 0x4E6F0B9: g_main_loop_run (in /usr/lib/libglib-2.0.so.0.2800.8)
by 0x18ACB3: main (main.c:485)
Address 0x68aacb8 is 456 bytes inside a block of size 472 free'd
at 0x4C2556E: free (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
by 0x1A596B: device_free (device.c:248)
by 0x121EB5: remove_interface (object.c:563)
by 0x122288: g_dbus_unregister_interface (object.c:715)
by 0x1AAFD8: btd_device_unref (device.c:2636)
by 0x1A7912: device_remove (device.c:1058)
by 0x19F371: adapter_remove_device (adapter.c:1122)
by 0x1A0AD4: remove_device (adapter.c:1720)
by 0x1214C4: process_message (object.c:224)
by 0x121B60: generic_message (object.c:447)
by 0x51348C0: ??? (in /usr/lib/libdbus-1.so.3.5.7)
by 0x512679F: dbus_connection_dispatch (in /usr/lib/libdbus-1.so.3.5.7)
Andre Guedes [Wed, 8 Feb 2012 17:55:06 +0000 (14:55 -0300)]
device: Split att_connect_cb
In order to reduce code complexity, all code related to
device_browse_primary was moved to a new function called
browse_primary_connect_cb. This way att_connect_cb has only code related
to att_connect.
Anderson Lizardo [Wed, 8 Feb 2012 16:12:50 +0000 (12:12 -0400)]
proximity: Remove unused variable
Santiago Carot-Nemesio [Tue, 7 Feb 2012 13:37:58 +0000 (14:37 +0100)]
attrib-server: Fix bad error message
Santiago Carot-Nemesio [Tue, 7 Feb 2012 13:26:44 +0000 (14:26 +0100)]
attrib-server: Fix memory leak attaching attribute channels
Channel is not being released when the channel is attached over
an uninitialized GATT server.
Ilia Kolomisnky [Sun, 5 Feb 2012 14:58:58 +0000 (16:58 +0200)]
network: Add retries for BNEP connection setup
According to BNEP spec. v1.0, section 2.6.3, the
BNEP_SETUP_CONNECTION_REQUEST_MSG should be retransmitted if the response
is not received for a period between 1 to 30 sec. Current implementation
uses SO_RCVTIMEO socket option to sense reply time-out, which is
incorrect because it does not have effect on g_io_add_watch monitored
descriptors. This patch allows passing of TP/BNEP/CTRL/BV-02-C
certification test.
Luiz Augusto von Dentz [Mon, 6 Feb 2012 13:19:01 +0000 (15:19 +0200)]
sdptool: Add GoepL2capPsm decoding support
Johan Hedberg [Mon, 6 Feb 2012 20:54:14 +0000 (22:54 +0200)]
mgmt-api: Remove bogus Key_Type field from LTK messages
Johan Hedberg [Mon, 6 Feb 2012 10:03:11 +0000 (12:03 +0200)]
mgmt-api: Update to latest plans
- "Remove Keys" renamed to "Unpair Device" and moved to a more
appropriate location (after the other pairing commands)
- "Device Unpaired" event added
- Address_Type parameters added the relevant commands and events
- Address_Type vs Key_Type distinction made clearer
- Bogus '0' removed from opcodes
Vinicius Costa Gomes [Fri, 3 Feb 2012 23:06:45 +0000 (20:06 -0300)]
device: Fix doing SDP discovery for LE devices
If ReverseServiceDiscovery is enabled and we are connected to a LE
device, we should do a Primary Service Discovery, not a SDP discovery
(which doesn't even make sense).
Johan Hedberg [Fri, 3 Feb 2012 22:28:08 +0000 (00:28 +0200)]
btmgmt: Add support for BR/EDR-only and LE-only discovery
Arik Nemtsov [Fri, 3 Feb 2012 21:34:04 +0000 (23:34 +0200)]
proximity: make reporter work per-adapter
Register an adapter driver for reporter and add the adapter argument in
appropriate places.