Commit Graph

9082 Commits

Author SHA1 Message Date
Johan Hedberg
02bc7a19cb Simplify property variable usage in btd_adapter_stop 2011-10-17 17:43:01 +03:00
Johan Hedberg
38eaee6b36 Fix updating Adapter.Discovering property when powering off 2011-10-17 17:38:56 +03:00
Chan-yeol Park
c18d64b02b Fix input pending connect handling
iconn->pending_connect needs to be freed after sending the error reply
2011-10-17 16:33:47 +03:00
Luiz Augusto von Dentz
b110c73356 hciops: fix adapter initialization when commands are missed
Sometimes after e.g, suspend we miss some initialization commands from
the kernel, even though we had a workaround for this it doesn't really
work as expected since the adapter must be up in order to resend.

To fix this problem the resend logic is moved after DEVUP.
2011-10-17 12:53:59 +03:00
Johan Hedberg
d6ca701986 Simplify process_thermometer_char() logic 2011-10-17 11:25:25 +03:00
Santiago Carot-Nemesio
e3eb563d06 Fix thermometer Intermediate property changes
Set Intermediate property if intermediate temperature characteristic is
supported
2011-10-17 11:21:15 +03:00
Santiago Carot-Nemesio
4cd8ecb074 Read measurement interval characteristic 2011-10-17 11:08:39 +03:00
Santiago Carot-Nemesio
c9fc590787 Read temperature type characteristic 2011-10-17 11:08:37 +03:00
Santiago Carot-Nemesio
2219cc884c Get all characteristics in thermometer service 2011-10-17 11:08:35 +03:00
Santiago Carot-Nemesio
62d4daf26a Add handler function to manage GATT indications 2011-10-17 11:08:33 +03:00
Santiago Carot-Nemesio
2d2e3a412c Add functions to manage attio callbacks 2011-10-17 11:08:30 +03:00
Santiago Carot-Nemesio
3e7ecc4309 Unregister Health Thermometer Interface 2011-10-17 11:08:28 +03:00
Santiago Carot-Nemesio
f324306643 Register Health Thermometer Interface 2011-10-17 11:08:24 +03:00
Santiago Carot-Nemesio
d9ef9b74a9 Get thermometer service range to load the driver. 2011-10-17 11:08:22 +03:00
Johan Hedberg
6ecbffae1d hcitool: Fix EIR parsing
There were missing buffer size checks and wrong assumptions about the
EIR data length (core spec 4.0 defines it to be max 31 bytes, so the
name can be max 29 bytes).
2011-10-14 14:23:05 +03:00
Johan Hedberg
9122bd7ec7 Fix leaks and buffer overflows in EIR parsing
By calling g_utf8_validate and allocating eir->name inside the parsing
loop the code was exposing itself to buffer overflows and memory leaks.
This is because the check for incorrect length fields is only done after
exiting the loop (if (len > HCI_MAX_EIR_LENGTH)). By only setting a
pointer to the name and doing the processing after checking the length
validity both issues can be avoided.
2011-10-14 11:15:14 +03:00
Vinicius Costa Gomes
402398c7dc Add support for parsing the remote name during LE Scan 2011-10-14 10:48:07 +03:00
Lucas De Marchi
239a0f68bb Make title always available in metadata 2011-10-13 16:09:52 +03:00
Lucas De Marchi
cd25bc2b76 Don't overwrite metadata when changing track
If we use the same hash table to set the new metadata, we have 2
undesired behaviors:

1) New track may contain fields from previous track if it didn't set all
the fields
2) If we fail on parsing the signal, we will still change some of the
fields
2011-10-13 16:08:29 +03:00
Dmitriy Paliy
9a4a6fad12 Fix +CLCC in maemo6 during CSD_CALL_STATUS_COMING
This fixes the same issue as in 8a6119ea1c685fc61419ee444a5967596f524c1c
but for CSD_CALL_STATUS_COMING. Call status change sequence in csd is
IDLE to COMING, COMING to PROCEEDING, and PROCEEDING to WAITING.

