Commit Graph

7972 Commits

Author SHA1 Message Date
Johan Hedberg
27c58425af Change power_on & power_off adapter_ops callbacks to set_powered
The current idea is to have a single set_powered management command
which for the switching on case would leave the controller in a
non-connectable, non-pairable and non-discoverable state.
2010-12-23 14:38:52 +02:00
Vinicius Costa Gomes
8250668371 Add a "services" command to test-device
This command adds a way to retrieve the Services property that each
device has.
2010-12-23 10:32:42 +02:00
Vinicius Costa Gomes
adbfb31ab2 Add GetProperties method the Service Interface
For now this interface just includes the path that each characteristic
is registered at.
2010-12-23 10:32:25 +02:00
Vinicius Costa Gomes
87b140440a Add support for adding services to the Services property
We need to fill the devices property as each service path gets
registered in the DBus system bus.
2010-12-23 10:32:11 +02:00
Vinicius Costa Gomes
b33922d99e Remove GetCharacteristics DBus method
This method was not documented in the API, and it has the same
functionality as getting the Characteristics property.
2010-12-23 10:31:42 +02:00
Vinicius Costa Gomes
a1b0fda9a0 Add a Discover method to the GATT Client
This methods allows users to actively start the discovery of characteristics
presents in a service.
2010-12-23 10:31:05 +02:00
Vinicius Costa Gomes
463dbe1bea Add support for making LE connections to GATT client
Now GATT client should be able to make LE connections. The information
used to determine if we should make a LE connection is the psm stored
in the gatt_service structure.
2010-12-23 10:30:45 +02:00
Vinicius Costa Gomes
60987f4afa Clean up the primary service D-Bus registration
Now, that much of this funcionality was moved to the core, we can go
straight to the registration of D-Bus interfaces.
2010-12-23 10:30:27 +02:00
Vinicius Costa Gomes
5418e09a27 Remove duplicated code for discovering GATT services
Most of this functionality was moved to src/device.c. Since that move
this code doesn't work. Some ugly hack were added to avoid breaking
the build.
2010-12-23 10:29:22 +02:00
Vinicius Costa Gomes
ed2fd82805 Add the btd_ prefix to device_add_service
This is needed to keep consistency, as device_add_service would be used
from outside the core bluetoothd.
2010-12-23 10:28:48 +02:00
Vinicius Costa Gomes
5ae3733f9c Remove GATT information when the device is removed
This adds a way to remove the information about the device type and its
primary services when the device is going to be removed from the permanent
storage.
2010-12-23 10:27:58 +02:00
Vinicius Costa Gomes
83d8b6546c Add a way to retrieve ATT primary services
As the primary services were discovered by the core bluetoothd, we need
a way to export that information.

The service discovery uses the same primary list as the device, there's no
need to free that list when the discovery finishes. That list will be removed
when the device is free'd.
2010-12-23 10:24:36 +02:00
Vinicius Costa Gomes
ef86f0c305 Add support for creating devices from stored primary services
From what we can retrieve from storage we are able to create the devices
and probe the device drivers.
2010-12-23 10:23:22 +02:00
Vinicius Costa Gomes
fba8f0e7d1 Add support for creating devices from stored types
This adds a way to restore devices from their types.
2010-12-23 00:45:06 +02:00
Vinicius Costa Gomes
27b16a9822 Add support for storing the device type
When the service discovery (SDP or GATT) is finished, write the device
type so it can be retrieved from storage when needed.
2010-12-23 00:44:40 +02:00
Luiz Augusto von Dentz
98ebaa9932 sbc: detect when bitpool has changed
A2DP spec allow bitpool changes midstream which is why sbc configuration
has a range of values for bitpool that the encoder can use and decoder
must support.

Bitpool changes do not affect the state of encoder/decoder so they don't
need to be reinitialize when this happens, so the impact is fairly small,
what it does change is the frame length so encoders may change the
bitpool to use the link more efficiently.
2010-12-23 00:43:22 +02:00
Bruna Moreira
051ad18433 Change LE scan interval and window to recommended values
Replace default scan interval and scan window values with recommended
ones for general discovery procedure, according to the Core
specification.
2010-12-23 00:42:25 +02:00
Sheldon Demario
d3cb258b9b Move primary service storage to device.c
Discover All Primary Services has beed moved to device.c in order
to follow a similar approach of BR/EDR service records.
2010-12-23 00:34:04 +02:00
Vinicius Costa Gomes
50fb53c4a7 Add a way to store the remote device type
Because we need to know the device type (LE, Basic Rate or Dual Mode)
to be able to fully restore the device from storage, we have to store
and load this information to permanent storage.

