OSDN Git Service

android-x86/external-bluetooth-bluez.git
12 years agoAdd display lock watcher on maemo6 plugin
Anderson Briglia [Tue, 4 Oct 2011 18:31:43 +0000 (15:31 -0300)]
Add display lock watcher on maemo6 plugin

Implements display status signal watcher in maemo6 plugin.

12 years agoDisable automatic connections after 60 seconds
Claudio Takahasi [Tue, 4 Oct 2011 18:31:32 +0000 (15:31 -0300)]
Disable automatic connections after 60 seconds

12 years agoFix repeated connection attempt to the same remote
Claudio Takahasi [Tue, 4 Oct 2011 18:31:21 +0000 (15:31 -0300)]
Fix repeated connection attempt to the same remote

Avoids queue dupplicated requests connects for the same device. Sources
can be triggered by auto connect or on demand connection request when a
given profile registers ATTIO connection callbacks.

12 years agoAdd checking if profiles are requesting connection
Claudio Takahasi [Tue, 4 Oct 2011 18:31:09 +0000 (15:31 -0300)]
Add checking if profiles are requesting connection

Before triggering automatic ATTIO connections driven by platform event,
the device needs to check if there is at least one entry in the ATTIO
connection callback, meaning that there is profile requesting connection
and the state is auto connection.

12 years agoAdd continuous connection attempt
Claudio Takahasi [Tue, 4 Oct 2011 18:30:57 +0000 (15:30 -0300)]
Add continuous connection attempt

If auto connect is enabled, queue another connection attempt until
the adapter sets auto connect to FALSE. The behaviour depends on if the
address is found in the advertising cache or not.

12 years agoAdd set auto connect in device
Claudio Takahasi [Tue, 4 Oct 2011 18:30:46 +0000 (15:30 -0300)]
Add set auto connect in device

Skeleton of automatic connections driven by platform/user event.
Two layers will manage connections: Profiles can request on demand
connections registering ATTIO connection callbacks(one attempt) for
a given device and platform/user action can trigger automatic
connections for devices with ATTIO callbacks registered.

12 years agoRemove timer to trigger connection attempts
Claudio Takahasi [Tue, 4 Oct 2011 18:30:29 +0000 (15:30 -0300)]
Remove timer to trigger connection attempts

Removes continuous timer for ATTIO connection attempts. A new approach
is being implemented managing scanning and connection attempts driven
by platform/user actions. eg: screen unlocked.

12 years agoFix crash when remote connects to AVRCP without having a record
Luiz Augusto von Dentz [Wed, 5 Oct 2011 14:24:50 +0000 (17:24 +0300)]
Fix crash when remote connects to AVRCP without having a record

Device object may exist but control wont be initialized causing the
following crash:

Invalid read of size 8
   at 0x12B510: state_changed (control.c:90)
   by 0x12BA20: avctp_set_state (avctp.c:367)
   by 0x12C0DC: avctp_confirm_cb (avctp.c:733)
   by 0x166481: server_cb (btio.c:200)
   by 0x4E75ADC: g_main_context_dispatch (in /lib64/libglib-2.0.so.0.3000.0)
   by 0x4E762D7: ??? (in /lib64/libglib-2.0.so.0.3000.0)
   by 0x4E76824: g_main_loop_run (in /lib64/libglib-2.0.so.0.3000.0)
   by 0x11ED19: main (main.c:473)
 Address 0x8 is not stack'd, malloc'd or (recently) free'd

12 years agoFix not being able to register pdu handlers
Luiz Augusto von Dentz [Wed, 5 Oct 2011 14:24:30 +0000 (17:24 +0300)]
Fix not being able to register pdu handlers

This happens when removing and adding again an adapter

12 years agoFix missing initialization of A2DP error
Johan Hedberg [Wed, 5 Oct 2011 12:28:08 +0000 (15:28 +0300)]
Fix missing initialization of A2DP error

12 years agoMinor cleanup in attrib server channel disconnect
Claudio Takahasi [Tue, 4 Oct 2011 17:52:23 +0000 (14:52 -0300)]
Minor cleanup in attrib server channel disconnect