Returned 'state of the call' value after CSD_CALL_STATUS_COMING, as well
as after CSD_CALL_STATUS_PROCEEDING, in +CLCC shall be 5 (waiting, MT
call) instead of 4 (incoming, MT call) in maemo6 telephony driver for the
second incoming call.
2011-10-13 13:45:39 +03:00
Dmitriy Paliy
d0ed45425d Fix crash on power off in maemo6 after sending DTMF
This fixes regression introduced in
b48e610314. Crash happens when powering
off adapter after sending DTMF tone.
2011-10-13 13:33:46 +03:00
Lucas De Marchi
3ab3eab5b9 Improve test/simple-player to allow user interaction
Allow user to trigger TrackChanged and PropertyChanged. Calls made by
remote side (coming from D-Bus) are printed to stderr while the ones to
interact with user go to stdout.
2011-10-13 13:11:10 +03:00
Lucas De Marchi
a2a2db8167 Refactor to share code
Refactor code when we are 'listing selected attributes' to share code
with 'listing all attributes'. This way we always keep the list of
attributes in a GList, and call player_get_media_attribute() in only one
place.
2011-10-13 13:10:45 +03:00
Lucas De Marchi
c8265ec286 AVRCP: Only return available metadata attributes
When remote side requests all available metadata (i.e. it gives number
attributes equals to 0) do not return zero-length strings for
unavailable items. The only exception is title, that must be always present.
2011-10-13 13:10:13 +03:00
Lucas De Marchi
7cddeb379d AVRCP: Check if len matches number of IDs
If number of attributes remote side provided is larger than the length
we read, we would read garbage from stack memory.
2011-10-13 13:09:25 +03:00
Lucas De Marchi
28b3057757 AVRCP: Return error for invalid metadata IDs 2011-10-13 13:08:58 +03:00
Lucas De Marchi
c684389188 Add callback to list available metadata IDs 2011-10-13 13:08:46 +03:00
Lucas De Marchi
c0cc10498d AVRCP: Do not list values for unsupported attributes 2011-10-13 13:06:39 +03:00
Lucas De Marchi
2932dbeeb3 Move debug messages to their correspondent getters 2011-10-13 13:05:54 +03:00
Lucas De Marchi
aac1ff80c9 Fix typo on doc 2011-10-13 10:38:39 +03:00
Lucas De Marchi
6eba2448be Add mpris-player to .gitignore 2011-10-13 10:38:32 +03:00
Johan Hedberg
3dab59311e Add Szymon Janc to AUTHORS 2011-10-12 16:53:58 +03:00
Johan Hedberg
cd74b3498b Add Lucas De Marchi to AUTHORS 2011-10-12 16:52:29 +03:00
Claudio Takahasi
40a176e792 Remove leftover code of primary service storage
Primary services related to a given address is already being removed
in delete_device_service() function.
2011-10-12 10:59:46 +03:00
Claudio Takahasi
bea3b79313 Remove leftover code of device type storage 2011-10-12 10:59:42 +03:00
Luiz Augusto von Dentz
32713348da Update control documentation to reflect the implementation
Many of the methods and signal don't make much sense since we now have
a dedicated interfaces that are Media and MediaPlayer.
2011-10-12 10:55:05 +03:00
Dmitriy Paliy
c2a74289ef Fix call status in +CLCC for maemo6 telephony
If list current calls is requested when there is second incoming call
and csd call status is CSD_CALL_STATUS_PROCEEDING, then returned 'state
of the call' value in +CLCC is 4 (incoming, MT call), which is incorrect.
Indication than proceeds from incoming to waiting state.

This patch sets the corresponding value to 5 (waiting, MT call) in
maemo6 telephony driver for the second call.
2011-10-12 10:53:08 +03:00
Johan Hedberg
e34836262b Fix compilation error on 32-bit systems
This fixes the following compilation error with GLib on 32-bit sytems:

audio/media.c: In function 'get_setting':
audio/media.c:1109:44: error: cast to pointer from integer of different size [-Werror=int-to-pointer-cast]
audio/media.c: In function 'set_setting':
audio/media.c:1132:41: error: cast to pointer from integer of different size [-Werror=int-to-pointer-cast]
2011-10-12 00:28:51 +03:00
Luiz Augusto von Dentz
291e838c93 Add mpris-player to test
It gather information from players implementing mpris spec and convert
to org.bluez.MediaPlayer spec.
2011-10-10 12:26:07 +03:00
Vinicius Costa Gomes
6c85d28c8e Add support for cancelling a LE Scan with Control-C 2011-10-07 19:55:42 +03:00
Vinicius Costa Gomes
253f8a7c68 Fix using the attribute struct for encoding ATT pdus
The enconding and decoding of ATT pdus should be kept as much
free of dependences from other parts of the code as possible, so
it can be used in many contexts.

