bluez-mcap-hdp:mcap-hdp.git
7 years agoRelease 4.81 master
Marcel Holtmann [Tue, 30 Nov 2010 14:55:09 +0000 (15:55 +0100)]
Release 4.81

7 years agoFix not canceling pending calls on maemo6 telephony driver exit
Luiz Augusto von Dentz [Tue, 30 Nov 2010 12:38:29 +0000 (14:38 +0200)]
Fix not canceling pending calls on maemo6 telephony driver exit

This happens when the driver exit is called quickly after init due to
adapter power changes.

7 years agoUse specific members in D-Bus match rules on telephony maemo6 driver
Luiz Augusto von Dentz [Tue, 30 Nov 2010 12:26:14 +0000 (14:26 +0200)]
Use specific members in D-Bus match rules on telephony maemo6 driver

This reduces the amount of unnecessary wake-ups without breaking anything

7 years agoFix interface name of modem states on maemo6 telephony driver
Luiz Augusto von Dentz [Tue, 30 Nov 2010 12:26:13 +0000 (14:26 +0200)]
Fix interface name of modem states on maemo6 telephony driver

7 years agoInitialize adapter services list
Daniel Orstadius [Tue, 30 Nov 2010 11:27:57 +0000 (13:27 +0200)]
Initialize adapter services list

In case service records have been added to bluetoothd before a new
adapter is registered, the records which are shared by all adapters
(indicated by having the address set to BDADDR_ANY) need to be added
to the services list of the new adapter. This patch adds a function
for this on adapter initialization.

The issue could be reproduced by running bluetoothd and obexd on a
PC and briefly removing the BT dongle. The service records from
obexd would not be present in the adapter's local list (which is
used to set the class of device).

7 years agoEmit Connect signal for LE capable devices
Sheldon Demario [Mon, 29 Nov 2010 18:36:29 +0000 (13:36 -0500)]
Emit Connect signal for LE capable devices

7 years agoAttrib server should truncate attribute value to pdu length
Sheldon Demario [Mon, 29 Nov 2010 12:44:22 +0000 (07:44 -0500)]
Attrib server should truncate attribute value to pdu length

When the size of attribute value is greater than pdu size, it should be
truncated to the pdu length - 2

7 years agoDon't trigger the discovering when registering the client
Claudio Takahasi [Wed, 24 Nov 2010 02:30:47 +0000 (00:30 -0200)]
Don't trigger the discovering when registering the client

Discover All Primary Services should not be trigged by the attribute
client when a given device is registered. Discover services is now done
by the device entity.

7 years agoFix memory leak of sdp list in the attribute client
Claudio Takahasi [Wed, 24 Nov 2010 02:30:46 +0000 (00:30 -0200)]
Fix memory leak of sdp list in the attribute client

7 years agoReturn a D-Bus error if device_browse fails
Claudio Takahasi [Wed, 24 Nov 2010 02:30:45 +0000 (00:30 -0200)]
Return a D-Bus error if device_browse fails

If Discover All Primary Services or SDP search fails, the CreateDevice
caller will not receive a response. Error reproducible when a Discover
All Primary Services is sent over a LE link and the kernel doesn't
address properly the connections in the channel ID 4.

7 years agoCheck the device type when creating the device
Claudio Takahasi [Wed, 24 Nov 2010 02:30:44 +0000 (00:30 -0200)]
Check the device type when creating the device

For CreateDevice, if the remote device is LE capable, Discover All
Primary Services shall be issued instead of SDP queries. The logic
to define if the remote is LE capable shall be based on the result
of the interleaved discovery results. Meaning, the remote device
is classified as LE capable only if an advertising event from this
device was collected during the discovery.

Limitation: Advertising event data is not being considered yet to
infer the remote properties and CreateDevice needs to be called
during the discovery session.

7 years agoImplement primary service search when creating a device
Claudio Takahasi [Wed, 24 Nov 2010 02:30:43 +0000 (00:30 -0200)]
Implement primary service search when creating a device

Discover primary services implemented inside the device entity to allow
proper integration of attribute plugin. Implements a single entry point
to the attribute plugin no matter the transport(BR/EDR or LE), the device
probe callback is called for both types.

Add a new function to discover all primary services without additional
calls to fetch the remaining primary services, sub-procedure iterations
is handled inside this function.