12 years agoAdd attrib server channel detach
Claudio Takahasi [Tue, 4 Oct 2011 17:50:28 +0000 (14:50 -0300)]
Add attrib server channel detach

BlueZ will act as GAP central role, so for outgoing connections the
central is responsible for disconnecting the link. This patch adds
a function allowing the central to detach from the local attribute
server(removing the last GAttrib reference).

12 years agoEmit LinkLossAlertLevel after writing the alert
Claudio Takahasi [Tue, 4 Oct 2011 17:22:43 +0000 (14:22 -0300)]
Emit LinkLossAlertLevel after writing the alert

12 years agoFix wrong write GATT-subprocedure for Link Loss
Claudio Takahasi [Tue, 4 Oct 2011 17:22:42 +0000 (14:22 -0300)]
Fix wrong write GATT-subprocedure for Link Loss

According to Link Loss Service specification, Write Characteristic
Value sub-procedure should be used to change the Alert Level.

12 years agoFix regression when disconnecting AVRCP
Luiz Augusto von Dentz [Mon, 3 Oct 2011 14:57:50 +0000 (17:57 +0300)]
Fix regression when disconnecting AVRCP

This prevent to disconnect AVRCP when doing e.g. Audio.Disconnect

12 years agoAVRCP: fix missing bytes on notification
Lucas De Marchi [Thu, 29 Sep 2011 17:07:29 +0000 (14:07 -0300)]
AVRCP: fix missing bytes on notification

12 years agoFilter duplicates by default with hcitool lescan
Johan Hedberg [Mon, 3 Oct 2011 12:16:24 +0000 (15:16 +0300)]
Filter duplicates by default with hcitool lescan

12 years agoUpdate company identifiers
Marcel Holtmann [Mon, 3 Oct 2011 02:40:25 +0000 (19:40 -0700)]
Update company identifiers

12 years agoFix Unref message after it was sent
Frédéric Danis [Fri, 30 Sep 2011 14:17:31 +0000 (16:17 +0200)]
Fix Unref message after it was sent

12 years agoAVRCP: fix changed notification
Lucas De Marchi [Thu, 29 Sep 2011 17:07:28 +0000 (14:07 -0300)]
AVRCP: fix changed notification

We sure want to send notifications only when section is not NULL.
Otherwise we either crash or do not send the expected notification.

12 years agoAVRCP: fix case when only one setting is provided
Lucas De Marchi [Wed, 28 Sep 2011 22:35:57 +0000 (19:35 -0300)]
AVRCP: fix case when only one setting is provided

If CT tries to change an Application Setting providing only one
setting, the size of the PDU will be 3 bytes. Therefore we should check
if the PDU is shorter than or equal 3, not only shorter.

12 years agoAVRCP: return empty string instead of rejecting
Lucas De Marchi [Wed, 28 Sep 2011 22:35:56 +0000 (19:35 -0300)]
AVRCP: return empty string instead of rejecting

If media attribute is not available for a certain media file, return an
empty string instead of rejecting the request. The spec is not so clear
if only the title should be handled as an empty string when not present,
but this is the only alternative to rejecting the request.

IOP tests showed that some CT devices don't like reject messages: they
never ask for an attribute again if they previously received a REJECTED
message for that attribute. They consider REJECTED as "TG doesn't
implement it these optional attributes" as opposed to what we had
before, "this attribute is currently not available".

12 years agoFix memory corruption when decoding Read Response PDU
Anderson Lizardo [Wed, 28 Sep 2011 19:01:32 +0000 (15:01 -0400)]
Fix memory corruption when decoding Read Response PDU

A bogus (or hostile) Proximity Reporter device may send a TX Power value
bigger than the buffer used. Therefore, create a temporary buffer with
the maximum size, and check for the length before using the value.

Note that all other current users of the dec_read_resp() already do
this. Another option would be to change dec_read_resp() to accept a
buffer length, but this would break external code, so it is avoided for
now.

12 years agoMention Andre's and Sheldon's contributions
Claudio Takahasi [Thu, 22 Sep 2011 17:02:05 +0000 (14:02 -0300)]
Mention Andre's and Sheldon's contributions