In this case, for encoding and decoding notifications and indications
we did have to pass an instance of an attribute instead of direct
values.
2011-10-07 19:52:32 +03:00
Luiz Augusto von Dentz
911f1b1be0 Fix crash while registering player
Crash is caused by not removed freed player from the list:

Invalid read of size 8
   at 0x13E7B5: media_adapter_find_player (media.c:861)
   by 0x13FEBC: register_player (media.c:1561)
   by 0x120DFE: process_message (object.c:224)
   by 0x4F6E9A0: ??? (in /lib64/libdbus-1.so.3.5.6)
   by 0x4F6092F: dbus_connection_dispatch (in /lib64/libdbus-1.so.3.5.6)
   by 0x11F787: message_dispatch (mainloop.c:80)
   by 0x4C762CA: ??? (in /lib64/libglib-2.0.so.0.3000.0)
   by 0x4C74ADC: g_main_context_dispatch (in /lib64/libglib-2.0.so.0.3000.0)
   by 0x4C752D7: ??? (in /lib64/libglib-2.0.so.0.3000.0)
   by 0x4C75824: g_main_loop_run (in /lib64/libglib-2.0.so.0.3000.0)
   by 0x11EE4B: main (main.c:485)
 Address 0x642ef30 is 16 bytes inside a block of size 80 free'd
   at 0x4A0662E: free (vg_replace_malloc.c:366)
   by 0x4C7B7F2: g_free (in /lib64/libglib-2.0.so.0.3000.0)
   by 0x12D292: player_destroy (avrcp.c:1099)
   by 0x120C38: service_filter (watch.c:477)
   by 0x120950: message_filter (watch.c:527)
   by 0x4F608E5: dbus_connection_dispatch (in /lib64/libdbus-1.so.3.5.6)
   by 0x11F787: message_dispatch (mainloop.c:80)
   by 0x4C762CA: ??? (in /lib64/libglib-2.0.so.0.3000.0)
   by 0x4C74ADC: g_main_context_dispatch (in /lib64/libglib-2.0.so.0.3000.0)
   by 0x4C752D7: ??? (in /lib64/libglib-2.0.so.0.3000.0)
   by 0x4C75824: g_main_loop_run (in /lib64/libglib-2.0.so.0.3000.0)
   by 0x11EE4B: main (main.c:485)
2011-10-06 18:46:54 +03:00
Luiz Augusto von Dentz
9cf1a84ef7 Fix not being able to unregister player via UnregisterPlayer 2011-10-06 18:46:49 +03:00
Lucas De Marchi
c7f32491a8 AVRCP: do not allow CT to set a property not supported
If player never set a property, it means it doesn't support it. Doesn't
allow the remote side to set it and send a REJECTED response.
2011-10-06 15:36:36 +03:00
Lucas De Marchi
b6379821a6 AVRCP: fix loop over number of application settings 2011-10-06 15:35:35 +03:00
Luiz Augusto von Dentz
53cc56358c Remove test-media-player 2011-10-06 11:13:43 +03:00
Luiz Augusto von Dentz
22ff222353 Remove MediaPlayer interface from control-api.txt 2011-10-06 11:13:38 +03:00
Luiz Augusto von Dentz
6e215f1f86 Add simple-player test script 2011-10-06 11:13:33 +03:00
Luiz Augusto von Dentz
14ae307458 AVRCP: move MediaPlayer to adapter object
This move the MediaPlayer registration to adapter object on Media
interface so we can track players properly.
2011-10-06 11:13:28 +03:00
Claudio Takahasi
e2746b6fcc Add automatic connect timeout config option
Add new option in main.conf allowing change the default automatic
connection timer. This value defines how many seconds re-connection
for bonded devices will be active when a platform/user event triggers
the automatic re-connections.
2011-10-05 18:02:02 +03:00