OSDN Git Service

android-x86/external-bluetooth-bluez.git
11 years agomedia: Add gateway_get_state() to internal API
Mikel Astiz [Fri, 7 Sep 2012 15:20:27 +0000 (17:20 +0200)]
media: Add gateway_get_state() to internal API

Expose the state of the gateway interface in the internal API.

11 years agomedia: Add a2dp_sep_is_playing() to internal API
Mikel Astiz [Fri, 7 Sep 2012 15:20:26 +0000 (17:20 +0200)]
media: Add a2dp_sep_is_playing() to internal API

Add this function to expose whether the local SEP is streaming or not.

11 years agomedia: Fix accesstype comparison
Mikel Astiz [Fri, 7 Sep 2012 15:20:25 +0000 (17:20 +0200)]
media: Fix accesstype comparison

Replace the string representation of the accesstype with a conventional
binary representation. This makes the code simpler and more efficient.

This also fixes a minor bug in the Release() D-Bus method, where the
string comparison was used to see whether the owner should be removed. A
client acquiring with "rw" and releasing with "wr" would lead to the
inconsistent state of having a released transport with an owner with no
accesstype. Partial releases can also get affected by this bug since the
released character (partial accesstype) got replaced by a whitespace.

Additionally, this approach is more robust in case new flags are added
in the future.

11 years agoinput: Remove unnecessary struct input_conn
Johan Hedberg [Tue, 11 Sep 2012 10:29:01 +0000 (13:29 +0300)]
input: Remove unnecessary struct input_conn

There's no need to maintain the capability of multiple connections per
device, so just merge the connections list into the main input_device
struct.

11 years agoinput: Remove fakhid functionality
Johan Hedberg [Mon, 10 Sep 2012 12:51:23 +0000 (15:51 +0300)]
input: Remove fakhid functionality

The HSP code conflicts with a real HSP implementation and the PS3
support should be done through the kernel.

11 years agoprofile: Add asynchronous completion functions for connect/disconnect
Johan Hedberg [Mon, 10 Sep 2012 12:38:55 +0000 (15:38 +0300)]
profile: Add asynchronous completion functions for connect/disconnect

11 years agocore: Move profile code into profile.{c,h}
Johan Hedberg [Mon, 10 Sep 2012 12:32:22 +0000 (15:32 +0300)]
core: Move profile code into profile.{c,h}

11 years agoavctp: Fix reply for message with invalid PID
Par-Gunnar Hjalmdahl [Tue, 11 Sep 2012 06:16:26 +0000 (08:16 +0200)]
avctp: Fix reply for message with invalid PID

Reply for control message with invalid (not registered for reception
of messages) PID should not have message information field present.

This was affecting AVCTP qualification test case TP/NFR/BI-01-C.

11 years agonetwork: Fix minor whitespace issue
Johan Hedberg [Mon, 10 Sep 2012 07:38:01 +0000 (10:38 +0300)]
network: Fix minor whitespace issue

11 years agocore: Remove pattern matching when probing services
Johan Hedberg [Fri, 7 Sep 2012 13:09:52 +0000 (16:09 +0300)]
core: Remove pattern matching when probing services

This code was only needed for the Serial interface for matching all
RFCOMM-based records, and now that this interface is gone the code is
also no-longer needed.

11 years agofakehid: Add support for Logitech Harmony Adapter for PS3
David Dillow [Fri, 31 Aug 2012 02:06:00 +0000 (22:06 -0400)]
fakehid: Add support for Logitech Harmony Adapter for PS3

This emulates a Sony BD Remote for the Logitech Harmony series of
universal remotes.

11 years agofakehid: Disconnect from PS3 remote after 10 mins
Bastien Nocera [Fri, 7 Sep 2012 12:02:14 +0000 (13:02 +0100)]
fakehid: Disconnect from PS3 remote after 10 mins

After 10 minutes, disconnect the PS3 BD Remote to avoid draining its
battery. This is consistent with its behaviour on the PS3.

Original patch by Ruslan N. Marchenko <rufferson@gmail.com>

11 years agoinput: Add helper function to request disconnect
Bastien Nocera [Fri, 7 Sep 2012 12:01:58 +0000 (13:01 +0100)]
input: Add helper function to request disconnect

11 years agofakehid: Use the same constant as declared
Bastien Nocera [Fri, 7 Sep 2012 11:01:22 +0000 (12:01 +0100)]
fakehid: Use the same constant as declared