12 years agoRemove use of read_device_id in wiimote plugin
Luiz Augusto von Dentz [Thu, 22 Sep 2011 15:51:52 +0000 (18:51 +0300)]
Remove use of read_device_id in wiimote plugin

Make use of btd_device_get_vendor and btd_device_get_product intead.

12 years agoRemove use of read_device_id in input plugin
Luiz Augusto von Dentz [Thu, 22 Sep 2011 15:51:51 +0000 (18:51 +0300)]
Remove use of read_device_id in input plugin

Make use of btd_device_get_vendor, btd_device_get_product and
btd_device_get_version intead.

12 years agoPrint Vendor/Product/Version in hexadecimal
Luiz Augusto von Dentz [Thu, 22 Sep 2011 15:51:50 +0000 (18:51 +0300)]
Print Vendor/Product/Version in hexadecimal

This is how their are more commonly known.

12 years agoAdd Vendor, Product and Version properties to org.bluez.Device
Luiz Augusto von Dentz [Thu, 22 Sep 2011 15:51:49 +0000 (18:51 +0300)]
Add Vendor, Product and Version properties to org.bluez.Device

This identifiers can be used by applications to implements quirks which
seems to be very common in some profiles such as syncml and since this
information is already stored permanently we can quickly retrieve it
without having to connect or parse the records again.

12 years agoFix remove feedback DTMF tones timer on call release
Dmitriy Paliy [Tue, 27 Sep 2011 10:22:47 +0000 (13:22 +0300)]
Fix remove feedback DTMF tones timer on call release

User feedback DTMF tones queue is freed and timer removed when call
is released.

12 years agoFix play DTMF feeback tones only for active call
Dmitriy Paliy [Tue, 27 Sep 2011 10:22:46 +0000 (13:22 +0300)]
Fix play DTMF feeback tones only for active call

Check on active call is added for playing of DTMF feedback tones to
notify user. Network DTMF tones are handled by modem, and therefore
there is no need in special check for those.

12 years agoAdd playback of tones to handsfree
Dmitriy Paliy [Tue, 27 Sep 2011 10:22:45 +0000 (13:22 +0300)]
Add playback of tones to handsfree

StartEventTone and StopTone method calls to tone generator are added
to maemo6 telephony driver. Such implements playback of DTMF tones
in handsfree to notify user.

12 years agoFix error handling in start_dtmf_reply
Dmitriy Paliy [Tue, 27 Sep 2011 10:22:44 +0000 (13:22 +0300)]
Fix error handling in start_dtmf_reply

If csd replyed with error to StartDTMF, then StopDTMF method call
is not sent.

12 years agoReplace SendDTMF by StartDTMF/StopDTMF in maemo6
Dmitriy Paliy [Tue, 27 Sep 2011 10:22:43 +0000 (13:22 +0300)]
Replace SendDTMF by StartDTMF/StopDTMF in maemo6

SendDTMF method call is replaced by StartDTMF/StopDTMF in maemo6 telephony
driver. StartDTMF/StopDTMF places DTMF tone in queue on modem side playing
it minimum required time. When using SendDTMF, modem ignores new tone
until currently playing one is not finished.

Downside of StartDTMF/StopDTMF combination is absence of audio feedback to
hands-free.

12 years agoAVRCP: limit AVRCP packet size to the MTU of AV/C
Lucas De Marchi [Tue, 20 Sep 2011 18:31:34 +0000 (15:31 -0300)]
AVRCP: limit AVRCP packet size to the MTU of AV/C

AVRCP is an extension of AV/C spec which has a limit of 512 bytes. The
only place where it can exceed this value is in the response to
GetElementAttributes command.

Now we simply don't add the attributes that would overflow the available
buffer space.

12 years agoRename fast_connectable function in hciops
Antti Julku [Fri, 17 Jun 2011 09:44:14 +0000 (12:44 +0300)]
Rename fast_connectable function in hciops

Rename fast_connectable function in hciops to set_fast_connectable
to make it consistent with rest of the file and with mgmt interface
counterpart.

12 years agoImplement fast connectable mode for mgmt interface
Antti Julku [Fri, 17 Jun 2011 09:44:13 +0000 (12:44 +0300)]
Implement fast connectable mode for mgmt interface