The next action are: clean the attribute client removing implicity service
and characteristics discovery, issue the Discover Primary Service based on
the remote properties and fetch the characteristic on demand.

7 years agoRemoved unused define
Claudio Takahasi [Mon, 29 Nov 2010 13:24:13 +0000 (10:24 -0300)]
Removed unused define

7 years agohcid header cleanup
Claudio Takahasi [Mon, 29 Nov 2010 13:24:14 +0000 (10:24 -0300)]
hcid header cleanup

7 years agoRemove unused scan_mode variable
Johan Hedberg [Sun, 28 Nov 2010 19:13:59 +0000 (21:13 +0200)]
Remove unused scan_mode variable

7 years agoUse existing bit functions from hci.h
Johan Hedberg [Sun, 28 Nov 2010 18:23:43 +0000 (20:23 +0200)]
Use existing bit functions from hci.h

7 years agoRemove unused includes
Johan Hedberg [Sun, 28 Nov 2010 11:40:38 +0000 (13:40 +0200)]
Remove unused includes

7 years agoRemove unused define
Johan Hedberg [Sun, 28 Nov 2010 11:19:53 +0000 (13:19 +0200)]
Remove unused define

7 years agoUse address instead of object path in device logs
Johan Hedberg [Sat, 27 Nov 2010 16:03:09 +0000 (18:03 +0200)]
Use address instead of object path in device logs

7 years agoImprove hciops logging
Johan Hedberg [Sat, 27 Nov 2010 15:39:37 +0000 (17:39 +0200)]
Improve hciops logging

7 years agoImprove agent PIN length error log
Johan Hedberg [Sat, 27 Nov 2010 15:00:03 +0000 (17:00 +0200)]
Improve agent PIN length error log

7 years agoUse hci_send_cmd instead of hci_send_req for authentication
Johan Hedberg [Sat, 27 Nov 2010 14:51:37 +0000 (16:51 +0200)]
Use hci_send_cmd instead of hci_send_req for authentication

In addition to blocking the mainloop hci_send_req changes the socket
filters which makes it unusable for the per-adapter HCI socket in
hciops.c. Using hci_send_cmd makes much more sense here.

7 years agoFix crash after simultaneous authentication requests
Rafal Michalski [Thu, 25 Nov 2010 10:06:55 +0000 (11:06 +0100)]
Fix crash after simultaneous authentication requests

Previously simultaneous authentication requests to the same device caused
bluetoothd crash. Now if ongoing authentication occurs error is returned,
preventing from simultaneous requests to the same device.

7 years agosdpd header cleanup
Claudio Takahasi [Wed, 24 Nov 2010 18:16:56 +0000 (15:16 -0300)]
sdpd header cleanup

7 years agoFix telephony maemo6 driver deinitialization
Luiz Augusto von Dentz [Thu, 25 Nov 2010 16:07:02 +0000 (18:07 +0200)]
Fix telephony maemo6 driver deinitialization

Remove all match rules and unregister its interface when telephony_exit
is called.

7 years agoFix telephony dummy driver
Luiz Augusto von Dentz [Thu, 25 Nov 2010 15:22:30 +0000 (17:22 +0200)]
Fix telephony dummy driver

Make it unregister its interface on telephony_exit

7 years agoFix not deinitializing telephony driver when there is no adapter powered
Luiz Augusto von Dentz [Thu, 25 Nov 2010 15:22:29 +0000 (17:22 +0200)]
Fix not deinitializing telephony driver when there is no adapter powered

This changes hook telephony driver de/initialization to powered state so
telephony drivers can now free their resources when there is no adapter
active in the system.

7 years agoExtend discover characteristic by UUID in gatttool to fetch all values
Sheldon Demario [Tue, 23 Nov 2010 12:37:19 +0000 (07:37 -0500)]
Extend discover characteristic by UUID in gatttool to fetch all values

If the number of characteristics returned exceeds the MTU size, it will
be needed to ask for more data until the handle range is entirely
searched.

7 years agohciattach: download configuration at user requested baud rate
Suraj Sumangala [Tue, 23 Nov 2010 10:59:23 +0000 (16:29 +0530)]
hciattach: download configuration at user requested baud rate

This patch support downloading configuration for Atheros AR300x HCI UART
chip at user requested baud rate instead of the initial baud rate.