ps3remote_keymap[] uses 0xff as the max value, so should we.

11 years agotest: Add compact mode to test-discovery
Johan Hedberg [Fri, 7 Sep 2012 11:12:33 +0000 (14:12 +0300)]
test: Add compact mode to test-discovery

11 years agocore: Add a list of LE devices to connect
João Paulo Rechi Vita [Tue, 4 Sep 2012 19:04:32 +0000 (16:04 -0300)]
core: Add a list of LE devices to connect

This commit creates a per-adapter list of LE devices to connect when a
advertising from them is seen during a scan.

11 years agocore: Add compare function for bdaddr in a struct btd_device
João Paulo Rechi Vita [Tue, 4 Sep 2012 19:04:31 +0000 (16:04 -0300)]
core: Add compare function for bdaddr in a struct btd_device

This is a utility function similar to device_address_cmp but comparing
bdaddr instead of the string representing the address. This way is
possible to avoid allocating two buffers to temporarily hold the
strings, two sprintf() calls to generate the strings from the bdaddr
arrays, and a string comparison, substituting all of it for one memcmp()
call.

11 years agomgmt: Print error message when start_discovery fails
João Paulo Rechi Vita [Tue, 4 Sep 2012 19:04:30 +0000 (16:04 -0300)]
mgmt: Print error message when start_discovery fails

If we fail to communicate with the MGMT socket is better to print the
error message on the mgmtops plugin, where it really happened, instead
of leaving this job to its users.

11 years agohcitool: Add LE scan based on White List
Claudio Takahasi [Thu, 30 Aug 2012 16:16:33 +0000 (13:16 -0300)]
hcitool: Add LE scan based on White List

This patch extends the LE scanning command allowing the user to inform
an option to enable LE scanning detecting advertises sent from devices
in the White List Only. This option can be used combined with others.

11 years agogatt: Fix reading Service Changed CCC
Andrzej Kaczmarek [Thu, 6 Sep 2012 09:15:08 +0000 (11:15 +0200)]
gatt: Fix reading Service Changed CCC

Find Information Request is only sent when there are no more attributes
following Service Changed Value (incorrect) and thus will never find CCC.

11 years agomgmt: Use bt_get_* helper functions to access unaligned memory
Szymon Janc [Tue, 4 Sep 2012 14:41:33 +0000 (16:41 +0200)]
mgmt: Use bt_get_* helper functions to access unaligned memory

11 years agoeir: Use bt_get_* helper functions to access unaligned memory
Szymon Janc [Tue, 4 Sep 2012 14:41:32 +0000 (16:41 +0200)]
eir: Use bt_get_* helper functions to access unaligned memory

11 years agoavrcp: Fix compilation errors due to unaligned memory access
Szymon Janc [Tue, 4 Sep 2012 14:41:31 +0000 (16:41 +0200)]
avrcp: Fix compilation errors due to unaligned memory access

This fix following build errors on ARM.

  CC     audio/bluetoothd-avrcp.o
audio/avrcp.c: In function avrcp_handle_get_element_attributes:
audio/avrcp.c:667:25: error: cast increases required alignment of
target type [-Werror=cast-align]
audio/avrcp.c:690:20: error: cast increases required alignment of
target type [-Werror=cast-align]
cc1: all warnings being treated as errors
make[1]: *** [audio/bluetoothd-avrcp.o] Error 1
make: *** [all] Error 2

11 years agohciemu: Fix build errors due to unaligned memory access
Szymon Janc [Tue, 4 Sep 2012 14:41:30 +0000 (16:41 +0200)]
hciemu: Fix build errors due to unaligned memory access

This fix following build errors on ARM.

  CC     test/hciemu.o
test/hciemu.c: In function num_completed_pkts:
test/hciemu.c:429:4: error: cast increases required alignment of target
 type [-Werror=cast-align]
test/hciemu.c:430:4: error: cast increases required alignment of target
type [-Werror=cast-align]
cc1: all warnings being treated as errors
make[1]: *** [test/hciemu.o] Error 1
make: *** [all] Error 2

11 years agosdpd-service: Fix build errors due to unaligned memory access
Szymon Janc [Tue, 4 Sep 2012 14:41:29 +0000 (16:41 +0200)]
sdpd-service: Fix build errors due to unaligned memory access

This fix number of build errors on ARM similar to one below.

  CC     src/bluetooth-sdpd-service.o