Management interface implementation for fast connectable mode.

12 years agoFix test-proximity usage info
Claudio Takahasi [Fri, 23 Sep 2011 14:05:15 +0000 (11:05 -0300)]
Fix test-proximity usage info

12 years agoMinor style fix
Frédéric Dalleau [Fri, 23 Sep 2011 12:59:25 +0000 (14:59 +0200)]
Minor style fix

12 years agoRemove unneeded checks in gateway_is_connected
Frédéric Dalleau [Fri, 23 Sep 2011 12:59:24 +0000 (14:59 +0200)]
Remove unneeded checks in gateway_is_connected

12 years agoCheck all states before allowing gw connection
Frédéric Dalleau [Fri, 23 Sep 2011 12:59:23 +0000 (14:59 +0200)]
Check all states before allowing gw connection

12 years agoFix possible crash while removing a device
Luiz Augusto von Dentz [Fri, 23 Sep 2011 12:36:39 +0000 (15:36 +0300)]
Fix possible crash while removing a device

If adapter has more than one sdp session active find_by_bdaddr always
return the first one regardless if the device address match or not
which leads to the following crash:

Invalid read of size 4
   at 0x16CB31: search_cb (in /usr/sbin/bluetoothd)
   by 0x15C0CA: connect_watch (in /usr/sbin/bluetoothd)
   by 0x48CFD37: g_io_unix_dispatch (in /usr/lib/libglib-2.0.so.0.2800.6)
   by 0x488B4A0: g_main_context_dispatch (in /usr/lib/libglib-2.0.so.0.2800.6)
   by 0x488BCD0: g_main_context_iterate.clone.5 (in /usr/lib/libglib-2.0.so.0.2800.6)
   by 0x488C3B8: g_main_loop_run (in /usr/lib/libglib-2.0.so.0.2800.6)
   by 0x152D09: main (in /usr/sbin/bluetoothd)
  Address 0x4c8c600 is 16 bytes inside a block of size 48 free'd
   at 0x48234A9: free (in /usr/lib/valgrind/vgpreload_memcheck-x86-linux.so)
   by 0x48920F0: g_free (in /usr/lib/libglib-2.0.so.0.2800.6)
   by 0x16BDD3: browse_request_free (in /usr/sbin/bluetoothd)
   by 0x16C7A2: browse_request_cancel (in /usr/sbin/bluetoothd)

Reported by Alberto José Rodríguez Rodríguez <ajrodriguez@blulabs.es>

12 years agoAdd device blocking events to mgmt API documentation
Antti Julku [Fri, 23 Sep 2011 08:57:02 +0000 (11:57 +0300)]
Add device blocking events to mgmt API documentation

12 years agoFix Device UUIDs property list being sent empty
Claudio Takahasi [Mon, 19 Sep 2011 13:22:50 +0000 (10:22 -0300)]
Fix Device UUIDs property list being sent empty

When creating a new device, the UUIDs list is updated in the device
probing function. This patch moves the function call which emit the
signal after the device driver probing.

12 years agoFix the attrib server trying to handle responses
Vinicius Costa Gomes [Mon, 19 Sep 2011 13:20:00 +0000 (10:20 -0300)]
Fix the attrib server trying to handle responses

The attribute server should only try to handle ATT requests, responses
and events should be handled by the client.

12 years agoAttrib server integration for outgoing connections
Vinicius Costa Gomes [Mon, 19 Sep 2011 13:19:59 +0000 (10:19 -0300)]
Attrib server integration for outgoing connections

We need support for attaching a client connection to the attribute
server because the server that we are connected may want to do
something similar to a reverse service discovery, and we need to be
able to receive indications and notifications.

12 years agohciattach: fix serial speed setting for wl1271
Yegor Yefremov [Mon, 5 Sep 2011 13:42:12 +0000 (15:42 +0200)]
hciattach: fix serial speed setting for wl1271

override speed setting if firmware script issues serial settings command,
otherwise the value given in the firmware script will be overridden.

Example:

hciattach /dev/ttyO1 texas 115200

