Commit Graph

350 Commits

Author SHA1 Message Date
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
Andre Guedes
94e7feb45f Add extfeatures to struct dev_info
The extfeatures field will be used by hciops layer to know if the
adapter is LE capable.
2011-05-05 01:08:31 -07:00
Andre Guedes
ff376acf18 Refactoring adapter_set_state()
This patch implements a new state machine for struct btd_adapter.

The adapter_set_state() function was completely rewritten since its
logic does not apply anymore. The whole logic of interleaved discovery
procedure before implemented in adapter_set_state() should be
implemented at hciops and mgmtops layers.

At the adapter layer, it is not important to track what is the current
state (inquiring or scanning) during the discovery session. All the
adapter layer cares about is if it is performing the discovery or not.
Therefore, the adapter states STATE_STDINQ, STATE_PINQ and
STATE_LE_SCAN were replaced by a new state called STATE_DISCOV.

Additionally, because there is no point in implementing states
as a bitmask, all adapter states were implemented using integers
instead of a bitmask.
2011-05-05 01:07:26 -07:00
Andre Guedes
9235d4b5ae Add 'timeout' param to start_scanning callback
This patch adds a timeout parameter to start_scanning callback in
btd_adapter. The parameter should be used to stop scanning  after
'timeout' milliseconds.
2011-05-05 01:07:14 -07:00
Andre Guedes
17baf8a0d5 Remove Periodic Inquiry support in hciops
Periodic Inquiry is no longer supported in hciops since the discovery
procedure will use Standard Inquiry only.

External tools which request Periodic Inquiry will not change the
adapter's state.
2011-05-05 01:06:03 -07:00
Andre Guedes
2a807a5036 Add 'discov_state' field to struct dev_info
We need to track the current discovering state (HALTED, INQUIRY or SCAN)
of the adapter in hciops layer during the discovery procedure. This will
help us to properly update the state of btd_adapter and emit the property
"Discovering" correctly.
2011-05-05 01:05:13 -07:00
Andre Guedes
4cb11a06dc Add discovery callbacks to btd_adapter_ops
This patch adds start_discovery and stop_discovery callbacks to
struct btd_adapter_ops. These callbacks are responsible for starting
and stoping the discovery procedure. It also creates dummy functions
in hciops and mgmtops which implements those callbacks.
2011-05-05 00:41:48 -07:00
Johan Hedberg
3caf142f55 Add support for store_hint in mgmt_ev_new_key 2011-04-28 23:00:15 +03:00
Johan Hedberg
2ad1015a16 mgmtops: Add support for confirm_hint in mgmt_ev_user_confirm_request
Since we don't yet have a proper Agent.ConfirmPairing D-Bus callback,
and can't add one before 5.x just do an automatic reply for now.
2011-04-28 02:27:01 +03:00
Bruna Moreira
cef8838500 Use HCI_MAX_EIR_LENGTH instead of hard-coded value 2011-04-27 16:25:02 -07:00
Bruna Moreira
cc263203a5 Remove read_local_version() from struct btd_adapter_ops
This callback is used only for getting HCI version/manufacturer
information, and is not being called anywhere in BlueZ anymore.
2011-04-20 19:33:15 +03:00
Bruna Moreira
cdb503df88 Remove ssp_mode from struct hci_dev
ssp_mode is duplicated information and is not being used anywhere.
2011-04-20 19:27:24 +03:00
Johan Hedberg
6f7add5435 mgmt: Add support for discovering event 2011-03-31 14:36:43 +03:00
Johan Hedberg
421efd407e mgmt: Add support for start_discovery & stop_discovery 2011-03-31 14:26:20 +03:00
Anderson Lizardo
d3c57d0f63 Remove hard-coded handles from example GATT plugin
Instead of having static handles, use attrib_db_find_avail() to find
available handle ranges.

Also split the big register_attributes() into one function per service.
2011-03-30 19:37:47 +03:00
Anderson Lizardo
a3e9d397f0 Move GATT example server to a standalone plugin
The GATT example server was in the same plugin as the GATT client.
Moving it to a separate plugin will allow to easily disable it.
2011-03-30 19:19:29 +03:00
Johan Hedberg
56fe067384 mgmt: Add support for remote_name event 2011-03-30 12:25:08 +03:00
Johan Hedberg
cb6dd1222d mgmt: Add support for device_found event 2011-03-30 12:25:08 +03:00
Johan Hedberg
5fda71ad98 Remove unused define 2011-03-28 19:16:42 +03:00
Johan Hedberg
9d5936a515 Clean up Out Of Band D-Bus interface naming 2011-03-28 19:16:19 +03:00
Johan Hedberg
d97cea1477 mgmtops: Pass UUID-128's in little endian format to the kernel
To be consistent with the rest of the management interface the UUIDs
should also be sent in little endian byte order.
2011-03-28 13:59:44 +03:00
Szymon Janc
d812870321 Add D-Bus OOB plugin
A sample OOB plugin that directly exposes OOB functionality over D-Bus.
2011-03-27 22:58:13 +03:00
Szymon Janc
23586efc94 Add support for Out of Band (OOB) association model in hciops 2011-03-27 22:55:28 +03:00
Szymon Janc
ca8ea935e9 Add support for Out of Band (OOB) association model in mgmtops 2011-03-27 22:55:11 +03:00
Szymon Janc
75397433e8 Add initial support for Out of Band (OOB) association model 2011-03-27 22:52:54 +03:00
Rafal Michalski
ab8a3b8361 Fix strict aliasing issue in hciops
This patch changes type of the "pending" variable to uint32_t. A pointer
to this variable is passed to the hci_clear_bit function as void * and
then cast to uint32_t * again.