src/sdpd-service.c: In function service_remove_req:
src/sdpd-service.c:517:20: error: cast increases required alignment of
target type [-Werror=cast-align]
src/sdpd-service.c:517:20: error: cast increases required alignment of
target type [-Werror=cast-align]
src/sdpd-service.c:536:2: error: cast increases required alignment of
target type [-Werror=cast-align]
src/sdpd-service.c:536:2: error: cast increases required alignment of
target type [-Werror=cast-align]
cc1: all warnings being treated as errors

11 years agosdpd-request: Fix build errors due to unaligned memory access
Szymon Janc [Tue, 4 Sep 2012 14:41:28 +0000 (16:41 +0200)]
sdpd-request: Fix build errors due to unaligned memory access

This fix number of build errors on ARM similar to one below.

  CC     src/bluetooth-sdpd-request.o
src/sdpd-request.c: In function extra_des:
src/sdpd-request.c:181:5: error: cast increases required alignment
    of targettype [-Werror=cast-align]

11 years agoadaptername: Refactor handle_inotify_cb
Szymon Janc [Tue, 4 Sep 2012 14:41:27 +0000 (16:41 +0200)]
adaptername: Refactor handle_inotify_cb

Refactor handle_inotify_cb to avoid unaligned memory access.
Instead of reading whole events buffer and cast to event struct when
iterating over it, read data directly to struct inotify_event one
event at time.

This fix following build error on ARM.

  CC     plugins/bluetoothd-adaptername.o
plugins/adaptername.c: In function handle_inotify_cb:
plugins/adaptername.c:244:34: error: cast increases required alignment
of target type [-Werror=cast-align]
cc1: all warnings being treated as errors
make[1]: *** [plugins/bluetoothd-adaptername.o] Error 1
make: *** [all] Error 2

11 years agosap: Fix compilation errors due to unaligned memory access
Szymon Janc [Tue, 4 Sep 2012 14:41:26 +0000 (16:41 +0200)]
sap: Fix compilation errors due to unaligned memory access

This fix following build errors on ARM.

  CC     profiles/sap/bluetoothd-server.o
profiles/sap/server.c: In function connect_req:
profiles/sap/server.c:317:8: error: cast increases required alignment
of targettype [-Werror=cast-align]
profiles/sap/server.c: In function sap_connect_rsp:
profiles/sap/server.c:676:16: error: cast increases required alignment
of target type [-Werror=cast-align]
cc1: all warnings being treated as errors
make[1]: *** [profiles/sap/bluetoothd-server.o] Error 1
make: *** [all] Error 2

11 years agoscotest: Fix compilation errors due to unaligned memory access
Szymon Janc [Tue, 4 Sep 2012 14:41:25 +0000 (16:41 +0200)]
scotest: Fix compilation errors due to unaligned memory access

This fix following build errors on ARM.

  CC     test/scotest.o
test/scotest.c: In function send_mode:
test/scotest.c:272:4: error: cast increases required alignment of
target type [-Werror=cast-align]
test/scotest.c:273:4: error: cast increases required alignment of
target type [-Werror=cast-align]
cc1: all warnings being treated as errors
make[1]: *** [test/scotest.o] Error 1
make: *** [all] Error 2

11 years agorctest: Fix compilation errors due to unaligned memory access
Szymon Janc [Tue, 4 Sep 2012 14:41:24 +0000 (16:41 +0200)]
rctest: Fix compilation errors due to unaligned memory access

This fix following build errors on ARM.

  CC     test/rctest.o
test/rctest.c: In function do_send:
test/rctest.c:539:4: error: cast increases required alignment of target
type [-Werror=cast-align]
test/rctest.c:540:4: error: cast increases required alignment of target
type [-Werror=cast-align]
cc1: all warnings being treated as errors
make[1]: *** [test/rctest.o] Error 1

11 years agol2test: Fix compilation errors due to unaligned memory access
Szymon Janc [Tue, 4 Sep 2012 14:41:23 +0000 (16:41 +0200)]
l2test: Fix compilation errors due to unaligned memory access

This fix following build errors on ARM.

  CC     test/l2test.o