7 years agohciattach: make set_speed return error if any operation fails
Suraj Sumangala [Tue, 23 Nov 2010 10:39:43 +0000 (16:09 +0530)]
hciattach: make set_speed return error if any operation fails

This patch lets set_speed function changing UART baud rate to return an
error code if any one operation fails instead of returning only the last
operation's status.

7 years agoAdd a runtime option to set the BCSP communication rate
Wade Brown [Mon, 22 Nov 2010 23:03:12 +0000 (23:03 +0000)]
Add a runtime option to set the BCSP communication rate

7 years agoFix typo in adapter documentation
Jose Antonio Santos Cadenas [Mon, 22 Nov 2010 19:05:56 +0000 (20:05 +0100)]
Fix typo in adapter documentation

7 years agoFix MDL and MCL reference counting in IO watchers
Jose Antonio Santos Cadenas [Mon, 22 Nov 2010 14:55:12 +0000 (15:55 +0100)]
Fix MDL and MCL reference counting in IO watchers

When a io_watcher is added to an MDL or an MCL channel, its reference
should be incremented because the watcher should keep its own reference
the the structure.

Also a destroy function is added in order to decrement the reference
once the watcher is removed.

7 years agoDo not increment mdl reference in reconnections
Santiago Carot-Nemesio [Mon, 22 Nov 2010 08:10:46 +0000 (09:10 +0100)]
Do not increment mdl reference in reconnections

7 years agoRelease 4.80
Marcel Holtmann [Sun, 21 Nov 2010 19:12:19 +0000 (20:12 +0100)]
Release 4.80

7 years agoMake LE_LINK define private to hcitool.c for now
Johan Hedberg [Sun, 21 Nov 2010 19:01:20 +0000 (20:01 +0100)]
Make LE_LINK define private to hcitool.c for now

The value 0x03 isn't something that exists in the core spec, so it
shouldn't be used in the same API as SCO/ACL link types. Since there are
some experimental kernel patches that use it this patch makes it private
to hcitool.c.

7 years agoFix possible race condition when initializing adapters
Johan Hedberg [Fri, 19 Nov 2010 19:01:04 +0000 (21:01 +0200)]
Fix possible race condition when initializing adapters

Due to a possible kernel bug, sometimes the very first HCI commands that
the kernel sends might go unnoticed. Therefore check for this when one
of the last commands (read_local_name) that the kernel sends completes.

7 years agoFix not indicating disconnected state when connecting to avdtp
Luiz Augusto von Dentz [Fri, 19 Nov 2010 15:19:23 +0000 (17:19 +0200)]
Fix not indicating disconnected state when connecting to avdtp

This cause parts of code such as audio/sink.c to keeps its internal state
as connecting and thus prevent any other connection attempt to succeed.

7 years agoFix not dropping avdtp session reference when cancelling stream setup
Luiz Augusto von Dentz [Fri, 19 Nov 2010 15:12:49 +0000 (17:12 +0200)]
Fix not dropping avdtp session reference when cancelling stream setup

This will indicate to the session that there is no need to proceed with
stream configuration and that it should disconnect.

7 years agoFix possible crashes when attempting to connect avdtp
Luiz Augusto von Dentz [Fri, 19 Nov 2010 15:30:24 +0000 (17:30 +0200)]
Fix possible crashes when attempting to connect avdtp

Since the connections can be cancelled while still not complete the
GIOChannel must be stored in order to be properly closed when freeing
avdtp session or stream and thus avoid any callbacks to be called after
that.

7 years agoAdd debug logs for state changes on sink
Luiz Augusto von Dentz [Fri, 19 Nov 2010 15:11:00 +0000 (17:11 +0200)]
Add debug logs for state changes on sink

7 years agoFix reference count of a2dp stream setup
Luiz Augusto von Dentz [Thu, 18 Nov 2010 16:29:11 +0000 (18:29 +0200)]
Fix reference count of a2dp stream setup

Each callback should have a reference to the setup and once the callback
is removed the setup should be unreferenced which wasn't always the case.

7 years agoFix abort not being send when the state is idle
Luiz Augusto von Dentz [Thu, 18 Nov 2010 15:45:52 +0000 (17:45 +0200)]
Fix abort not being send when the state is idle

The spec clearly suggested that abort can be send while on idle state:

