Commit Graph

391 Commits

Author SHA1 Message Date
Johan Hedberg
0573fc7cb1 mgmt: Add address type to mgmt_pair_device
This is important especially in the future when dual-mode devices can be
connected to over LE. It's also important if/when we decide to move the
advertisement cache into user-space.
2011-11-11 00:04:10 +02:00
Johan Hedberg
74b43ba833 mgmt: Add status parameter to disconnect response 2011-11-10 14:17:24 +02:00
Johan Hedberg
86c731b39b mgmtops: Update start_discovery parameters to latest spec 2011-11-10 10:51:03 +02:00
Johan Hedberg
4c63c025a5 mgmt: Update BR/EDR link key message naming to match new API 2011-11-07 20:09:03 +02:00
Johan Hedberg
7ee8ea022d mgmt: Add address type fields to messages that need them 2011-11-07 19:54:04 +02:00
Andre Guedes
d0ae998760 Add discovery cases to mgmt_cmd_complete() 2011-11-04 15:22:17 +02:00
Johan Hedberg
76bfabc7a3 mgmt: Update set_discoverable to match new API 2011-11-03 13:50:35 +02:00
Frédéric Danis
bb957be6a4 Add EIR length parameter to eir_parse()
LE uses shorter EIR (31 bytes) than HCI (240 bytes)
2011-10-21 13:35:01 +03:00
Johan Hedberg
9b98a6c764 Add glib-compat.h to deal with issues in old GLib versions 2011-10-18 10:57:06 +03:00
Johan Hedberg
549087a10b hciops: fix discov_state when powering off an adapter 2011-10-17 18:11:01 +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
Claudio Takahasi
0ddc54ca5f Set auto connect from maemo6 plugin
Inform the adapter that the system has been unlocked when the MCE
sends the tklock_mode_ind signal. This signal will trigger the
automatic re-connections for the devices selected by the profiles.
Profiles register ATTIO callbacks to indicate that ATT connection
is required.
2011-10-05 18:01:48 +03:00
Anderson Briglia
cd907d8c84 Add display lock watcher on maemo6 plugin
Implements display status signal watcher in maemo6 plugin.
2011-10-05 18:01:43 +03:00
Luiz Augusto von Dentz
42b90a434a Remove use of read_device_id in wiimote plugin
Make use of btd_device_get_vendor and btd_device_get_product intead.
2011-10-01 09:02:19 +03:00
Antti Julku
f8a44769ff 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.
2011-09-26 15:39:39 +03:00
Antti Julku
1dcd74358c Implement fast connectable mode for mgmt interface
Management interface implementation for fast connectable mode.
2011-09-26 15:39:36 +03:00
Vinicius Costa Gomes
6184bc5911 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.
2011-09-22 20:25:23 +09:00
Anderson Lizardo
c703241170 Fix characteristic property on GATT example plugin
Any GATT characteristics which have a Client Characteristic
Configuration must have "Notify" property set.
2011-09-22 20:01:40 +09:00
Syam Sidhardhan
472095161e 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.
2011-09-18 18:36:43 +09:00
Claudio Takahasi
11ddc90c92 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).
2011-09-12 15:17:22 +03:00
Claudio Takahasi
7aeeea795a 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.
2011-09-12 10:59:27 +03:00
Antti Julku
396607837a Add support for blacklisting events
Add support for mgmt interface events for device blocking/unblocking.
Kernel sends a mgmt event when a device has been blocked by another
management socket or with ioctl command (e.g. by hciconfig).

Parameter update_only is added to device_block/unblock functions in
device.c to avoid code copying. When update_only is true, blocking
command is not sent to kernel, but only device status is updated and
dbus signal is sent.
2011-09-01 16:02:10 +03:00
Pavel Raiskup
7af9f8687e formfactor: Add missing comma
Missing comma in static array chassis_map definition between
"Blade" and "Blade Enclosure" field.

Typing error fixed.
2011-08-29 13:45:41 +03:00
Pavel Raiskup
edb505b8c0 Off-by-one(two) error in form factor detection
Indexing of chassis_map array has to be done like that:
    chassis_map[chassis_type * 2 - 1]

because if not, everything is shifted by one. When (e.g.) chassis_type
is 0x04 result should be "Low Profile Desktop" =>  "desktop" (not a
"Pizza Box" => "server"). Lets see the 2.6.1 document on:

http://www.dmtf.org/standards/smbios
2011-08-29 13:44:33 +03:00
Claudio Takahasi
bf857b7a57 Read local extended features at the initialization
Local extended features bitmask may change when Write LE Host Supported
Command is sent by the kernel. This patch adds reading of the local
extended features in the initialization sending a HCI command, extend
the ioctl HCIGETDEVINFO is not suitable due possible inconsistency
between kernel and userspace.
2011-08-22 13:39:10 +03:00
Claudio Takahasi
d7e1f84d30 Remove EnableLE option from the user-space
Deprecated configure option after adding "enable_le" parameter in the
bluetooth module. Write LE Host Supported Command is now sent by the
kernel if "enable_le" is enabled and the controller supports LE.
2011-08-22 13:39:08 +03:00
Szymon Janc
5a0c179b9a Add external dummy plugin for testing 2011-08-14 14:08:29 -07:00
Łukasz Stelmach
0065cf3be9 Fix off-by-one error in form factor detection
The keywords we are looking for are at odd positions.
2011-07-29 13:12:28 +03:00
Luiz Augusto von Dentz
e2482a5ee3 Fix removing inotify watch whenever an adapter is removed
This sometimes cause bluetoothd to burn cpu when an adapter is removed
from the system.