test/l2test.c: In function recv_mode:
test/l2test.c:826:9: error: cast increases required alignment of target
type [-Werror=cast-align]
test/l2test.c:834:8: error: cast increases required alignment of target
type [-Werror=cast-align]
test/l2test.c: In function do_send:
test/l2test.c:893:4: error: cast increases required alignment of target
type [-Werror=cast-align]
test/l2test.c:894:4: error: cast increases required alignment of target
type [-Werror=cast-align]
cc1: all warnings being treated as errors
make[1]: *** [test/l2test.o] Error 1

11 years agosdp: Use bt_get_be* helpers instead of bt_get_unaligned
Szymon Janc [Tue, 4 Sep 2012 14:41:22 +0000 (16:41 +0200)]
sdp: Use bt_get_be* helpers instead of bt_get_unaligned

This fix number of compilation errors on ARM similar to one below.

lib/sdp.c: In function 'sdp_uuid_extract':
lib/sdp.c:1019:27: error: cast increases required alignment
    of target type [-Werror=cast-align]
lib/sdp.c:1019:27: error: cast increases required alignment
    of target type [-Werror=cast-align]
lib/sdp.c:1026:27: error: cast increases required alignment
    of target type [-Werror=cast-align]
lib/sdp.c:1026:27: error: cast increases required alignment
    of target type [-Werror=cast-align]

11 years agosdp: Fix compilation errors due to unaligned memory access
Szymon Janc [Tue, 4 Sep 2012 14:41:21 +0000 (16:41 +0200)]
sdp: Fix compilation errors due to unaligned memory access

This fix number of build errors on ARM similar to one below.

lib/sdp.c: In function 'sdp_set_seq_len':
lib/sdp.c:625:3: error: cast increases required alignment of target
 type [-Werror=cast-align]
lib/sdp.c:625:3: error: cast increases required alignment of target
type [-Werror=cast-align]
lib/sdp.c:631:3: error: cast increases required alignment of target
type [-Werror=cast-align]
lib/sdp.c:631:3: error: cast increases required alignment of target
type [-Werror=cast-align]

11 years agolib: Add unaligned put helper functions
Szymon Janc [Tue, 4 Sep 2012 14:41:20 +0000 (16:41 +0200)]
lib: Add unaligned put helper functions

These functions are similar to bt_get_* functions.

11 years agomgmt: Implement support for Passkey Notify event
Johan Hedberg [Tue, 4 Sep 2012 12:55:16 +0000 (15:55 +0300)]
mgmt: Implement support for Passkey Notify event

11 years agocore: Refactor authentication handling
Johan Hedberg [Tue, 4 Sep 2012 10:46:41 +0000 (13:46 +0300)]
core: Refactor authentication handling

11 years agosimple-agent: Update to match correct DisplayPasskey API
Johan Hedberg [Tue, 4 Sep 2012 10:58:03 +0000 (13:58 +0300)]
simple-agent: Update to match correct DisplayPasskey API

11 years agomgmt-api: Add event for passkey notification
Johan Hedberg [Tue, 4 Sep 2012 10:52:20 +0000 (13:52 +0300)]
mgmt-api: Add event for passkey notification

11 years agoagent: Add missing parameter to DisplayPasskey
Johan Hedberg [Tue, 4 Sep 2012 10:48:01 +0000 (13:48 +0300)]
agent: Add missing parameter to DisplayPasskey

11 years agoagent-api: DisplayPasskey: D-Bus doesn't have a uint8 type
Johan Hedberg [Tue, 4 Sep 2012 10:49:58 +0000 (13:49 +0300)]
agent-api: DisplayPasskey: D-Bus doesn't have a uint8 type

11 years agoaudio: Handle error in gateway_request_stream()
Mikel Astiz [Tue, 4 Sep 2012 11:15:56 +0000 (13:15 +0200)]
audio: Handle error in gateway_request_stream()

gateway_request_stream() should check if the call to get_records() has
succeeded, and fail otherwise.

11 years agoaudio: Fix gateway in connecting state forever
Mikel Astiz [Tue, 4 Sep 2012 11:15:55 +0000 (13:15 +0200)]
audio: Fix gateway in connecting state forever

If bt_search_service() fails the state should be left unchanged.
Otherwise the gateway state is set forever to GATEWAY_STATE_CONNECTING.

This issue can be easily reproduced if a connection attempt is done
very soon after startup.

11 years agoaudio: Remove unused function
Mikel Astiz [Tue, 4 Sep 2012 11:15:54 +0000 (13:15 +0200)]
audio: Remove unused function