will fail, because /dev/ttyO1 will be opened with 115200 b/s, then
the firmware script will set the buadrate to 3000000 b/s, after UART init
hciattach.c will set the baudrate to 115200, so communication is broken.

The only correct way is to set both speeds:

hciattach -s 115200 /dev/ttyO1 texas 3000000

With this patch only initial speed must be specified. The former semantic
will be preserved in case the firmware script doesn't provide serial
settings action.

Tested with wl1271 and firmware TIInit_7.2.31.bts

12 years agoFix reference count issue in incoming connections
Frédéric Dalleau [Tue, 6 Sep 2011 13:55:52 +0000 (15:55 +0200)]
Fix reference count issue in incoming connections

In case of incoming RFCOMM connection, manager calls
gateway_connect_rfcomm which already take reference to GIOChannel, hence
no need to take another one.

12 years agoSet state to "connecting" on connection requested
Frédéric Dalleau [Tue, 6 Sep 2011 13:55:51 +0000 (15:55 +0200)]
Set state to "connecting" on connection requested

Make sure that state changes to disconnected on errors (authorization
refused, disconnect, sdp) This change will become necessary when
integrating the Audio interface which rely on state change to confirm
that connection has started successfully.

12 years agoFix state to "playing" on SCO establishment
Frédéric Dalleau [Tue, 6 Sep 2011 13:55:50 +0000 (15:55 +0200)]
Fix state to "playing" on SCO establishment

12 years agoFix asynchronously run request stream cb
Frédéric Dalleau [Tue, 6 Sep 2011 13:55:49 +0000 (15:55 +0200)]
Fix asynchronously run request stream cb

Cancel pending callback if stream is canceled Asynchronously run
gateway_config_stream cb Remove occurences of sco_start_cb

12 years agoFix disconnect SCO at same time than RFCOMM
Frédéric Dalleau [Tue, 6 Sep 2011 13:55:48 +0000 (15:55 +0200)]
Fix disconnect SCO at same time than RFCOMM

If RFCOMM disconnects, SCO should be disconnected too.

12 years agoFix freeing watches list in maemo6 telephony
Dmitriy Paliy [Wed, 21 Sep 2011 12:49:52 +0000 (15:49 +0300)]
Fix freeing watches list in maemo6 telephony

This fixes regression introduced in 83064481481d23523e5cdd04.
List watches has to be freed instead of list pending.

12 years agoAdd Phone Alert Server skeleton plugin
Bruna Moreira [Wed, 21 Sep 2011 12:46:10 +0000 (08:46 -0400)]
Add Phone Alert Server skeleton plugin

12 years agoAdd GATT Time Server skeleton plugin
Anderson Lizardo [Wed, 21 Sep 2011 12:46:09 +0000 (08:46 -0400)]
Add GATT Time Server skeleton plugin

12 years agoFix characteristic property on GATT example plugin
Anderson Lizardo [Wed, 21 Sep 2011 02:57:05 +0000 (22:57 -0400)]
Fix characteristic property on GATT example plugin

Any GATT characteristics which have a Client Characteristic
Configuration must have "Notify" property set.

12 years agoRefactor value assignments of bt_uuid_t variables
Anderson Lizardo [Wed, 21 Sep 2011 02:49:11 +0000 (22:49 -0400)]
Refactor value assignments of bt_uuid_t variables

Prior to this commit, the assignments were made with memcpy(). This can
be unsafe and less readable, therefore it was replaced with code like:

<dst> = *src;

This also allows more compiler safety checks.

12 years agoFix memory allocation of struct attribute
Anderson Lizardo [Wed, 21 Sep 2011 02:49:10 +0000 (22:49 -0400)]
Fix memory allocation of struct attribute

On commit 6a6da5de107e192f62ce2ecdde96eae985181df0 the struct
attribute "data[0]" member was replaced with a dynamically allocated
"data" pointer. This commit fixes remaining places where the old
allocation scheme was still assumed.

12 years agoRemove empty line before declaration
Anderson Lizardo [Wed, 21 Sep 2011 02:49:09 +0000 (22:49 -0400)]
Remove empty line before declaration