"AVDTP_ABORT_CMD can be sent or received in IDLE state. In the event that
an AVDTP_ABORT_CMD is received in IDLE state, ACP or INT shall reply with
an AVDTP_ABORT_RSP, no state change is required."

In fact abort is the only way to cancel set_configuration and open
commands.

7 years agoFix not removing all timers when user request to disconnect audio
Luiz Augusto von Dentz [Mon, 15 Nov 2010 01:08:35 +0000 (01:08 +0000)]
Fix not removing all timers when user request to disconnect audio

This timers can trigger reconnections which is not a desirable behavior

7 years agoCleanup a2dp_cancel code
Luiz Augusto von Dentz [Mon, 15 Nov 2010 13:35:22 +0000 (13:35 +0000)]
Cleanup a2dp_cancel code

If the id doesn't match any data we should not try to free anything since
obviously there is nothing to free.

7 years agoCleanup a2dp setup code
Luiz Augusto von Dentz [Fri, 12 Nov 2010 15:39:51 +0000 (17:39 +0200)]
Cleanup a2dp setup code

7 years agoFix minor typo
Johan Hedberg [Fri, 19 Nov 2010 15:39:15 +0000 (17:39 +0200)]
Fix minor typo

7 years agoAvoid reallocations of services UUID array
Anderson Lizardo [Fri, 19 Nov 2010 14:59:19 +0000 (10:59 -0400)]
Avoid reallocations of services UUID array

The array of service UUIDs used by the DeviceFound signal contains the
same information from the GSList of services. Instead of reallocating
this array on each signal, store it on the remote_dev_info structure and
only reallocate it if there are new UUIDs.

7 years agoMerge service UUIDs from different BR/EDR EIR data
Anderson Lizardo [Fri, 19 Nov 2010 14:50:40 +0000 (10:50 -0400)]
Merge service UUIDs from different BR/EDR EIR data

For LE devices, service UUIDs present in advertising data are merged
into a single list. This change makes the same thing for BR/EDR devices.

7 years agoExtract flags from advertising data
Bruna Moreira [Fri, 19 Nov 2010 13:57:28 +0000 (09:57 -0400)]
Extract flags from advertising data

These flags will be used to decide if GATT service discovery will happen
over LE (for single mode devices) or BR/EDR (for dual mode and non-LE
devices).

7 years agoImplement Characteristic Value Read using UUID in the gatttool
Sheldon Demario [Fri, 19 Nov 2010 13:34:57 +0000 (08:34 -0500)]
Implement Characteristic Value Read using UUID in the gatttool

Sub-procedure used to read a Characteristic Value when the client
only knows the characteristic UUID and doesn't know the handle.
More than one handle and attribute value pair can be returned,
it is up to the user define the handles range based on the service
handles range.

Usage example:
$gatttool --char-read --uuid=2a00 -i hcix -b xx:xx:xx:xx:xx:xx

7 years agohciattach: send hci commands after hci socket bring up
Suraj Sumangala [Fri, 19 Nov 2010 05:51:43 +0000 (11:21 +0530)]
hciattach: send hci commands after hci socket bring up

This patch makes The Atheros AR300x specific initialization code
to send power management command over HCI socket after bringing up
the device.

7 years agoImplement Discover Primary Service by Service UUID in the gatttool
Claudio Takahasi [Thu, 18 Nov 2010 18:07:34 +0000 (16:07 -0200)]
Implement Discover Primary Service by Service UUID in the gatttool

Implement only the first interaction of the discovery procedure. If the
response doesn't fit in the MTU, "start" and "end" options can be used
to discover the handles ranges of the remaining primary service instances.
UUID16 and UUID128 are supported in the uuid option.

Usage example:
$gatttool -i hcix -b xx:xx:xx:xx:xx:xx --uuid=1801 --primary

7 years agoAdd an extra parameter in the discovery primary to specify the UUID
Claudio Takahasi [Wed, 17 Nov 2010 18:09:45 +0000 (16:09 -0200)]
Add an extra parameter in the discovery primary to specify the UUID

Extends discover primary function to perform discover by UUID. UUID
parameter defines which procedure will be executed: Discover All
Primary Services or Discover Primary Service by Service UUID.

7 years agoExtend bt_string2uuid to convert hex strings to UUID16
Claudio Takahasi [Wed, 17 Nov 2010 18:09:44 +0000 (16:09 -0200)]
Extend bt_string2uuid to convert hex strings to UUID16