Note: due to "device_type_t" usage in storage.h, some header includes
needed to be reordered in files which include storage.h.
2010-12-22 13:57:33 +02:00
Vinicius Costa Gomes
5f44369b91 Fix memory leaks in the attrib-server 2010-12-22 13:50:40 +02:00
Vinicius Costa Gomes
5ffd0e6374 Fix attrib plugin deregistration
As the comparison method used for find what to de-register was
wrong, it was causing the btd_device reference that the attrib
plugin was keeping never to be dropped.
2010-12-22 13:50:17 +02:00
Luiz Augusto von Dentz
ba801b05d9 Configure HFP/HSP endpoints if headset interface is already connected
HFP/HSP can be connected when registering an endpoint which is different
than on a2dp where the sep cannot be configured already since it wasn't
available before.
2010-12-22 00:18:35 +02:00
Johan Hedberg
a61d0e8e73 Remove unneeded variables from link_key_request() 2010-12-21 15:01:04 +02:00
Claudio Takahasi
d107efdb09 Remove unneeded variable 2010-12-21 14:46:39 +02:00
Johan Hedberg
dd109a698c Add disconnect command to test-device 2010-12-21 11:23:30 +02:00
Michal Labedzki
ed2c65ad9d Coding style fixes for lib and tools 2010-12-21 10:50:59 +02:00
Sheldon Demario
aa67244a64 Remove bt_discover_services function from glib-helper
There is no reference in the code for this function. SDP discovery in
the bluetoothd core and plugins are now using bt_search_service only.
2010-12-21 01:09:44 +02:00
Claudio Takahasi
88386d8ee8 Fix missing reply when create device is cancelled
When CancelDeviceCreation is called or when the device is removed for
any reason, the reply for the pending CreateDevice is not sent.
2010-12-21 01:00:13 +02:00
Bruna Moreira
6827467e46 Remove le_advertising_info struct from adapter.c 2010-12-21 00:41:39 +02:00
Bruna Moreira
2634978c82 Move EIR flags definitions to adapter.c 2010-12-21 00:41:39 +02:00
Johan Hedberg
3829cf140b Remove unused variables from link_key_request() 2010-12-20 21:16:15 +02:00
Johan Hedberg
dccef4954d Move debug key handling into adapter_ops
There's no need for the core daemon to have special handling for debug
keys anymore as long as it tells adapter_ops if they are enabled or not
(new parameter added to adapter_ops->load_keys).
2010-12-20 19:38:43 +02:00
Johan Hedberg
27a311476a Add initial code for mgmtops adapter power control 2010-12-20 19:15:07 +02:00
Michal Labedzki
57aa201c25 Fix tools UI to avoid program launch mistakes.
hciconfig: warrning user on unknown commands
hcitool: return error on unknown command in hcitool
fix length size in comparision to avoid ambiguity commands
check if command number of arguments is correct
2010-12-20 17:39:06 +02:00
Anderson Lizardo
cb53bff26b Fix memory leak of unused EIR name
There is a code path in btd_event_device_found() where the EIR name is
not used. This requires freeing eir_data.name to avoid a leak.
2010-12-20 17:34:57 +02:00
Johan Hedberg
700d2ae37c Fix compilation error in read_simple_pairing_mode_complete
This slipped in by mistake when doing the find -> find_by_id change.
2010-12-20 13:45:14 +02:00
Johan Hedberg
f674830aba Use find_adapter_by_id instead of find_adapter when it makes sense
In most cases it's more convenient to use the adapter index when looking
up the adapter object since the index is always available in the
adapter_ops callbacks.
2010-12-20 12:42:08 +02:00
Johan Hedberg
65edd4d539 Get rid of unnecessary manager_stop_adapter function 2010-12-20 12:36:20 +02:00
Johan Hedberg
5a50e2192e Simplify disconnect_addr helper function 2010-12-19 20:31:11 +02:00
Johan Hedberg
6b9921107e Get rid of unneeded btd_adapter_get_conn_handle function 2010-12-19 16:50:27 +02:00
Johan Hedberg
58b68d33c5 Fix handle endianess issues with btd_adapter_read_clock 2010-12-19 16:34:44 +02:00
Johan Hedberg
fc35899bb8 Clean up btd_request_authorization code 2010-12-19 16:20:10 +02:00
Johan Hedberg
8e17ca3a78 Remove unnecessary btd_adapter_get_remote_version function 2010-12-19 15:35:07 +02:00
Johan Hedberg
b98312395e Rename btd_event_inquiry_result to btd_event_device_found 2010-12-19 15:16:29 +02:00
Johan Hedberg
53a4fa31e7 Move PIN code storage access to core daemon 2010-12-19 15:04:32 +02:00
Johan Hedberg
49a520fbda Move storage dependencies from hciops to core daemon 2010-12-19 14:40:54 +02:00
Anderson Lizardo
cdb793f181 Move local name parsing to parse_eir_data() 2010-12-19 14:26:01 +02:00
Anderson Lizardo
88c6a31d1e Move AD flags parsing to parse_eir_data() 2010-12-19 14:25:43 +02:00
Anderson Lizardo
a39ada57c8 Modify get_eir_uuids() to parse other EIR data
Currently, EIR parsing (name, UUIDs, flags etc.) is done in various
places. This leads to duplicated checks and does not support parsing
multiple AD/EIR structures on a single transfer.

These changes modify get_eir_uuids() to parse other EIR data types and
avoid passing raw EIR data to higher layers.

To accomplish this, get_eir_uuids() was renamed to parse_eir_data(), and
a new (internal) "struct eir_data" was introduced to store the parsed
data.

This first commit only handles the services UUIDs, following patches
will move other EIR parsing to it until everything is done inside
parse_eir_data().
2010-12-19 14:23:55 +02:00
Anderson Lizardo
accbcf5a7f Move get_eir_uuids() from src/adapter.c to src/event.c
Moving get_eir_uuids() to src/event.c removes the need to pass the raw
EIR data to higher layers. Now it is not necessary to pass the original
GSList of service UUIDs, because the list is concatenated (with
verification of duplicate entries) on adapter_update_device_from_info()
(for LE) and adapter_update_found_devices() (for BR/EDR).
2010-12-19 14:23:26 +02:00