OSDN Git Service
Claudio Takahasi [Mon, 24 Mar 2014 13:30:04 +0000 (10:30 -0300)]
gatt: Add result callback for Write Request
This patch adds a callback to allow the service implementation to inform
the core (ATT layer) the result of the write operation. Used to handle
ATT Write Request procedure, which requires ATT response.
Claudio Takahasi [Mon, 24 Mar 2014 13:30:03 +0000 (10:30 -0300)]
gatt: Assign write callback for external services
This patch adds the callback for writing the external characteristic
value. Internally, GDBusProxy implementation calls Set method of the
"Value" property. At the moment, potential errors returned by the
external service implementation are being ignored.
The ATT operation (Write Command or Request) is not exposed to the
external service implementation. GATT/GDBusProxy handles possible
DBus errors returned, and notify the core using the callbacks informed.
Write Command doesn't have callback since it doesn't return ATT errors.
Claudio Takahasi [Mon, 24 Mar 2014 13:30:02 +0000 (10:30 -0300)]
gatt: Add write callback to btd_gatt_add_char helper
This patch adds a function callback for write operations. When a remote
device writes to a given attribute, the core calls the specified write
callback informing the attribute server the new characteristic value.
Szymon Janc [Sun, 23 Mar 2014 21:40:54 +0000 (22:40 +0100)]
android/bluetooth: Fix handling of BREDR, LE and dual mode devices
This includes fix for storage format so that dual mode devices are
handled correctly. Unfortunatelly this change is not backward
compatible so wiping out /data/misc/bluetooth/ is recommended.
Also correct device type is passed to bonding commands. For create_bond
we fallback to BDEDR if device is not known. This can happen eg. with
OOB. For cancel_bond and remove_bond we require device to be known.
For dual mode device currently only BREDR type is used.
Storage change details:
Instead of storing bdaddr type of device as "Type", now two variables
are used. Boolean "BREDR" if device supports BREDR. Address type is
stored in "AddressType" only if device supports LE and is either
LE random or LE public type.
Szymon Janc [Sun, 23 Mar 2014 21:40:53 +0000 (22:40 +0100)]
android/bluetooth: Add support for new long term key mgmt event
Szymon Janc [Sun, 23 Mar 2014 21:40:52 +0000 (22:40 +0100)]
android/bluetooth: Add support for loading LTKs
Szymon Janc [Sun, 23 Mar 2014 21:40:51 +0000 (22:40 +0100)]
android/bluetooth: Filter out not discoverable LE devices
Filter out unknown LE devices that do not have Discoverable flag or
Limited Discoverable flag set.
Lukasz Rymanowski [Sun, 23 Mar 2014 20:20:09 +0000 (21:20 +0100)]
android/gatt: Restart scan after connection
With this patch we make sure that scan is restarted if it was holded for
connection purpose.
Lukasz Rymanowski [Sun, 23 Mar 2014 20:20:08 +0000 (21:20 +0100)]
android/gatt: Fix scan handling
Android has its own ScanQueue which is used for tracking scanning
clients which means we do not have to have this logic internally.
Android will call Scan Off only when his scanQueue is empty.
Szymon Janc [Mon, 24 Mar 2014 12:36:42 +0000 (13:36 +0100)]
core: Move EIR flags definitions to eir.h
Andrei Emeltchenko [Wed, 19 Mar 2014 12:26:58 +0000 (14:26 +0200)]
unit/avrcp: Fix possible buffer overflow
Parameter passed needs to be of size number otherwise there is buffer
overflow.
Claudio Takahasi [Fri, 21 Mar 2014 19:20:32 +0000 (16:20 -0300)]
tools: Fix coding style when testing pointer
This patch fixes tools/gatt-service.c coding style, using !ptr instead
of ptr == NULL.
Claudio Takahasi [Fri, 21 Mar 2014 19:20:31 +0000 (16:20 -0300)]
gatt: Fix coding style checking boolean
Use !foo instead of foo == FALSE
Claudio Takahasi [Fri, 21 Mar 2014 19:16:36 +0000 (16:16 -0300)]
gdbus: Add g_dbus_proxy_set_property_array
This patch adds a new gdbus utility function to allow setting a property
of fixed, and non-fixed values array.
Claudio Takahasi [Fri, 21 Mar 2014 19:16:34 +0000 (16:16 -0300)]
gatt: Assign read callback for external services
This patch adds the callback for reading the external characteristic
Value. Internally, GDBusProxy implementation tracks all properties Value
changes consequently Value can be ready directly from the proxy without
additional method calls.
Marcel Holtmann [Sun, 23 Mar 2014 19:37:55 +0000 (12:37 -0700)]
shared: Add proper IO disconnect handling when using epoll
Marcel Holtmann [Sun, 23 Mar 2014 19:09:58 +0000 (12:09 -0700)]
shared: Add simple function to remove entry from queue
Szymon Janc [Fri, 21 Mar 2014 17:21:32 +0000 (18:21 +0100)]
eir: Use unsigned int for flags in struct eir_data
This adds assumption that if flags field is not present in EIR all
flags are unset:
"The Flags data type shall be included when any of the Flag bits are
non-zero, otherwise the Flags data type may be omitted."
This also fix reporting non-discoverable LE devices as limited
discoverable due to no explicit check for flags == -1 as empty
flags.
Szymon Janc [Sat, 22 Mar 2014 17:26:45 +0000 (18:26 +0100)]
android/bluetooth: Constify bdaddr parameter in bt_le_device_found
Johan Hedberg [Sat, 22 Mar 2014 17:29:16 +0000 (19:29 +0200)]
core: Use non-discoverable LE device found events for existing devices
If we have an existing device objects take advantage of new data in
device found events even if the device is not discoverable. If there is
no previous device object ignore the event.
Johan Hedberg [Sat, 22 Mar 2014 17:30:18 +0000 (19:30 +0200)]
core: Update btd_adapter_find_device to also match the address type
This is necessary to do accurate matching for LE devices.
Johan Hedberg [Sat, 22 Mar 2014 17:28:45 +0000 (19:28 +0200)]
core: Add function to look up devices also by their type
Marcel Holtmann [Sat, 22 Mar 2014 05:28:01 +0000 (22:28 -0700)]
monitor: Update decoding of Apple manufacturer advertising data
Szymon Janc [Fri, 21 Mar 2014 15:06:34 +0000 (16:06 +0100)]
device: Fix sending unneeded property change signals
Send property change for Modalias only if it changed. This fix sending
multiple unneeded property change events during discovery.
Marcin Kraglak [Fri, 21 Mar 2014 14:30:20 +0000 (15:30 +0100)]
android/handsfree: Start codec selection if HF send AT+BAC while codec connection
If AG receives AT+BAC in response to +BCS, refresh list of codecs
and start new codec connection. It is required in TC_AG_ACC_BV_11_I
PTS test case.
Johan Hedberg [Fri, 21 Mar 2014 14:14:52 +0000 (16:14 +0200)]
core: Fix g_hash_table_destroy when running without -E
Luiz Augusto von Dentz [Fri, 21 Mar 2014 11:49:38 +0000 (13:49 +0200)]
obexd/client: Fix not sending OBEX Disconnect when disconnecting
Sending OBEX Disconnect command before disconnecting the transport is
mandatory.
Luiz Augusto von Dentz [Fri, 21 Mar 2014 11:09:51 +0000 (13:09 +0200)]
unit/test-gobex: Add test for g_obex_disconnect
Luiz Augusto von Dentz [Fri, 21 Mar 2014 10:56:08 +0000 (12:56 +0200)]
gobex: Add g_obex_disconnect
This adds g_obex_disconnect function which can be used to send OBEX
Disconnect command.
Luiz Augusto von Dentz [Fri, 21 Mar 2014 10:48:52 +0000 (12:48 +0200)]
TODO: Add task to implement authentication in obexd
Luiz Augusto von Dentz [Fri, 21 Mar 2014 10:22:36 +0000 (12:22 +0200)]
TODO: Add unit tests for GOEP
Luiz Augusto von Dentz [Fri, 21 Mar 2014 09:39:42 +0000 (11:39 +0200)]
TODO: Add task for PBAP 1.2
Luiz Augusto von Dentz [Fri, 21 Mar 2014 09:28:03 +0000 (11:28 +0200)]
core/profile: Add MapSupportedFeatures to MSN record
This add MapSupportedFeatures and set it to support everything including
instance information and extended event report.
Luiz Augusto von Dentz [Fri, 21 Mar 2014 09:08:05 +0000 (11:08 +0200)]
lib/sdp: Add MapSupportedFeatures attribute
This adds MapSupportedFeatures which is used for MAP v1.2 and later.
Luiz Augusto von Dentz [Fri, 21 Mar 2014 08:05:21 +0000 (10:05 +0200)]
lib/sdp: Add PbapSupportedFeatures attribute
This adds PbapSupportedFeatures which is used for PBAP v1.2 and later.
Luiz Augusto von Dentz [Thu, 20 Mar 2014 16:59:41 +0000 (18:59 +0200)]
gobex/transfer: Keep request id for GET when SRM is active
In case a GET operation is in progress with SRM the same request id is
valid for the whole transfer otherwise it is not possible to cancel the
transfer after the first response.
Luiz Augusto von Dentz [Thu, 20 Mar 2014 16:54:48 +0000 (18:54 +0200)]
gobex: Fix not resetting SRM setup
If SRM is not confirmed by both ends the setup should be disregarded and
the data associated to it can be freed otherwise the next command may
reuse the same setup assuming it is still valid and probably cause SRM
to be enabled without remote consent.
Claudio Takahasi [Thu, 20 Mar 2014 14:43:00 +0000 (11:43 -0300)]
unit: Use lower-case for 128-bit UUIDs
According to ISO/IEC 9834-8: "It is recommended that the hexadecimal
representation used in all human-readable formats be restricted to
lower-case letters. Software processing this representation is, however,
required to accept both upper and lower case letters as specified in
6.5.2."
Claudio Takahasi [Thu, 20 Mar 2014 14:42:38 +0000 (11:42 -0300)]
Replace bt_get_le64() by get_le64()
Claudio Takahasi [Thu, 20 Mar 2014 14:42:37 +0000 (11:42 -0300)]
Replace bt_get_le32() by get_le32()
Claudio Takahasi [Thu, 20 Mar 2014 14:42:36 +0000 (11:42 -0300)]
Replace bt_get_le16() by get_le16()
Johan Hedberg [Fri, 21 Mar 2014 08:39:27 +0000 (10:39 +0200)]
shared: Fix incorrect "const" in 32/64 bit put functions
Claudio Takahasi [Thu, 20 Mar 2014 14:42:35 +0000 (11:42 -0300)]
shared: Add put_be64()
Add helper to avoid possible unaligned memory access when handling
uint64 value using big-endian representation.
Claudio Takahasi [Thu, 20 Mar 2014 14:42:34 +0000 (11:42 -0300)]
shared: Add put_be32()
Add helper to avoid possible unaligned memory access when handling
uint32 value using big-endian representation.
Claudio Takahasi [Thu, 20 Mar 2014 14:42:33 +0000 (11:42 -0300)]
shared: Add put_be16()
Add helper to avoid possible unaligned memory access when handling
uint16 value using big-endian representation.
Claudio Takahasi [Thu, 20 Mar 2014 14:42:32 +0000 (11:42 -0300)]
shared: Add get_be64()
Add helper to avoid possible unaligned memory access when handling
uint64 value using big-endian representation.
Claudio Takahasi [Thu, 20 Mar 2014 14:42:31 +0000 (11:42 -0300)]
shared: Add get_be32()
Add helper to avoid possible unaligned memory access when handling
uint32 value using big-endian representation.
Claudio Takahasi [Thu, 20 Mar 2014 14:42:30 +0000 (11:42 -0300)]
shared: Add get_be16()
Add helper to avoid possible unaligned memory access when handling
uint16 value using big-endian representation.
Claudio Takahasi [Thu, 20 Mar 2014 14:42:29 +0000 (11:42 -0300)]
shared: Add get_le64()
Add helper to avoid possible unaligned memory access when handling
uint64 value using little-endian representation.
Claudio Takahasi [Thu, 20 Mar 2014 14:42:28 +0000 (11:42 -0300)]
shared: Add get_le32()
Add helper to avoid possible unaligned memory access when handling
uint32 value using little-endian representation.
Claudio Takahasi [Thu, 20 Mar 2014 14:42:27 +0000 (11:42 -0300)]
shared: Add get_le16()
Add helper to avoid possible unaligned memory access when handling
uint16 value using little-endian representation.
Claudio Takahasi [Thu, 20 Mar 2014 14:42:26 +0000 (11:42 -0300)]
shared: Add put_le64()
Add helper to avoid possible unaligned memory access when handling
uint64 value using little-endian representation.
Claudio Takahasi [Fri, 7 Mar 2014 13:14:32 +0000 (10:14 -0300)]
unit: Add test for g_dbus_client_set_ready_watch()
Claudio Takahasi [Tue, 18 Mar 2014 20:26:21 +0000 (17:26 -0300)]
gatt: Add read callback to btd_gatt_add_char helper
This patch adds a function callback for read operations. When a remote
device wants to reads a given attribute, the core calls the specified
read callback to get the value from the external services.
Claudio Takahasi [Tue, 18 Mar 2014 20:26:20 +0000 (17:26 -0300)]
gatt: Add hash table of GDBusProxy objects
This commits adds a hash table to map attributes into GDBusProxy,
allowing to call remote objects for reading and writing values.
Claudio Takahasi [Tue, 18 Mar 2014 20:26:19 +0000 (17:26 -0300)]
gatt: Add characteristic to the database
Initial support for GATT characteristics. This patch adds the
characteristic declaration attribute to the GATT local database based
on the fetched GDBusProxy objects.
Andre Guedes [Tue, 18 Mar 2014 20:26:18 +0000 (17:26 -0300)]
gatt: Add helper for creating GATT characteristics
This patch adds btd_gatt_add_char() helper. It creates and adds the
Characteristic declaration, and Characteristic value attributes to the
local attribute database.
Andre Guedes [Tue, 18 Mar 2014 20:26:17 +0000 (17:26 -0300)]
gatt: Add function to create constant attributes
This patch adds a helper function to create attribute with static
values. It is intended to be used to create GATT services, and
characteristic declarations.
Claudio Takahasi [Tue, 18 Mar 2014 20:26:16 +0000 (17:26 -0300)]
shared: Add bswap_128()
Adds a new helper to swap 128-bit values. It is intended to be used for
GATT 128-bit UUID handling, converting 128-bit UUID from big-endian to
little-endian (or the opposite).
No matter the system, bt_uuid_t should always store 128-bit UUID value
using big-endian format (similar to human-readable format).
Szymon Janc [Thu, 20 Mar 2014 13:27:07 +0000 (14:27 +0100)]
android: Fix some random code style issues
Fix whitespace problems and not needed empty lines.
Luiz Augusto von Dentz [Thu, 20 Mar 2014 13:50:50 +0000 (15:50 +0200)]
obexd/client: Fix not being able cancel GET requests
In case of GET operation the code does not use g_obex_get_req_pkt since
the beggining to be able to read the header from the first response, this
means that the request should be cancel with g_obex_cancel_req not with
g_obex_cancel_transfer.
Luiz Augusto von Dentz [Thu, 20 Mar 2014 13:50:51 +0000 (15:50 +0200)]
core/profile: Remove code for waiting services to be resolved
This remove code related to waiting service to be resolved as it is now
part of btd_request_authorization.
Luiz Augusto von Dentz [Thu, 20 Mar 2014 13:50:49 +0000 (15:50 +0200)]
core: Wait for services to be resolved before doing authorization
This makes btd_request_authorization to wait until services are resolved
before proceeding with authorization, if the services could not be
resolved it still proceeds with authorization since some profile may not
have a record to be resolved.
Lukasz Rymanowski [Thu, 20 Mar 2014 13:25:09 +0000 (14:25 +0100)]
tools/mgmt-tester: Remove dead code
Lukasz Rymanowski [Thu, 20 Mar 2014 13:25:08 +0000 (14:25 +0100)]
tools/mgmt-tester: Minor fix in Stop discovery Success 1 test
Set directly setup_send params for start discovery. It will be easier to
follow the test.
Johan Hedberg [Thu, 20 Mar 2014 14:08:36 +0000 (16:08 +0200)]
core: Ignore ATT errors when considering Pair() success
Occasionally there may be errors in completing the service discovery
process over ATT when pairing with an LE device. Since we will any way
pick up from where we left off the next time we get connected it should
be safe to return success for the Pair() method call as long as the
actual pairing part was successful.
Johan Hedberg [Thu, 20 Mar 2014 14:06:21 +0000 (16:06 +0200)]
core: Fix Paired property notification for multiple bearers
The code in device_set_paired wasn't quite right previously. We should
not be sending Paired=true if we've already done that once due to the
other supported bearer.
Lukasz Rymanowski [Thu, 20 Mar 2014 12:59:29 +0000 (13:59 +0100)]
tools/mgmt-tester: Refactor setup_start_discovery function
This patch removes handling hook register from this
function and its callback as this is no longer necessary for any stop
discovery tests.
This patch also adds setup_send_param and setup_send_len parameters to
test data so it is easy to control start discovery command parameters.
It is useful for tests:
Stop Discovery - Invalid parameters 1
Stop Discovery - BR/EDR (Inquiry) Success 1
Szymon Janc [Thu, 20 Mar 2014 12:31:48 +0000 (13:31 +0100)]
android/README: Add "Customization" section
Szymon Janc [Thu, 20 Mar 2014 11:04:46 +0000 (12:04 +0100)]
android/README: Update Known Android issues section
Szymon Janc [Wed, 19 Mar 2014 07:25:26 +0000 (08:25 +0100)]
android/handsfree: Fix not sending callheld=2 when single call was held
Szymon Janc [Wed, 19 Mar 2014 07:25:25 +0000 (08:25 +0100)]
android/handsfree: Improve audio connection handling
This add disconnecting SCO if last call was dropped (required by
Java 'virtual voice call'). Also make sure that SCO is connected
only there were no calls present before phone state change. This
makes sure SCO won't be re-connected in three way calling scenarios
when user choose to not use audio on BT headset.
Lukasz Rymanowski [Thu, 20 Mar 2014 11:25:13 +0000 (12:25 +0100)]
shared: Fix missing destroy callback in timeout_add
Lukasz Rymanowski [Thu, 20 Mar 2014 11:25:11 +0000 (12:25 +0100)]
tools/mgmt-tester: Remove not used condition
Lukasz Rymanowski [Thu, 20 Mar 2014 11:25:10 +0000 (12:25 +0100)]
tools/mgmt-tester: Update Stop Discovery-BR/EDR (Inquiry) Success 1
With new way of handling inquiry in btdev there is no need to register
inquiry event hook
Lukasz Rymanowski [Thu, 20 Mar 2014 11:25:09 +0000 (12:25 +0100)]
tools/mgmt-tester: Fix for Stop discovery test
Test "Stop Discovery - BR/EDR (Inquiry) Success 1" uses hciemu_type
BREDR but uses power settings to enable LE and tries to set LE:
mgmt: [0x0002] command 0x000d
mgmt: < 0d 00 02 00 01 00 01 .......
mgmt: > 02 00 02 00 03 00 0d 00 0c .........
mgmt: [0x0002] command 0x0d status: 0x0c
This patch fixes this minor issue
Lukasz Rymanowski [Thu, 20 Mar 2014 11:25:08 +0000 (12:25 +0100)]
android/tester: Fix handling inquiry by android tester
Previously btdev sent inquiry_complete in one mainloop iteration. Due to
new way of handling it we need to make sure cancel_discovery is called
if start_discovery has been used.
There is also no need to hook before inquiry_complete_event in case of
test for cancel_discovery.
Johan Hedberg [Thu, 20 Mar 2014 12:15:31 +0000 (14:15 +0200)]
emulator: Minor coding style fix
Lukasz Rymanowski [Thu, 20 Mar 2014 11:25:07 +0000 (12:25 +0100)]
emulator: Add handling inquiry_lenght from inquiry command
With this patch, btdev is taking into accoung inquiry_lenght from hci
inquiry command.
Inquiry session will last that long unless number of devices parameter
has been provided different then 0
Lukasz Rymanowski [Thu, 20 Mar 2014 11:25:06 +0000 (12:25 +0100)]
emulator: Add handling inquiry number of responses
Lukasz Rymanowski [Thu, 20 Mar 2014 11:25:05 +0000 (12:25 +0100)]
emulator: Add inquiry cancel
With this patch, scheduled inquiry session in btdev can be canceled
Lukasz Rymanowski [Thu, 20 Mar 2014 11:25:04 +0000 (12:25 +0100)]
emulator: Use timeout for sending inquiry results
With this patch btdev uses timeout to schedule inquiry results
It also allows btdev to receive hci commands during inquiry.
Previously btdev was blocked since all the inquiry result were sent in
single loop
Johan Hedberg [Thu, 20 Mar 2014 09:19:46 +0000 (11:19 +0200)]
core: Treat NOT_CONNECTED response as disconnection success
Johan Hedberg [Thu, 20 Mar 2014 09:00:30 +0000 (11:00 +0200)]
attrib: Fix gatt_primary leaks when a failure occurs
Johan Hedberg [Thu, 20 Mar 2014 07:36:29 +0000 (09:36 +0200)]
tools/ibeacon: Convert to using shared/timeout.h
Johan Hedberg [Thu, 20 Mar 2014 07:36:14 +0000 (09:36 +0200)]
tools/btinfo: Convert to using shared/timeout.h
Johan Hedberg [Thu, 20 Mar 2014 07:35:56 +0000 (09:35 +0200)]
tools/3dsp: Convert to using shared/timeout.h
Marcel Holtmann [Thu, 20 Mar 2014 06:35:41 +0000 (23:35 -0700)]
shared: Fix mainloop timeout return value check
Marcel Holtmann [Thu, 20 Mar 2014 05:30:40 +0000 (22:30 -0700)]
shared: Use unsigned int for timeout identifier
Marcel Holtmann [Thu, 20 Mar 2014 05:30:04 +0000 (22:30 -0700)]
build: Add timeout abstraction to Bluetooth emulation
Marcel Holtmann [Thu, 20 Mar 2014 05:29:23 +0000 (22:29 -0700)]
build: Add timeout abstraction to main Bluetooth daemon
Johan Hedberg [Wed, 19 Mar 2014 17:28:19 +0000 (19:28 +0200)]
attrib: Use destroy notify for included query
Johan Hedberg [Wed, 19 Mar 2014 17:18:36 +0000 (19:18 +0200)]
attrib: Fix potential leaks with primary discovery context
Johan Hedberg [Wed, 19 Mar 2014 17:06:18 +0000 (19:06 +0200)]
core: Don't try to continue ATT discovery after a failure
Johan Hedberg [Wed, 19 Mar 2014 17:05:43 +0000 (19:05 +0200)]
core: Add debug logs to track ATT discover progress
Johan Hedberg [Wed, 19 Mar 2014 17:04:26 +0000 (19:04 +0200)]
gattrib: Fix pending command handling when getting disconnected
Johan Hedberg [Wed, 19 Mar 2014 16:15:06 +0000 (18:15 +0200)]
core: Fix replying to Pair() if disconnected during included discovery
Johan Hedberg [Wed, 19 Mar 2014 15:58:14 +0000 (17:58 +0200)]
core: Fix completing ATT service discovery when no services are discovered
Johan Hedberg [Wed, 19 Mar 2014 14:45:40 +0000 (16:45 +0200)]
core: Fix memory leaks with struct discover_char
Szymon Janc [Wed, 19 Mar 2014 14:48:19 +0000 (15:48 +0100)]
android/health: Move unregister app command definition to proper place