Convert four or six(0x) digits length hexadecimal strings to UUID16.

7 years agoImplement Find by Type Value Request in the atttribute server
Claudio Takahasi [Thu, 18 Nov 2010 18:02:33 +0000 (16:02 -0200)]
Implement Find by Type Value Request in the atttribute server

GATT Discover Primary Service by Service UUID sub-procedure is based
on ATT Find By Type Value Request/Response.

Implement an extra verification for broken requests: "Ending Handle"
different than 0xFFFF. The Group End Handle may be greater than the
"Ending Handle" in the Find By Type Value Request. Forces the "Ending
Handle" in the response to 0xFFFF to avoid another request from the
clients. 0xFFFF means that the sub-procedure is complete.

7 years agoAdd Find By Type Value Response encoding/decoding functions
Claudio Takahasi [Thu, 18 Nov 2010 17:48:44 +0000 (15:48 -0200)]
Add Find By Type Value Response encoding/decoding functions

Find by type operation is used by Discover Primary Service by Service
UUID. Find By Type Value Response shall contain one or more group handles.

7 years agoAdd iwmmxt optimization for sbc for pxa series cpu
Keith Mok [Thu, 18 Nov 2010 13:33:16 +0000 (21:33 +0800)]
Add iwmmxt optimization for sbc for pxa series cpu

Add iwmmxt optimization for sbc for pxa series cpu.

Benchmarked on ARM PXA platform:
===  Before (4 bands) ====
$ time  ./sbcenc_orig  -s 4     long.au  > /dev/null
real    0m 2.44s
user    0m 2.39s
sys     0m 0.05s
===  After (4 bands) ====
$ time  ./sbcenc  -s 4     long.au  > /dev/null
real    0m 1.59s
user    0m 1.49s
sys     0m 0.10s

===  Before (8 bands) ====
$ time  ./sbcenc_orig   -s 8     long.au  > /dev/null
real    0m 4.05s
user    0m 3.98s
sys     0m 0.07s
===  After (8 bands) ====
$ time  ./sbcenc  -s 8     long.au  > /dev/null
real    0m 1.48s
user    0m 1.41s
sys     0m 0.06s

===  Before (a2dp usage) ====
$ time  ./sbcenc_orig   -b53 -s8 -j    long.au  > /dev/null
real    0m 4.51s
user    0m 4.41s
sys     0m 0.10s
===  After (a2dp usage) ====
$ time  ./sbcenc   -b53 -s8 -j    long.au  > /dev/null
real    0m 2.05s
user    0m 1.99s
sys     0m 0.06s

7 years agoFix C++ style comment
Johan Hedberg [Thu, 18 Nov 2010 15:03:10 +0000 (17:03 +0200)]
Fix C++ style comment

7 years agoCheck if the mcl insiede the device is correctly set before use it
Jose Antonio Santos Cadenas [Tue, 16 Nov 2010 11:50:58 +0000 (12:50 +0100)]
Check if the mcl insiede the device is correctly set before use it

7 years agoCheck if MCAP Instance is already released when a callbacks comes back.
Santiago Carot-Nemesio [Tue, 16 Nov 2010 11:44:18 +0000 (12:44 +0100)]
Check if MCAP Instance is already released when a callbacks comes back.

7 years agoFixes to echo
Jose Antonio Santos Cadenas [Tue, 16 Nov 2010 09:42:14 +0000 (10:42 +0100)]
Fixes to echo

7 years agoRemove magic number to check ECHO MDEPs in HDP
Jose Antonio Santos Cadenas [Tue, 16 Nov 2010 09:10:56 +0000 (10:10 +0100)]
Remove magic number to check ECHO MDEPs in HDP

7 years agoReturn proper response code if there is an error creating echo channel
Santiago Carot-Nemesio [Tue, 16 Nov 2010 09:09:30 +0000 (10:09 +0100)]
Return proper response code if there is an error creating echo channel

7 years agoFix dereference to NULL pointers during data channels creation
Santiago Carot-Nemesio [Tue, 16 Nov 2010 08:59:13 +0000 (09:59 +0100)]
Fix dereference to NULL pointers during data channels creation