gateway_config_stream() is now unnecessary after the removal of the unix
socket support in commit 1d9d0527cfb6d96a976ede56bd43a2bc16bb5f21.

11 years agoaudio: Fix gateway probe always failing
Mikel Astiz [Tue, 4 Sep 2012 09:55:27 +0000 (11:55 +0200)]
audio: Fix gateway probe always failing

Commit 813b674bce1aab009e7f2d14d1825f603330563d introduced this trivial
bug which causes the failure of the gateway profile probe.

11 years agocore: Fix calling profile remove callbacks
Johan Hedberg [Tue, 4 Sep 2012 08:10:01 +0000 (11:10 +0300)]
core: Fix calling profile remove callbacks

The device_remove callback for profiles applies to the entire profile so
it should only be used if no matching UUIDs are left or the device
object itself is removed.

11 years agogatt: Translate Characteristic names
Chen Ganir [Tue, 4 Sep 2012 04:46:30 +0000 (07:46 +0300)]
gatt: Translate Characteristic names

Translate Characteristic UUID's to name. This list was taken from
the Bluetooth SIG developer site.

11 years agoinput: Use bt_uuid_strcmp where is makes sense
Johan Hedberg [Tue, 4 Sep 2012 01:05:47 +0000 (04:05 +0300)]
input: Use bt_uuid_strcmp where is makes sense

11 years agocore: Use bt_uuid_strcmp where it makes sense
Johan Hedberg [Tue, 4 Sep 2012 01:04:55 +0000 (04:04 +0300)]
core: Use bt_uuid_strcmp where it makes sense

11 years agogatt: Fix whitespace in UUID definitions
Andrzej Kaczmarek [Fri, 31 Aug 2012 14:36:32 +0000 (16:36 +0200)]
gatt: Fix whitespace in UUID definitions

11 years agothermometer: Fix indentation
Andrzej Kaczmarek [Mon, 3 Sep 2012 11:54:59 +0000 (14:54 +0300)]
thermometer: Fix indentation

11 years agonetwork: Fix bnep setup failure handle bug
Chan-yeol Park [Tue, 28 Aug 2012 10:24:55 +0000 (19:24 +0900)]
network: Fix bnep setup failure handle bug

This patch initializes rsp varialbe again for the remain failure
procedure.

11 years agocore: replace NULL by dbus invalid arguments
Chan-yeol Park [Tue, 28 Aug 2012 10:24:54 +0000 (19:24 +0900)]
core: replace NULL by dbus invalid arguments

This patch replaces NULL with dbus invalid arguments return if dbus
method call gets invalid arguments from the peer. This will avoid dbus
peer coommander's infinite wait.

11 years agoaudio: Remove unused enum values
Chan-yeol Park [Tue, 28 Aug 2012 10:24:53 +0000 (19:24 +0900)]
audio: Remove unused enum values

11 years agoaudio: remove redundant Media API option
Chan-yeol Park [Mon, 3 Sep 2012 11:48:01 +0000 (14:48 +0300)]
audio: remove redundant Media API option

BlueZ supports only Media API. So option handler's are useless.

11 years agoproximity: Remove unnecessary check for GATT enabled
Andrzej Kaczmarek [Fri, 31 Aug 2012 12:48:31 +0000 (14:48 +0200)]
proximity: Remove unnecessary check for GATT enabled

Proximity plugin won't be loaded if GATT is disabled so there's no point
in checking this once more when adapter is probed.

11 years agoproximity: Simplify DBusConnection object usage
Andrzej Kaczmarek [Mon, 3 Sep 2012 11:01:41 +0000 (14:01 +0300)]
proximity: Simplify DBusConnection object usage

DBusConnection object can be obtained at any time by
get_dbus_connection() call so there is no need to pass and store it
across profile code. Also there's no need to ref/unref this object as by
design it will live for entire lifetime of plugin.

11 years agoproximity: Remove unused definitions
Andrzej Kaczmarek [Fri, 31 Aug 2012 12:48:28 +0000 (14:48 +0200)]
proximity: Remove unused definitions

11 years agoproximity: Change adapter driver function names
Andrzej Kaczmarek [Mon, 3 Sep 2012 10:59:40 +0000 (13:59 +0300)]
proximity: Change adapter driver function names

The probe and remove suffixes better describe what these functions
actually do.

11 years agoAdd profile abstraction (replaces btd_device drivers)
Johan Hedberg [Mon, 3 Sep 2012 11:11:36 +0000 (14:11 +0300)]
Add profile abstraction (replaces btd_device drivers)