12 years agoFix remove emitting Paired=false when deleting device
Dmitriy Paliy [Tue, 20 Sep 2011 19:09:50 +0000 (22:09 +0300)]
Fix remove emitting Paired=false when deleting device

When adapter is requested to remove device, device's property
Paired=false is emitted after the adapter notifies clients that
list Devices is empty. Some clients get confused.

Emitting property was introduced in clean-up patch
c92a4af85f480c16f3ff017783c821304c899ce5. Since such notification
does not have practical meaning, it is better to remove it.

12 years agoUse medium security level when reconnecting
Claudio Takahasi [Tue, 20 Sep 2011 14:18:49 +0000 (11:18 -0300)]
Use medium security level when reconnecting

For GATT based profiles encryption is mandatory. Proximity Monitor
shall support LE Security Mode 1 and Security Level 2. Over basic rate,
switch the security level to medium for testing purpose only.

12 years agoFix invalid free when stopping adapter
Claudio Takahasi [Tue, 20 Sep 2011 14:11:20 +0000 (11:11 -0300)]
Fix invalid free when stopping adapter

This patch fix an "invalid free" error when the adapter is powered off
with an active discovery session. Error happens because session_remove
function removes the elements from the list also. Partial valgrind log:
Address 0x6012a00 is 0 bytes inside a block of size 16 free'd
  at 0x4C27DCC: free (vg_replace_malloc.c:366)
  by 0x4E927AC: g_slist_remove (in
  by 0x19F788: session_remove (adapter.c:689)
  by 0x19F82A: session_free (adapter.c:708)
  by 0x4E92CD6: g_slist_foreach (in
  by 0x4E92CFA: g_slist_free_full (in
  by 0x1A3ADD: btd_adapter_stop (adapter.c:2491)

12 years agoheadset: Fix missing check for non-existent pending message
Johan Hedberg [Wed, 21 Sep 2011 08:27:04 +0000 (17:27 +0900)]
headset: Fix missing check for non-existent pending message

12 years agoRemove redundant empty line
Johan Hedberg [Wed, 21 Sep 2011 08:04:02 +0000 (17:04 +0900)]
Remove redundant empty line

12 years agoAVDTP: Fix state if authorization fails
Johan Hedberg [Wed, 21 Sep 2011 02:03:11 +0000 (11:03 +0900)]
AVDTP: Fix state if authorization fails

12 years agoFix agent fall-back mechanism
Johan Hedberg [Tue, 20 Sep 2011 15:21:16 +0000 (00:21 +0900)]
Fix agent fall-back mechanism

We can't change the agent for a request internally within agent.c since
externally code may depend on a specific agent being used so that
agent_cancel work properly. This patch exports the fall-back behavior
from agent.c into device.c.

12 years agoAVDTP: Refactor audio_device_cancel_authorization usage
Johan Hedberg [Tue, 20 Sep 2011 07:00:35 +0000 (16:00 +0900)]
AVDTP: Refactor audio_device_cancel_authorization usage

12 years agobuild: Use private copy of Bluetooth library for audio support
Marcel Holtmann [Sun, 18 Sep 2011 20:28:11 +0000 (22:28 +0200)]
build: Use private copy of Bluetooth library for audio support

12 years agoFix crash when update service record with an invalid XML
Syam Sidhardhan [Sun, 18 Sep 2011 09:29:15 +0000 (14:59 +0530)]
Fix crash when update service record with an invalid XML

If we pass an invalid xml to sdp_xml_parse_record(), then it returns
NULL. Further we are passing the this NULL pointer to the
sdp_record_free(), which leads to invalid memory access.

12 years agoAdd valid range descriptor uuid
Santiago Carot-Nemesio [Wed, 24 Aug 2011 08:37:45 +0000 (10:37 +0200)]
Add valid range descriptor uuid

12 years agoFix magic numbers for local/remote name length
Claudio Takahasi [Thu, 15 Sep 2011 19:32:41 +0000 (16:32 -0300)]
Fix magic numbers for local/remote name length

12 years agoRemove unneeded headers included in storage.c
Claudio Takahasi [Thu, 15 Sep 2011 19:32:31 +0000 (16:32 -0300)]
Remove unneeded headers included in storage.c

12 years agoRemove not referenced function in storage.c
Claudio Takahasi [Thu, 15 Sep 2011 19:32:21 +0000 (16:32 -0300)]
Remove not referenced function in storage.c

12 years agoRemove create_file calls for read operations
Claudio Takahasi [Thu, 15 Sep 2011 19:32:11 +0000 (16:32 -0300)]
Remove create_file calls for read operations

This patch fixes some read only functions in storage.c removing
create_file function calls.

12 years agoRemove storing device type
Claudio Takahasi [Thu, 15 Sep 2011 19:31:43 +0000 (16:31 -0300)]
Remove storing device type

Device type doesn't need to be stored since GATT services information
exported through basic rate can be retrieved from the SDP records.
Device "type" is also a wrong expression to represent the operation
mode: over which transport GATT service is being exported.

12 years agoFix allocation of attribute values
Vinicius Costa Gomes [Thu, 15 Sep 2011 18:58:51 +0000 (14:58 -0400)]
Fix allocation of attribute values

Now that pointers to attribute are passed as reference to functions
we cannot have they change during run time, what g_try_realloc()
could do.

12 years agoavrcp: get/set three-byte company-id
David Stockwell [Thu, 15 Sep 2011 04:21:37 +0000 (01:21 -0300)]
avrcp: get/set three-byte company-id

12 years agoavrcp: fix handling of metadata item 0x7
David Stockwell [Thu, 15 Sep 2011 04:21:36 +0000 (01:21 -0300)]
avrcp: fix handling of metadata item 0x7

Metadata field number 0x7 should be the total playing time of the track
(TrackDuration) in msec, not current position within track.

12 years agoavrcp: use LAST element on media_info_id enum
David Stockwell [Thu, 15 Sep 2011 04:21:35 +0000 (01:21 -0300)]
avrcp: use LAST element on media_info_id enum

12 years agoavrcp: fix overwrite of number of attributes
Lucas De Marchi [Thu, 15 Sep 2011 04:21:34 +0000 (01:21 -0300)]
avrcp: fix overwrite of number of attributes

The response of GetCurrentPlayerApplicationSettingValue expects the
first operand to be the number of attributes in response. Since we start
with len=0, we were overwriting this number with the value of the first
attribute.

Also use g_memdup instead of g_malloc + memcpy.

12 years agoavrcp: fix missing error code
Lucas De Marchi [Thu, 15 Sep 2011 04:21:33 +0000 (01:21 -0300)]
avrcp: fix missing error code

12 years agoAVRCP: change debug to better reflect packets protocol/profile
Luiz Augusto von Dentz [Wed, 14 Sep 2011 09:16:50 +0000 (12:16 +0300)]
AVRCP: change debug to better reflect packets protocol/profile

12 years agoserial: add Serial.ConnectFD()
Gustavo F. Padovan [Tue, 13 Sep 2011 18:16:05 +0000 (15:16 -0300)]
serial: add Serial.ConnectFD()

It's similar to Serial.Connect() but returns the actual RFCOMM file
descriptor instead of creating a device in /dev

12 years agoserial: fix DBus message reply
Gustavo F. Padovan [Tue, 13 Sep 2011 18:16:04 +0000 (15:16 -0300)]
serial: fix DBus message reply

If reply is NULL we have a crash.

12 years agobuild: Link all tools with local copy of Bluetooth library
Marcel Holtmann [Tue, 13 Sep 2011 14:48:58 +0000 (16:48 +0200)]
build: Link all tools with local copy of Bluetooth library

12 years agoAVRCP: move handling of vendor dependent PDU from control.c to avrcp.c
Luiz Augusto von Dentz [Mon, 12 Sep 2011 16:34:01 +0000 (19:34 +0300)]
AVRCP: move handling of vendor dependent PDU from control.c to avrcp.c

This helps to isolate AVRCP PDU handling and MediaPlayer interface.

12 years agoAVRCP: split AVCTP specific code from control.c
Luiz Augusto von Dentz [Mon, 12 Sep 2011 16:34:00 +0000 (19:34 +0300)]
AVRCP: split AVCTP specific code from control.c

The code is moved to avctp.c to simplify control.c

12 years agoAVRCP: rename avrcp_spec_avc_pdu to avrcp_header
Luiz Augusto von Dentz [Mon, 12 Sep 2011 16:33:59 +0000 (19:33 +0300)]
AVRCP: rename avrcp_spec_avc_pdu to avrcp_header

Since old avrcp_header got renamed to avc_header now we can use
avrcp_header for AVRCP PDUs.

12 years agoAVRCP: rename avrcp_header to avc_header
Luiz Augusto von Dentz [Mon, 12 Sep 2011 16:33:58 +0000 (19:33 +0300)]
AVRCP: rename avrcp_header to avc_header

AVCTP carries AV/C packets/PDUs not AVRCP as avrcp_header suggests.

12 years agoAVRCP: use a vtable to simplify PDU parsing/handling
Luiz Augusto von Dentz [Mon, 12 Sep 2011 16:33:57 +0000 (19:33 +0300)]
AVRCP: use a vtable to simplify PDU parsing/handling

This simplify a bit the handling by introducing common checks before
calling the handler callback, it is also much easier to add/remove
new PDUs in this way.

12 years agoAdd test for serial proxy and serial proxy manager
Bruno Dilly [Tue, 30 Aug 2011 13:04:23 +0000 (10:04 -0300)]
Add test for serial proxy and serial proxy manager

12 years agoReturn EALREADY if the adapter is already up/down
Claudio Takahasi [Mon, 12 Sep 2011 12:06:32 +0000 (09:06 -0300)]
Return EALREADY if the adapter is already up/down

12 years agoSerialize powering up/down in maemo6 plugin
Claudio Takahasi [Mon, 12 Sep 2011 12:06:31 +0000 (09:06 -0300)]
Serialize powering up/down in maemo6 plugin

This patch fixes wrong adapter state when using Management interface.
When bluetoothd starts, the adapter should be switched to the state
informed by Maemo6 MCE. In the current implementation, Maemo6 plugin
sends set powered command when the adapter is still powering up, the
last command sent fails(kernel returns EALREADY).

12 years agoFix adapter->up declaration
Claudio Takahasi [Mon, 12 Sep 2011 12:06:30 +0000 (09:06 -0300)]
Fix adapter->up declaration

Minor code convention fix. This patch fix "up" variable declaration in
adapter structure. Convert "up" to gboolean making it compliant with
its usage.

12 years agoFix minor coding-style issue
Johan Hedberg [Mon, 12 Sep 2011 08:02:21 +0000 (11:02 +0300)]
Fix minor coding-style issue

12 years agoPrevents sending Write Local Name when not needed
Claudio Takahasi [Fri, 2 Sep 2011 16:45:09 +0000 (13:45 -0300)]
Prevents sending Write Local Name when not needed

Fix unneeded Write Local Name command being sent when bluetoothd starts
or switching the adapter on. Using an array of chars it is not possible
to distinguish if there is a valid value to be set since empty is a
valid value.

12 years agoFix loop when setting adapter name
Claudio Takahasi [Fri, 2 Sep 2011 16:45:08 +0000 (13:45 -0300)]
Fix loop when setting adapter name

When management interface is enabled, name changed event comes when the
adapter is initialized as consequence of the Read Local Name. Use the
same function to set and handle event causes looping when bluetoothd
starts if the name stored in the controller is different from the name
provided by the adapter name plugin.

Splitting the adapter_update_local_name also fix the PropertyChanged
(for Name) signal being sent before AdapterAdded.

12 years agoRemove not referenced function
Claudio Takahasi [Wed, 24 Aug 2011 19:09:50 +0000 (16:09 -0300)]
Remove not referenced function

12 years agoRemove leftover function declaration
Claudio Takahasi [Wed, 24 Aug 2011 19:09:49 +0000 (16:09 -0300)]
Remove leftover function declaration

12 years agoRemove unneeded header include
Claudio Takahasi [Wed, 24 Aug 2011 19:09:48 +0000 (16:09 -0300)]
Remove unneeded header include

12 years agoRemove forward declaration
Claudio Takahasi [Wed, 24 Aug 2011 19:09:47 +0000 (16:09 -0300)]
Remove forward declaration