7 years agoCode refactorization in MCAP
Santiago Carot-Nemesio [Mon, 15 Nov 2010 13:08:49 +0000 (14:08 +0100)]
Code refactorization in MCAP

7 years agoRemove old reference to mcap session in the name of variables
Santiago Carot-Nemesio [Fri, 12 Nov 2010 16:05:27 +0000 (17:05 +0100)]
Remove old reference to mcap session in the name of variables

7 years agoAdd reference counter to mcap_mdl
Santiago Carot-Nemesio [Fri, 12 Nov 2010 12:55:33 +0000 (13:55 +0100)]
Add reference counter to mcap_mdl

7 years agoFix message error
Jose Antonio Santos Cadenas [Fri, 12 Nov 2010 13:25:32 +0000 (14:25 +0100)]
Fix message error

7 years agoSet reference counter for mcls to gint
Jose Antonio Santos Cadenas [Fri, 12 Nov 2010 13:01:10 +0000 (14:01 +0100)]
Set reference counter for mcls to gint

7 years agoAdd reference counter to mcap_instances
Santiago Carot-Nemesio [Fri, 12 Nov 2010 12:57:48 +0000 (13:57 +0100)]
Add reference counter to mcap_instances

7 years agoFix typos in mcap
Jose Antonio Santos Cadenas [Fri, 12 Nov 2010 12:26:50 +0000 (13:26 +0100)]
Fix typos in mcap

7 years agoNotify a channel deleted when remote side has already deleted it
Jose Antonio Santos Cadenas [Fri, 12 Nov 2010 11:26:43 +0000 (12:26 +0100)]
Notify a channel deleted when remote side has already deleted it

7 years agoAdd missed unrefs for hdp_tmp_dc_data
Santiago Carot-Nemesio [Fri, 12 Nov 2010 11:19:01 +0000 (12:19 +0100)]
Add missed unrefs for hdp_tmp_dc_data

7 years agoRemove MCL's before removing the application
Santiago Carot-Nemesio [Fri, 12 Nov 2010 08:33:27 +0000 (09:33 +0100)]
Remove MCL's before removing the application

If you do in the other way you will find freed memory while
removing the mcl.

7 years agoAdd reference counter to hdp_channel
Jose Antonio Santos Cadenas [Thu, 11 Nov 2010 15:16:02 +0000 (16:16 +0100)]
Add reference counter to hdp_channel

7 years agoAdd reference counter to hdp_device
Santiago Carot-Nemesio [Thu, 11 Nov 2010 15:09:00 +0000 (16:09 +0100)]
Add reference counter to hdp_device

7 years agoAdd reference counter to hdp_application
Jose Antonio Santos Cadenas [Thu, 11 Nov 2010 13:50:12 +0000 (14:50 +0100)]
Add reference counter to hdp_application

7 years agoImplement Find by Type request encode/decoding
Bruna Moreira [Wed, 17 Nov 2010 18:09:41 +0000 (16:09 -0200)]
Implement Find by Type request encode/decoding

7 years agoEmit "DeviceFound" signal for LE devices
Bruna Moreira [Wed, 17 Nov 2010 15:59:53 +0000 (11:59 -0400)]
Emit "DeviceFound" signal for LE devices

The adapter_emit_device_found() function was modified to emit
DeviceFound signal for LE devices as well.

7 years agoExtract service UUIDs from advertising data
Bruna Moreira [Wed, 17 Nov 2010 15:59:52 +0000 (11:59 -0400)]
Extract service UUIDs from advertising data

Make get_eir_uuids() return a GSList of strings, so it can be reused to
extract UUIDs from LE advertising data. The bt_strlist2array() helper
function was created to convert a GSList into a plain array of strings
(needed to send through D-Bus).

7 years agoAdvertising data: extract local name
Bruna Moreira [Wed, 17 Nov 2010 15:59:51 +0000 (11:59 -0400)]
Advertising data: extract local name

Move extract_eir_name() to glib-helper.c file and rename function to
bt_extract_eir_name(). The local name is extracted from the advertising
data.

7 years agoAdding a new option to specify security level for gatttool
Sheldon Demario [Wed, 17 Nov 2010 13:26:40 +0000 (08:26 -0500)]
Adding a new option to specify security level for gatttool

7 years agohciops: fix encryption request
Johan Hedberg [Thu, 18 Nov 2010 08:40:49 +0000 (08:40 +0000)]
hciops: fix encryption request