Since the watch is not really bond to any adapter, in fact it is added on
plugin .init, its removal is now moved to plugin .exit.
2011-07-26 12:59:54 +03:00
David Herrmann
1106efd440 Add support for wiimote pairing
The Nintendo Wii Remote requires binary bluetooth addresses as PINs.
This is not possible via dbus agent API. So this adds a plugin that
registers a pin-callback and forces the right pin for every
authentication request of wiimotes.
2011-07-14 17:25:05 +03:00
Marcel Holtmann
3f553a30ad Allow building with GLib 2.16 for now 2011-07-04 11:09:55 +02:00
Luiz Augusto von Dentz
634f0a0436 Make use of g_slist_free_full on hciops plugin 2011-06-30 12:32:29 +03:00
Bastien Nocera
c98f635b44 Add adaptername plugin
Replacing the name setting code in src/adapter.c.

Moving the adapter naming allows us to use the /etc/machine-info [1]
pretty hostname, as implemented by hostnamed [2] in systemd.

If /etc/machine-info is not present, the adapter name stored
on disk in /var/lib/bluetooth will be used. If no adapter name
has been set yet, the default from the main.conf will be used.

We don't currently number the name of hci0 if a pretty name is
available, but we should instead number it if it happens not
to be the default adapter. As we cannot be told when the default
adapter changes, we'll behave this way for now.

Note that when an adapter name is set automatically from
the pretty hostname, changing it through the D-Bus interface
will fail.

[1]: http://0pointer.de/public/systemd-man/machine-info.html
[2]: http://www.freedesktop.org/wiki/Software/systemd/hostnamed
2011-06-28 13:19:20 +03:00
Andre Guedes
4c893ee487 Cleanup: read_local_features callback is no longer used
This patch removes read_local_features callback from struct
btd_adapter_ops and its hciops/mgmtops implementations.
2011-06-17 13:36:38 +03:00
Antti Julku
6c558d3620 Add blacklisting support for management interface
Management interface commands for blocking and unblocking devices.
2011-06-16 21:51:44 +03:00
Waldemar Rymarkiewicz
90ec29300d Add support of secure pin code in mgmt code
Use secure pin code parameter received from the kernel in
MGMT_EV_PIN_CODE_REQUEST event and propagate this to agent
code.

Secure flag is specific for the pin code request only.
2011-06-08 10:04:23 +09:00
Bruna Moreira
f169bea7d5 Drop variable EIR length
The functions eir_parse() and adapter_update_found_devices() now
assume that the EIR buffer has always 240 octets. For advertising
reports, the advertising data is stored on a buffer with 240 bytes,
padded with zeroes.
2011-05-18 16:46:54 -07:00
Bruna Moreira
5b1f949a42 Remove btd_event_advertising_report
Advertises should be notified using btd_event_device_found function
to keep the compatibility with mgmtops plugin.
2011-05-18 16:46:12 -07:00
Frédéric Danis
9480e8c706 mgmt: fix DBG string format 2011-05-17 09:43:06 -07:00
Claudio Takahasi
991a7a4f09 Move EIR related functions to a new file 2011-05-17 09:07:28 -07:00
David Herrmann
2d59b9b4a3 Add length argument to hci pincode reply
This adds a new "length" argument to the hci pincode reply to allow
sending binary pins including \0 characters.
2011-05-15 02:14:17 +03:00
Szymon Janc
5cfe640e88 Remove unused discoverable variable from mgmt_update_powered 2011-05-15 01:47:11 +03:00
Szymon Janc
b671636c82 Remove unused err variable from init_conn_list 2011-05-15 01:47:11 +03:00
Szymon Janc
e37b81fa94 Remove not needed NULL check in link_key_notify
get_connection() always returns valid pointer so conn cannot be NULL.
2011-05-15 01:47:07 +03:00
Andre Guedes
e6c2d1c3fc Remove 'periodic' param from hciops_start_inquiry()
The 'periodic' parameter from hciops_start_inquiry() is useless.
This patch removes it.
2011-05-05 01:10:33 -07:00
Andre Guedes
ef7435b9c1 Remove inquiry and scanning callbacks from btd_adapter_ops
The discovery procedure is implemented in discovery callbacks
(start_discovery and stop_discovery). We don't need inquiry and
scanning specifics callbacks in btd_adapter_ops anymore.
2011-05-05 01:09:43 -07:00
Anderson Briglia
6613e8695b Implement mgmt start and stop discovery
This patch implements mgmt_start_discovery and mgmt_stop_discovery
callbacks for mgmtops.
2011-05-05 01:09:16 -07:00
Andre Guedes
57bd6dd224 Implement stop_discovery hciops callback 2011-05-05 01:09:08 -07:00
Andre Guedes
cae9fbfc03 Remove obsolete code.
adapter_get_discover_type() has become obsolete. This patch removes it and
do the proper adaptation.
2011-05-05 01:09:00 -07:00
Andre Guedes
8be3b42e34 Implement start_discovery hciops callback 2011-05-05 01:08:46 -07:00