This patch removes the btd_device_driver concept and replaces it with
btd_profile. The new construct also contains the necessary parts for
adapter drivers, so btd_adapter_driver is only needed for non-profile
related functionality (most of which is in plugins/*).

The main purpose of this new construct is to facilitate a centralized
connection creation mechanism for profiles, ultimately enabling the
addition of a Device.Connect() method instead of requiring a UI to know
to call e.g. Input.Connect or Audio.Connect.

This feature will also be extended to externally implemented profiles
once the internal implementation gets more stable, such as OBEX (obexd)
and HFP (oFono). The new D-Bus interface will also partially restore
functionality which was previously available through the Serial
interface.

11 years agouuid: Add string-format UUID comparison helper function
Johan Hedberg [Sat, 1 Sep 2012 17:14:41 +0000 (20:14 +0300)]
uuid: Add string-format UUID comparison helper function

11 years agocore: Add D-Bus disconnect function for easier detection
Johan Hedberg [Sun, 2 Sep 2012 13:03:56 +0000 (16:03 +0300)]
core: Add D-Bus disconnect function for easier detection

11 years agoTODO: Add entry for converting storage format for BlueZ 5
Johan Hedberg [Fri, 31 Aug 2012 18:49:09 +0000 (11:49 -0700)]
TODO: Add entry for converting storage format for BlueZ 5

11 years agorctest: fix typo
Gustavo Padovan [Mon, 27 Aug 2012 13:14:49 +0000 (08:14 -0500)]
rctest: fix typo

recevied -> received

11 years agobtio: Remove BT_IO_L2ERTM
Johan Hedberg [Wed, 29 Aug 2012 16:03:39 +0000 (09:03 -0700)]
btio: Remove BT_IO_L2ERTM

There's no need to have a separate type for ERTM. The mode parameter
takes care of most needs and if necessary a "reliable" parameter can be
added later which will map to SOCK_STREAM usage.

11 years agoUpdate code base to use the new BtIO API
Johan Hedberg [Wed, 29 Aug 2012 00:08:29 +0000 (17:08 -0700)]
Update code base to use the new BtIO API

11 years agobtio: Make BtIOType private
Johan Hedberg [Wed, 29 Aug 2012 00:07:16 +0000 (17:07 -0700)]
btio: Make BtIOType private

Since the socket type can be inferred from the socket itself or from the
PSM/Channel/CID/etc parameters provided to listen() and connect() it
doesn't make sense to expose this in the BtIO API.

11 years agobtio: Remove unneeded L2CAP raw socket support
Johan Hedberg [Tue, 28 Aug 2012 20:57:56 +0000 (13:57 -0700)]
btio: Remove unneeded L2CAP raw socket support

Now that pairing is done through mgmt this support is no-longer needed.

11 years agosdp: Fix error reporting in sdp_service_search_attr_req
Szymon Janc [Tue, 28 Aug 2012 13:33:16 +0000 (15:33 +0200)]
sdp: Fix error reporting in sdp_service_search_attr_req

This function reports error code via errno not return value.

11 years agosdp: Fix redundant NULL checks in convert_raw_attr_to_xml_func
Szymon Janc [Tue, 28 Aug 2012 13:33:15 +0000 (15:33 +0200)]
sdp: Fix redundant NULL checks in convert_raw_attr_to_xml_func

Param data can't be NULL and was already dereferenced before check.

11 years agoTODO: Add a few more items for BlueZ 5
Johan Hedberg [Mon, 27 Aug 2012 23:03:16 +0000 (16:03 -0700)]
TODO: Add a few more items for BlueZ 5

11 years agocore: Fix not updating storage when mode changes
Chan-yeol Park [Mon, 27 Aug 2012 09:19:52 +0000 (18:19 +0900)]
core: Fix not updating storage when mode changes

With mgmt interface bluetoothd is no longer requesting mode change for
things like DiscoverableTimeout as the kernel will do that automatically
when the timer expires.

11 years agoFix trivial coding style issues on pointer declarations and casting
Anderson Lizardo [Tue, 21 Aug 2012 15:49:24 +0000 (11:49 -0400)]
Fix trivial coding style issues on pointer declarations and casting

Avoid using C++ style pointer declarations like "char* ptr", as most
BlueZ code uses "char *ptr".

11 years agoinput: Add Nordic Semiconductor copyright
Claudio Takahasi [Mon, 20 Aug 2012 17:53:51 +0000 (14:53 -0300)]
input: Add Nordic Semiconductor copyright

11 years agocore: Fix memory leak
Vinicius Costa Gomes [Fri, 24 Aug 2012 23:51:38 +0000 (20:51 -0300)]
core: Fix memory leak

When ignoring a LE device that is not in a discoverable state 'alias'
is leaking.

11 years agoinput: Fix signedness issue on POSIX error code usage
Anderson Lizardo [Fri, 24 Aug 2012 21:03:49 +0000 (17:03 -0400)]
input: Fix signedness issue on POSIX error code usage

By convention, error variables containing POSIX error code (usually
called "err") are negative. This commit fixes a couple of places where
positive values are expected.

12 years agonetwork: Fix warning when removing connection timeout handler
Luiz Augusto von Dentz [Thu, 23 Aug 2012 15:40:00 +0000 (18:40 +0300)]
network: Fix warning when removing connection timeout handler

The source should only be removed once as it can cause the following
warning:

GLib-CRITICAL **: g_source_remove: assertion `tag > 0' failed

12 years agonetwork: Remove sessions from server on DBus call Unregister
Tomasz Bursztyka [Tue, 21 Aug 2012 10:45:55 +0000 (13:45 +0300)]
network: Remove sessions from server on DBus call Unregister

12 years agonetwork: Kill underlying session's connection before freeing it
Tomasz Bursztyka [Tue, 21 Aug 2012 10:45:54 +0000 (13:45 +0300)]
network: Kill underlying session's connection before freeing it

12 years agonetwork: Release session's interface from bridge when unregistering
Tomasz Bursztyka [Tue, 21 Aug 2012 10:45:53 +0000 (13:45 +0300)]
network: Release session's interface from bridge when unregistering

12 years agonetwork: Add helper function to remove an interface from a bridge
Tomasz Bursztyka [Tue, 21 Aug 2012 10:45:52 +0000 (13:45 +0300)]
network: Add helper function to remove an interface from a bridge

12 years agonetwork: Keep track of session's interface name in server
Tomasz Bursztyka [Tue, 21 Aug 2012 10:45:51 +0000 (13:45 +0300)]
network: Keep track of session's interface name in server

12 years agogatt: GAP and GATT services are mandatory
Claudio Takahasi [Wed, 22 Aug 2012 19:38:49 +0000 (16:38 -0300)]
gatt: GAP and GATT services are mandatory

This patch fixes potential segmentation fault if the remote doesn't
support GAP and GATT services.

12 years agogatt: Don't raise error if declaration was found
Claudio Takahasi [Mon, 20 Aug 2012 17:32:22 +0000 (14:32 -0300)]
gatt: Don't raise error if declaration was found

This patch avoids raising errors to the upper layer if at least one
characteristic declaration has been found. According to the Core SPEC
Characteristic declarations shall be read without authentication or
authorization.

12 years agogatt: Return not found if characteritics is empty
Claudio Takahasi [Mon, 20 Aug 2012 17:32:21 +0000 (14:32 -0300)]
gatt: Return not found if characteritics is empty

This patch changes the behaviour of Discover All Characteristics and
Discover Characteristics by UUID returning <<Attribute Not Found>> when
Characteristic list that matches the defined criteria is empty. This
scenario can happen when the GATT client avoids extra iteraction with
the remote attribute server if the last received handle(or handle + 1)
is equal to the end handle of the primary service.

12 years agoatt: Replace ATT magic number
Claudio Takahasi [Mon, 20 Aug 2012 17:32:20 +0000 (14:32 -0300)]
att: Replace ATT magic number

This patch replaces the magic number used in Find Information Response
Format field by a proper declared constant.

12 years agoatt: Add Find Info Response Format constants
Claudio Takahasi [Mon, 20 Aug 2012 17:32:19 +0000 (14:32 -0300)]
att: Add Find Info Response Format constants

This patch adds constants declarations for Find Information Response
Format field. The format means that information data constains a list
of 1 or more handles with their 16-bit or 128-bit Bluetooth UUIDs

12 years agogatt: Add MTU exchange procedure
Claudio Takahasi [Mon, 20 Aug 2012 17:22:55 +0000 (14:22 -0300)]
gatt: Add MTU exchange procedure

GATT Exchange MTU is a procedure defined by the Generic Attribute
Profile, it is not related to the remote GATT primary service. However,
gatt plugin is the most suitable place to manage this procedure.

12 years agocore: Rename services_changed to uuids_changed
Claudio Takahasi [Mon, 20 Aug 2012 17:22:54 +0000 (14:22 -0300)]
core: Rename services_changed to uuids_changed

This patch renames the services_changed function to uuids_changed to
avoid misinterpretation. "Service Changed" expression is used to refer
to a GATT operation used to notify clients that a given attribute range
in the GATT server is not valid anymore.

12 years agogatt: Primary service interval may not change
Claudio Takahasi [Mon, 20 Aug 2012 17:22:53 +0000 (14:22 -0300)]
gatt: Primary service interval may not change

This patch address the "Service Changed" scenario on which the start
and end Primary Service attribute handle interval doesn't change.

12 years agocore: Add updating GATT services
Claudio Takahasi [Mon, 20 Aug 2012 17:22:52 +0000 (14:22 -0300)]
core: Add updating GATT services

This patch adds the functions to manage Profiles added, and removed
after a Discover All Primary Services procedure.

12 years agocore: Rename update_services
Claudio Takahasi [Mon, 20 Aug 2012 17:22:51 +0000 (14:22 -0300)]
core: Rename update_services

This patch renames update_services functions to avoid clashing with GATT
based services.

12 years agogatt: Start Discover Services when handle changes
Claudio Takahasi [Mon, 20 Aug 2012 17:22:50 +0000 (14:22 -0300)]
gatt: Start Discover Services when handle changes

This patch starts the Discover All Primary services when a Service
Changed indication is received or the Service Changed characteristic
value is read.

12 years agogatt: Confirm the indication received
Claudio Takahasi [Mon, 20 Aug 2012 17:22:49 +0000 (14:22 -0300)]
gatt: Confirm the indication received

This patch adds the ATT command reply for the Service Changed
indication value received.

12 years agogatt: Enable indication for Service Changed
Claudio Takahasi [Mon, 20 Aug 2012 17:22:48 +0000 (14:22 -0300)]
gatt: Enable indication for Service Changed

This patch enables indication of the Service Changed characteristic
setting the indication bit in the Client Characteristic Configuration
descriptor.

12 years agogatt: Add Service Changed CCC discovery
Claudio Takahasi [Mon, 20 Aug 2012 17:22:47 +0000 (14:22 -0300)]
gatt: Add Service Changed CCC discovery

This patch adds the Client Characteristic discovery of the Service
Changed Changed characteristic.

12 years agogatt: Add Service Changed read
Claudio Takahasi [Mon, 20 Aug 2012 17:22:46 +0000 (14:22 -0300)]
gatt: Add Service Changed read

This patch implements the Service Changed GATT charateristic value read.
Force reading the value is necessary while Service Changed value handle
is not stored. Indication can be lost since it is the first data sent
from the GATT server when the connection is established, and the client
may not be filtering the ATT indications.

12 years agogatt: Map Appearance value 0x0000 to "unknown"
Claudio Takahasi [Fri, 17 Aug 2012 14:43:31 +0000 (11:43 -0300)]
gatt: Map Appearance value 0x0000 to "unknown"

According to Bluetooth SIG Assigned numbers, Appearance characteristic
value 0x0000 is designated to "unknown".

12 years agocore: Add storing Appearance
Claudio Takahasi [Fri, 17 Aug 2012 14:43:30 +0000 (11:43 -0300)]
core: Add storing Appearance

This patch stores the Appearance characteristic value read from the
remote GAP service.

12 years agocore: PropertyChanged signal for Icon/Appearance
Claudio Takahasi [Fri, 17 Aug 2012 14:43:29 +0000 (11:43 -0300)]
core: PropertyChanged signal for Icon/Appearance

This patch emits the PropertyChanged signal in the Device hierarchy when
the remote device Appearance characteristic is read. In general
Appearance is a static value, if the device doesn't expose the
Appearance value in the advertising data, the GAP plugin should read the
value using GATT read procedure.

12 years agocore: PropertyChanged signal for Icon/class
Claudio Takahasi [Fri, 17 Aug 2012 14:43:28 +0000 (11:43 -0300)]
core: PropertyChanged signal for Icon/class

This patch emits the PropertyChanged signal in the Device hierarchy when
the remote device class is updated.