hciops_encrypt_link() was not working because it interfered with the
event filters of the hciops internal socket. Instead a separate socket
opened with hci_open_dev() needs to be used.

7 years agoFix typos in adapter documentation
Jose Antonio Santos Cadenas [Mon, 15 Nov 2010 18:48:03 +0000 (19:48 +0100)]
Fix typos in adapter documentation

7 years agoInitial advertising data parsing implementation
Bruna Moreira [Thu, 11 Nov 2010 23:39:26 +0000 (20:39 -0300)]
Initial advertising data parsing implementation

Implement adapter_update_adv() function to parse advertising data
received by btd_event_adv() function. Add some fields for advertising
data in remote_device_info struct.

7 years agoFix signedness issue with set_class error checking
Johan Hedberg [Fri, 12 Nov 2010 21:30:36 +0000 (23:30 +0200)]
Fix signedness issue with set_class error checking

7 years agoRemove non-existent function declaration
Johan Hedberg [Fri, 12 Nov 2010 21:19:45 +0000 (23:19 +0200)]
Remove non-existent function declaration

7 years agoFix local name handling
Johan Hedberg [Fri, 12 Nov 2010 21:10:55 +0000 (23:10 +0200)]
Fix local name handling

A name variable of 248 bytes can't be passed to functions that expect it
to be nul-terminated (since if the name is exactly 248 bytes it wont
be). This patch fixes the name to always be stored in a 249 byte
variable where the last byte is always zero.

7 years agoClean up adapter_update_local_name API
Johan Hedberg [Fri, 12 Nov 2010 21:04:47 +0000 (23:04 +0200)]
Clean up adapter_update_local_name API

7 years agoClean up EIR TX power handling
Johan Hedberg [Fri, 12 Nov 2010 20:40:18 +0000 (22:40 +0200)]
Clean up EIR TX power handling

7 years agoRemove non-existent function declaration
Johan Hedberg [Fri, 12 Nov 2010 20:27:10 +0000 (22:27 +0200)]
Remove non-existent function declaration

7 years agoGet rid of event.c wrapper for SSP mode read event
Johan Hedberg [Fri, 12 Nov 2010 20:25:50 +0000 (22:25 +0200)]
Get rid of event.c wrapper for SSP mode read event

7 years agoMove local name reading into hciops
Johan Hedberg [Fri, 12 Nov 2010 20:15:03 +0000 (22:15 +0200)]
Move local name reading into hciops

7 years agoMove SSP mode reading into hciops
Johan Hedberg [Fri, 12 Nov 2010 20:01:38 +0000 (22:01 +0200)]
Move SSP mode reading into hciops

Since the only thing the code does upon a write_ssp_mode_complete event
is issue a read_ssp_mode command it makes sense to have this internal to
hciops.

7 years agoMove SSP mode setting into hciops
Johan Hedberg [Fri, 12 Nov 2010 19:24:48 +0000 (21:24 +0200)]
Move SSP mode setting into hciops

7 years agoMove more hciops specific functionality into hciops
Johan Hedberg [Fri, 12 Nov 2010 16:37:40 +0000 (18:37 +0200)]
Move more hciops specific functionality into hciops

Several adapter initialization features will be handled by the new
management interface in the future, so move these from adapter.c into
hciops. This also gets rid of a couple of unnecessary adapter_ops
callbacks.

7 years agoDon't cache the local name until it's actually used for something
Johan Hedberg [Fri, 12 Nov 2010 16:04:36 +0000 (18:04 +0200)]
Don't cache the local name until it's actually used for something

This saves 248 bytes per adapter until there's actually some code that
might need the cache.

7 years agohciops: wait for read_local_name complete in adapter init
Johan Hedberg [Fri, 12 Nov 2010 15:46:37 +0000 (17:46 +0200)]
hciops: wait for read_local_name complete in adapter init

To avoid clashes with name reads and writes in the core daemon it's
better to wait for the name read command that the kernel sends upon
init.

7 years agoRemove misleading error log
Johan Hedberg [Fri, 12 Nov 2010 12:47:16 +0000 (14:47 +0200)]
Remove misleading error log

It's normal for the adapter to have BDADDR_ANY in the early stages of
initialization so don't log anything about this to avoid confusion.