Previously the unsigned long type could cause some unexpected behavior
due to violating strict aliasing rules. This patch fixes this problem by
making sure that the same integer type is used in all places.

This solution is simpler than the other option of changing the types of
all other places (from uint32_t to unsigned long, including changing
type for casting in hci_*_bit function family). Also, not all places can
be changed, like the hci_dev_info struct, since it would violate
compatibility rules between the kernel and user space.
2011-03-23 15:11:23 +02:00
Johan Hedberg
4f8d6ba353 Fix missing check for dev->up before calling init_adapter
With some kernels and the right timing it is possible to get into the
state where we get the local name but haven't yet gotten a DEVUP event.
In such a case it is *not* ok to call init_adapter.
2011-03-17 14:33:02 +02:00
Johan Hedberg
803db5d475 mgmt: support for local_name_changed event 2011-03-15 20:51:46 +02:00
Johan Hedberg
7abf8c6e4d mgmt: Fix debug log strings 2011-03-15 20:34:08 +02:00
Johan Hedberg
3011a312a7 mgmt: Implement adapter name control
This patch adds a new set_local_name command as well as a
local_name_changed event to the management interface. Instead of 248
bytes (like in the HCI spec) 249 bytes are always reserved for the name
in the messages so that there's a guarantee of it being nul-terminated
(this is not guaranteed on the HCI level).
2011-03-15 19:32:09 +02:00
Johan Hedberg
1c16543345 mgmt: Add adapter name to read_info response 2011-03-15 19:30:11 +02:00
Johan Hedberg
9bae9813ab Remove check for adapter->up for read_local_name_complete
Due to recent kernel changes we could be receiving these command
complete events even though HCIDEVUP hasn't completed yet.
2011-03-04 16:21:52 -03:00
Szymon Janc
3119976f87 Fix hal plugin compilation error 2011-03-04 15:51:49 -03:00
Szymon Janc
da4ffa7209 Move index to common header in management interface
Match changes introduced in mgmt interface after moving controller
index to common header.
2011-02-25 12:53:48 -03:00
Daniel Orstadius
1b80034b89 Maemo6 MCE: skip first adapter_powered callback
The maemo6 MCE plugin should be used with the flag InitiallyPowered
in main.conf set to 'true' so that BlueZ powers on the adapter
and leaves it in that state when the daemon is started. The plugin
will read the radio state from the MCE and set the state
accordingly. The maemo6 plugin is a btd_adapter_driver and those
drivers are loaded after BlueZ has read the BD address etc from the
adapter.

This patch adds a boolean flag in the callback to ignore the initial
powering on of the adapter by BlueZ, since it shouldn't be
propagated to the MCE. With InitiallyPowered set to 'false' the
adapter_powered callback is not called when the adapter is turned
on at BlueZ startup, which is why this wasn't implemented before.
2011-02-24 16:17:38 -03:00
Anderson Lizardo
941eb99732 Fix DBG() calls with bogus messages
Remove unnecessary trailing newlines (already added by DBG()) and
rewrite debug messages to become more useful.
2011-02-24 15:27:17 -03:00
Andre Guedes
e27614655c Fix potential bug in le_advertising_report()
In the current implementation of le_advertising_report(), the variable
'info' has an invalid memory address after the 'for' loop. If 'info'
is dereferenced it will access invalid memory.

This patch fixes this potential bug and improves the code's readability.
2011-02-22 23:59:47 -03:00
Johan Hedberg
62d7730afe Fix bonding_complete indication for mgmt_pair_device complete event
In some (rare) circumstances it is possible for the mgmt_pair_device
command to complete without there being any other indication of
completion of the procedure. Therefore, the bonding_complete event needs
to be notified to the core daemon also in this situation.
2011-02-20 15:18:37 -03:00
Johan Hedberg
a20bb21f47 mgmt: Add support for auth_failed event and bonding_complete hooks
This patch adds support for the mgmt_auth_failed event together with the
related bonding_complete failure hooks to the core daemon.
2011-02-18 21:54:47 +02:00
Johan Hedberg
4d21e85715 Move SSP auto-accept handling completely inside hciops
There's no need to expose the auto-accept case to the core daemon so
move it to hciops. For the management interface this will all be handled
on the kernel side.
2011-02-17 11:31:35 -03:00
Johan Hedberg
50102905d9 mgmt: Add User Confirmation request support 2011-02-16 22:47:25 +02:00
Johan Hedberg
073c798c8f Remove unused scan_enable code
Several functions aren't needed anymore since we don't do a
HCI_Write_Scan_Enable(NO_SCAN) upon adapter power off.
2011-02-15 19:46:02 +02:00