platform/upstream/neard.git
11 years agondef: Fix error message in near_ndef_prepare_handover_record
Szymon Janc [Fri, 4 Jan 2013 15:10:36 +0000 (16:10 +0100)]
ndef: Fix error message in near_ndef_prepare_handover_record

This function is used to create both Hs and Hr records.

11 years agosnep: Check ndef length before applying Android workaround
Szymon Janc [Wed, 23 Jan 2013 07:50:46 +0000 (08:50 +0100)]
snep: Check ndef length before applying Android workaround

With crafted NDEF message data outside of buffer could be read from
and write to. Potentially leading to segmentation fault or some other
undefined behaviour.

11 years agondef: Fix checking for error in parse_mime_type
Szymon Janc [Fri, 4 Jan 2013 15:10:34 +0000 (16:10 +0100)]
ndef: Fix checking for error in parse_mime_type

Upper layer don't know if action will be held or not when providing
ndef_message for reply. It is possible that reply was provided but
not used and this is not always an error

11 years agondef: Remove not needed AC payload creation in build_ho_record
Szymon Janc [Fri, 4 Jan 2013 15:10:33 +0000 (16:10 +0100)]
ndef: Remove not needed AC payload creation in build_ho_record

It was not used to create ndef message as AC recors is created inside
near_ndef_prepare_handover_record based on response from HO agent.

11 years agondef: Use stack variable for record in build_ho_record
Szymon Janc [Fri, 4 Jan 2013 15:10:32 +0000 (16:10 +0100)]
ndef: Use stack variable for record in build_ho_record

There is no need to dynamically allocate record as it is not used
after build_ho_record returns.

11 years agondef: Fix memory leak in build_ho_record
Szymon Janc [Fri, 4 Jan 2013 15:10:31 +0000 (16:10 +0100)]
ndef: Fix memory leak in build_ho_record

record data needs to be freed before returning ndef.

144 (80 direct, 64 indirect) bytes in 1 blocks are definitely lost in loss record 142 of 190
   at 0x4C2B6CD: malloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
   by 0x4E7FBFD: g_try_malloc0 (in /lib/x86_64-linux-gnu/libglib-2.0.so.0.3200.3)
   by 0x424477: __ndef_build_from_message (ndef.c:2950)
   by 0x41CEE3: push_ndef (device.c:276)
   by 0x40B850: process_message.isra.4 (object.c:285)
   by 0x5143C40: ??? (in /lib/x86_64-linux-gnu/libdbus-1.so.3.5.8)
   by 0x5135B0F: dbus_connection_dispatch (in /lib/x86_64-linux-gnu/libdbus-1.so.3.5.8)
   by 0x409247: message_dispatch (mainloop.c:76)
   by 0x4E7A91A: ??? (in /lib/x86_64-linux-gnu/libglib-2.0.so.0.3200.3)
   by 0x4E79D52: g_main_context_dispatch (in /lib/x86_64-linux-gnu/libglib-2.0.so.0.3200.3)
   by 0x4E7A09F: ??? (in /lib/x86_64-linux-gnu/libglib-2.0.so.0.3200.3)
   by 0x4E7A499: g_main_loop_run (in /lib/x86_64-linux-gnu/libglib-2.0.so.0.3200.3)

11 years agobluetooth: Track adapter properties changes
Szymon Janc [Fri, 4 Jan 2013 15:10:30 +0000 (16:10 +0100)]
bluetooth: Track adapter properties changes

Watch for PropertyChanged signal to keep track of changed properties.
Only properties used for EIR creation are tracked (name, cod, powered).

11 years agotest: Add 'State' support for handover-agent
Szymon Janc [Fri, 4 Jan 2013 15:10:29 +0000 (16:10 +0100)]
test: Add 'State' support for handover-agent

This allows to pass power state hint with handover-agent.

11 years agondef: Prepare ac record with proper BT power state
Szymon Janc [Fri, 4 Jan 2013 15:10:28 +0000 (16:10 +0100)]
ndef: Prepare ac record with proper BT power state

When adding AC record for BT handover user state provided in bt_data
to properly indicate BT carrier power state.

11 years agoagent: Set carrier power state from hint in parse_reply
Szymon Janc [Fri, 4 Jan 2013 15:10:27 +0000 (16:10 +0100)]
agent: Set carrier power state from hint in parse_reply

Set carrier power state in struct bt_data if HO agent provided power
state hint in RequestOOB reply.

11 years agoagent: Set carrier power state hint in prepare_bt_data
Szymon Janc [Fri, 4 Jan 2013 15:10:26 +0000 (16:10 +0100)]
agent: Set carrier power state hint in prepare_bt_data

If alternative carrier is power state is known add it to dictionary.

11 years agoAdd carrier power state to struct bt_data
Szymon Janc [Fri, 4 Jan 2013 15:10:25 +0000 (16:10 +0100)]
Add carrier power state to struct bt_data

Add state to bt_data and set it according to power state received in
Hs/Hr messages.

11 years agondef: Validate CPS when parsing AC record
Szymon Janc [Fri, 4 Jan 2013 15:10:24 +0000 (16:10 +0100)]
ndef: Validate CPS when parsing AC record

CPS is 2-bit field so mask out reserved bits from first byte of AC
record.

11 years agondef: Move carrier_power_state definition to header file
Szymon Janc [Fri, 4 Jan 2013 15:10:23 +0000 (16:10 +0100)]
ndef: Move carrier_power_state definition to header file

It will be also used by handover agent implementation

11 years agodoc: Remove not really needed errors from Handover Agent API
Szymon Janc [Fri, 4 Jan 2013 15:10:22 +0000 (16:10 +0100)]
doc: Remove not really needed errors from Handover Agent API

Only InProgress error is really usefull as in such case neard could
retry operation. Other errors don't give any useful information
comparing to simply returning Failed with proper error message.

11 years agodoc: Add 'State' field to handover agent API
Szymon Janc [Fri, 4 Jan 2013 15:10:21 +0000 (16:10 +0100)]
doc: Add 'State' field to handover agent API

This will allow both agent and neard to be informed about power state
of carrier. It is up to agent to decide what to do with information
provided e.g. in case of 'activating' state it could delay connection
attempt. This will also allow to properly set Carrier Power State in
ac record.

11 years agogdbus: Check for valid path before handling properties
Marcel Holtmann [Mon, 21 Jan 2013 02:25:12 +0000 (18:25 -0800)]
gdbus: Check for valid path before handling properties

11 years agobuild: Add unit tests during distribution building
Marcel Holtmann [Tue, 15 Jan 2013 23:51:41 +0000 (15:51 -0800)]
build: Add unit tests during distribution building

11 years agounit: Fix includes for build testing
Marcel Holtmann [Tue, 15 Jan 2013 23:51:23 +0000 (15:51 -0800)]
unit: Fix includes for build testing

11 years agobuild: Header files are also part of the build material
Marcel Holtmann [Tue, 15 Jan 2013 23:49:15 +0000 (15:49 -0800)]
build: Header files are also part of the build material

11 years agobuild: Add unit/test-ndef to .gitignore list
Marcel Holtmann [Tue, 15 Jan 2013 23:40:08 +0000 (15:40 -0800)]
build: Add unit/test-ndef to .gitignore list

11 years agobuild: Include unit test in make check run
Marcel Holtmann [Tue, 15 Jan 2013 23:39:27 +0000 (15:39 -0800)]
build: Include unit test in make check run

11 years agounit: Hide all g_print statements behind g_test_verbose switch
Marcel Holtmann [Tue, 15 Jan 2013 23:35:31 +0000 (15:35 -0800)]
unit: Hide all g_print statements behind g_test_verbose switch

11 years agoRelease 0.9 0.9
Samuel Ortiz [Fri, 11 Jan 2013 16:29:32 +0000 (17:29 +0100)]
Release 0.9

11 years agobuild: Do not use deprecated AM_CONFIG_HEADER
Lucas De Marchi [Thu, 10 Jan 2013 15:18:14 +0000 (13:18 -0200)]
build: Do not use deprecated AM_CONFIG_HEADER

The long-obsoleted AM_CONFIG_HEADER macro was removed in automake 1.13.
Use AC_CONFIG_HEADERS instead.

11 years agobuild: Use AM_CPPFLAGS instead of INCLUDES
Lucas De Marchi [Thu, 10 Jan 2013 15:18:13 +0000 (13:18 -0200)]
build: Use AM_CPPFLAGS instead of INCLUDES

Makefile.am:50: warning: 'INCLUDES' is the old name for 'AM_CPPFLAGS' (or '*_CPPFLAGS')

11 years agotypes: Fix build error due to unaligned memory access
Olivier Guiter [Wed, 9 Jan 2013 12:42:37 +0000 (13:42 +0100)]
types: Fix build error due to unaligned memory access

This fix number of build error on architectures that can't handle
unaligned memory access (eg. ARM).

Most of the code was originally written in BlueZ's bluetooth.h.

11 years agosnep: SNEP validation test server implementation
Olivier Guiter [Wed, 9 Jan 2013 14:15:12 +0000 (15:15 +0100)]
snep: SNEP validation test server implementation

NFC forum defined a SNEP Validation specification. This set of patches
makes neard to pass all the SNEP test cases, providing a SNEP validation
server as a default one.

11 years agosnep: Separate snep default server code from snep core
Olivier Guiter [Wed, 9 Jan 2013 14:15:11 +0000 (15:15 +0100)]
snep: Separate snep default server code from snep core

In order to introduce the SNEP Validation server, we separate core
functions from snep default server code. This split leads to factorize
some parts of the process.
This code also improves the SNEP fragmentation code, more specifically
in snep_core_response_with_info.

11 years agondef: Add records comparison helpers
Olivier Guiter [Wed, 9 Jan 2013 14:15:10 +0000 (15:15 +0100)]
ndef: Add records comparison helpers

These functions propose to check ndef records for specific fields
like mime type or ID field in record header.

11 years agounit: Add Title and URI records SmartPoster NDEF unit test
Samuel Ortiz [Wed, 9 Jan 2013 11:10:57 +0000 (12:10 +0100)]
unit: Add Title and URI records SmartPoster NDEF unit test

11 years agounit: URI NDEF test should check for the field length
Samuel Ortiz [Wed, 9 Jan 2013 10:36:20 +0000 (11:36 +0100)]
unit: URI NDEF test should check for the field length

11 years agounit: Add single record SmartPoster NDEF unit test
Samuel Ortiz [Wed, 9 Jan 2013 10:34:58 +0000 (11:34 +0100)]
unit: Add single record SmartPoster NDEF unit test

11 years agounit: Add Text NDEF record unit test
Samuel Ortiz [Wed, 9 Jan 2013 09:56:22 +0000 (10:56 +0100)]
unit: Add Text NDEF record unit test

11 years agounit: Add test-ndef unit test
Samuel Ortiz [Tue, 8 Jan 2013 23:49:38 +0000 (00:49 +0100)]
unit: Add test-ndef unit test

test-ndef checks for the URI record parsing validity.

11 years agotest: Remove the NDEF argument from ndef-agent
Samuel Ortiz [Tue, 8 Jan 2013 23:45:49 +0000 (00:45 +0100)]
test: Remove the NDEF argument from ndef-agent

Since ndef-agent won't implement the handover agent API, no need to
specify the NDEF argument.

11 years agotest: Rename simple-agent to ndef-agent
Samuel Ortiz [Tue, 8 Jan 2013 18:36:32 +0000 (19:36 +0100)]
test: Rename simple-agent to ndef-agent

11 years agonfctool: Fix build failure with libnl v1
Samuel Ortiz [Tue, 8 Jan 2013 15:12:13 +0000 (16:12 +0100)]
nfctool: Fix build failure with libnl v1

With libnl v1 neard fails to build with:

tools/nfctool/netlink.c: In function ‘nl_send_msg’:
tools/nfctool/netlink.c:135:2: error: passing argument 1 of
‘nl_send_auto_complete’ from incompatible pointer type [-Werror]
/usr/include/netlink/netlink.h:48:14: note: expected ‘struct nl_handle *’ but
argument is of type ‘struct nl_sock *’
tools/nfctool/netlink.c:153:3: error: passing argument 1 of ‘nl_recvmsgs’ from
incompatible pointer type [-Werror]
/usr/include/netlink/netlink.h:58:14: note: expected ‘struct nl_handle *’ but
argument is of type ‘struct nl_sock *’
tools/nfctool/netlink.c: In function ‘nl_get_multicast_id’:
tools/nfctool/netlink.c:212:2: error: passing argument 1 of
‘genl_ctrl_resolve’ from incompatible pointer type [-Werror]
/usr/include/netlink/genl/ctrl.h:29:14: note: expected ‘struct nl_handle *’
but argument is of type ‘struct nl_sock *’
[...]

Adding the regular compatibility layer fixes it.

11 years agoadapter: Fix memory leaks on adapter free
Szymon Janc [Fri, 30 Nov 2012 09:40:45 +0000 (10:40 +0100)]
adapter: Fix memory leaks on adapter free

Destroy hash tables when removing adapter.

184 (88 direct, 96 indirect) bytes in 1 blocks are definitely lost in loss record 132 of 156
   at 0x4C2B6CD: malloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
   by 0x4E7FA78: g_malloc (in /lib/x86_64-linux-gnu/libglib-2.0.so.0.3200.3)
   by 0x4E92CA2: g_slice_alloc (in /lib/x86_64-linux-gnu/libglib-2.0.so.0.3200.3)
   by 0x4E69A02: g_hash_table_new_full (in /lib/x86_64-linux-gnu/libglib-2.0.so.0.3200.3)
   by 0x418AD7: __near_adapter_create (adapter.c:613)
   by 0x41790F: __near_manager_adapter_add (manager.c:79)
   by 0x41D1CB: get_devices_handler (netlink.c:173)
   by 0x579A4A9: nl_recvmsgs (in /lib/libnl-3.so.200.3.0)
   by 0x41C562: nl_send_msg (netlink.c:136)
   by 0x41D38A: __near_netlink_get_adapters (netlink.c:200)
   by 0x4084F1: main (main.c:210)

184 (88 direct, 96 indirect) bytes in 1 blocks are definitely lost in loss record 133 of 156
   at 0x4C2B6CD: malloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
   by 0x4E7FA78: g_malloc (in /lib/x86_64-linux-gnu/libglib-2.0.so.0.3200.3)
   by 0x4E92CA2: g_slice_alloc (in /lib/x86_64-linux-gnu/libglib-2.0.so.0.3200.3)
   by 0x4E69A02: g_hash_table_new_full (in /lib/x86_64-linux-gnu/libglib-2.0.so.0.3200.3)
   by 0x418AF8: __near_adapter_create (adapter.c:617)
   by 0x41790F: __near_manager_adapter_add (manager.c:79)
   by 0x41D1CB: get_devices_handler (netlink.c:173)
   by 0x579A4A9: nl_recvmsgs (in /lib/libnl-3.so.200.3.0)
   by 0x41C562: nl_send_msg (netlink.c:136)
   by 0x41D38A: __near_netlink_get_adapters (netlink.c:200)
   by 0x4084F1: main (main.c:210)

11 years agogdbus: Fix memory leak on properties_set()
Anderson Lizardo [Sun, 6 Jan 2013 00:47:46 +0000 (20:47 -0400)]
gdbus: Fix memory leak on properties_set()

The pointer returned by dbus_message_iter_get_signature() must be freed
with dbus_free().

Fixes this memory leak:

==1857== 16 bytes in 1 blocks are definitely lost in loss record 104 of
251
==1857==    at 0x402BF52: realloc (in
/usr/lib/valgrind/vgpreload_memcheck-x86-linux.so)
==1857==    by 0x415E286: dbus_realloc (in
/lib/i386-linux-gnu/libdbus-1.so.3.5.8)
==1857==    by 0x415E70B: ??? (in
/lib/i386-linux-gnu/libdbus-1.so.3.5.8)
==1857==    by 0x415F17B: ??? (in
/lib/i386-linux-gnu/libdbus-1.so.3.5.8)
==1857==    by 0x414CB33: dbus_message_iter_get_signature (in
/lib/i386-linux-gnu/libdbus-1.so.3.5.8)
==1857==    by 0x8053239: properties_set (object.c:899)
==1857==    by 0x5FFFFF: ???
==1857==

11 years agoneard: nfctool: Add LLCP frame decoding support
Thierry Escande [Fri, 14 Dec 2012 14:34:01 +0000 (15:34 +0100)]
neard: nfctool: Add LLCP frame decoding support

nfctool now dumps LLCP frames in a human readable manner

11 years agoneard: nfctool: Add LLCP traffic sniffing feature
Thierry Escande [Fri, 14 Dec 2012 14:34:00 +0000 (15:34 +0100)]
neard: nfctool: Add LLCP traffic sniffing feature

nfctool -d nfcX --sniffer
This dumps LLCP frames to stdout (Hex+ASCII display)

nfctool -d nfcX --sniffer --pcap-file FILENAME
This saves LLCP frames in pcap format to file FILENAME. This pcap file
can be opened in wireshark (v>=1.8.2) with the wireshark-nfc plugin
available at http://code.google.com/p/wireshark-nfc/

11 years agoneard: nfctool: Add an option to set LTO, RW, and MIUX parameters
Thierry Escande [Fri, 14 Dec 2012 14:33:59 +0000 (15:33 +0100)]
neard: nfctool: Add an option to set LTO, RW, and MIUX parameters

nfctool --device nfcX --set-param lto=x,rw=y,miux=z
This sets one or more of the LTO, RW, or MIUX parameters for device nfcX

11 years agoneard: nfctool: Add start_poll command
Thierry Escande [Fri, 14 Dec 2012 14:33:58 +0000 (15:33 +0100)]
neard: nfctool: Add start_poll command

nfctool --device nfcX --poll [Initiator|Target|Both]
This starts polling on device nfcX as initiator, target, or both.

11 years agoneard: Add nfctool native application
Thierry Escande [Fri, 14 Dec 2012 14:33:57 +0000 (15:33 +0100)]
neard: Add nfctool native application

nfctool is a native application used as a tool box for various nfc related
operations. First goal is to be able to do such operations on embedded
platforms that don't have a python interpretor (since all neard test tools
are pyhton scripts)

This initial release can list nfc adapters, targets, etc.

11 years agoAUTHORS: Mention Christophe's contributions
Samuel Ortiz [Thu, 13 Dec 2012 12:19:02 +0000 (13:19 +0100)]
AUTHORS: Mention Christophe's contributions

11 years agotest: Support writing SMS and e-mail address to a tag
Christophe Prigent [Wed, 12 Dec 2012 16:14:59 +0000 (17:14 +0100)]
test: Support writing SMS and e-mail address to a tag

11 years agogdbus: Check signature of property value before calling setter
Marcel Holtmann [Sat, 5 Jan 2013 04:28:07 +0000 (20:28 -0800)]
gdbus: Check signature of property value before calling setter

11 years agogdbus: Don't include just added interfaces in GetManagedObjects
Lucas De Marchi [Fri, 4 Jan 2013 03:33:44 +0000 (01:33 -0200)]
gdbus: Don't include just added interfaces in GetManagedObjects

If we received a call to ObjectManager.GetManagedObject we should not
include in the response the interfaces in data->added. This is because
it's not guaranteed that those interfaces will trigger an
InterfacesAdded signal, which is the case if the interface is removed in
the same mainloop iteration.

11 years agogdbus: Simplify generated introspection
Lucas De Marchi [Fri, 4 Jan 2013 01:21:04 +0000 (23:21 -0200)]
gdbus: Simplify generated introspection

The generated introspection is not supposed to be read as is by human,
so there's no point in printing the indentation or writing more code to
use auto-close tags.

If it's desired to read the raw xml file, user can always use other
tools to transform the output such as "xmllint --format".

This also fixes a missing </property> when property is deprecated.

11 years agogdbus: Hold client reference during get name owner reply
Marcel Holtmann [Wed, 2 Jan 2013 15:35:53 +0000 (07:35 -0800)]
gdbus: Hold client reference during get name owner reply

11 years agogdbus: Call check_signals when sending signals with g_dbus_send_message
Luiz Augusto von Dentz [Fri, 28 Dec 2012 12:51:03 +0000 (14:51 +0200)]
gdbus: Call check_signals when sending signals with g_dbus_send_message

If message passed to g_dbus_send_message is a signal verify if it is a
valid and there really exists an interface with respective signal name.

11 years agogdbus: Check if the interface being registered is valid
Luiz Augusto von Dentz [Fri, 28 Dec 2012 12:51:02 +0000 (14:51 +0200)]
gdbus: Check if the interface being registered is valid

This prevent registering interfaces that are empty or have all members
marked as experiemental.

11 years agogdbus: Introduce G_DBUS_PROPERTY_FLAG_EXPERIMENTAL
Luiz Augusto von Dentz [Fri, 28 Dec 2012 12:51:01 +0000 (14:51 +0200)]
gdbus: Introduce G_DBUS_PROPERTY_FLAG_EXPERIMENTAL

This flag can be used to mark properties as experimental, marked
properties are disabled by default and can be enabled by setting
G_DBUS_FLAG_ENABLE_EXPERIMENTAL using g_dbus_set_flags.

11 years agogdbus: Introduce G_DBUS_SIGNAL_FLAG_EXPERIMENTAL
Luiz Augusto von Dentz [Fri, 28 Dec 2012 12:51:00 +0000 (14:51 +0200)]
gdbus: Introduce G_DBUS_SIGNAL_FLAG_EXPERIMENTAL

This flag can be used to mark signals as experimental, marked
signals are disabled by default and can be enabled by setting
G_DBUS_FLAG_ENABLE_EXPERIMENTAL using g_dbus_set_flags.

11 years agogdbus: Introduce G_DBUS_METHOD_FLAG_EXPERIMENTAL
Luiz Augusto von Dentz [Fri, 28 Dec 2012 12:50:59 +0000 (14:50 +0200)]
gdbus: Introduce G_DBUS_METHOD_FLAG_EXPERIMENTAL

This flag can be used to mark methods as experimental, marked
methods are disable by default and can be enabled by setting
G_DBUS_FLAG_ENABLE_EXPERIMENTAL using g_dbus_set_flags.

11 years agogdbus: Include changed properties only once per signal
Marcel Holtmann [Sun, 30 Dec 2012 08:58:04 +0000 (00:58 -0800)]
gdbus: Include changed properties only once per signal

11 years agogdbus: Update properties on D-Bus client re-connections
Marcel Holtmann [Sat, 29 Dec 2012 21:42:51 +0000 (13:42 -0800)]
gdbus: Update properties on D-Bus client re-connections

11 years agogdbus: Add function to manually refresh properties
Marcel Holtmann [Sat, 29 Dec 2012 21:24:17 +0000 (13:24 -0800)]
gdbus: Add function to manually refresh properties

11 years agogdbus: Add support for proxy property change notifications
Marcel Holtmann [Sat, 29 Dec 2012 20:29:50 +0000 (12:29 -0800)]
gdbus: Add support for proxy property change notifications

11 years agogdbus: Fix handling of client connect/disconnect signals
Marcel Holtmann [Sat, 29 Dec 2012 20:27:33 +0000 (12:27 -0800)]
gdbus: Fix handling of client connect/disconnect signals

11 years agogdbus: Protect standalone proxy creation with client reference
Marcel Holtmann [Sat, 29 Dec 2012 19:57:05 +0000 (11:57 -0800)]
gdbus: Protect standalone proxy creation with client reference

11 years agogdbus: Use object manager only if callback functions are set
Marcel Holtmann [Fri, 28 Dec 2012 05:30:06 +0000 (21:30 -0800)]
gdbus: Use object manager only if callback functions are set

11 years agogdbus: Use client service name and not hardcoded org.bluez
Marcel Holtmann [Fri, 28 Dec 2012 05:21:16 +0000 (21:21 -0800)]
gdbus: Use client service name and not hardcoded org.bluez

11 years agogdbus: Add support for creating D-Bus proxies without object manager
Marcel Holtmann [Fri, 28 Dec 2012 05:19:31 +0000 (21:19 -0800)]
gdbus: Add support for creating D-Bus proxies without object manager

11 years agogdbus: Avoid using g_ptr_array_new_full convenience function
Marcel Holtmann [Sat, 22 Dec 2012 20:05:59 +0000 (12:05 -0800)]
gdbus: Avoid using g_ptr_array_new_full convenience function

The g_ptr_array_new_full function only got introduced with GLib 2.30
and to avoid requiring a newer GLib use g_ptr_array_set_free_func instead.

11 years agobuild: Compile support for new D-Bus client helpers
Marcel Holtmann [Wed, 19 Dec 2012 02:46:18 +0000 (03:46 +0100)]
build: Compile support for new D-Bus client helpers

11 years agogdbus: Increase the method call timeout to 5 minutes
Marcel Holtmann [Tue, 18 Dec 2012 04:27:09 +0000 (05:27 +0100)]
gdbus: Increase the method call timeout to 5 minutes

11 years agogdbus: Add helper for sending async error replies
Marcel Holtmann [Tue, 18 Dec 2012 04:09:59 +0000 (05:09 +0100)]
gdbus: Add helper for sending async error replies

11 years agogdbus: Fix race condition with creating duplicate client proxies
Marcel Holtmann [Sun, 16 Dec 2012 00:16:28 +0000 (01:16 +0100)]
gdbus: Fix race condition with creating duplicate client proxies

11 years agogdbus: Fix issue with unref of client while parsing interfaces
Marcel Holtmann [Sun, 16 Dec 2012 00:06:33 +0000 (01:06 +0100)]
gdbus: Fix issue with unref of client while parsing interfaces

11 years agogdbus: Fix issue with unref of client in connect handler
Marcel Holtmann [Sat, 15 Dec 2012 22:34:51 +0000 (23:34 +0100)]
gdbus: Fix issue with unref of client in connect handler

11 years agogdbus: Add support for D-Bus client method calls
Marcel Holtmann [Sat, 15 Dec 2012 00:50:58 +0000 (01:50 +0100)]
gdbus: Add support for D-Bus client method calls

11 years agogdbus: Add callback support for handling property changes
Marcel Holtmann [Fri, 14 Dec 2012 18:48:06 +0000 (19:48 +0100)]
gdbus: Add callback support for handling property changes

11 years agogdbus: Handle property changed signals and update property
Marcel Holtmann [Fri, 14 Dec 2012 18:16:59 +0000 (19:16 +0100)]
gdbus: Handle property changed signals and update property

11 years agogdbus: Set property changed filter match rule for each proxy
Marcel Holtmann [Fri, 14 Dec 2012 17:48:18 +0000 (18:48 +0100)]
gdbus: Set property changed filter match rule for each proxy

11 years agogdbus: Use a GPtrArray for the match rules
Marcel Holtmann [Fri, 14 Dec 2012 17:23:39 +0000 (18:23 +0100)]
gdbus: Use a GPtrArray for the match rules

11 years agogdbus: Add support for setting D-Bus client basic properties
Marcel Holtmann [Fri, 14 Dec 2012 14:19:53 +0000 (15:19 +0100)]
gdbus: Add support for setting D-Bus client basic properties

11 years agogdbus: Deep copy of variants also requires a signature
Marcel Holtmann [Fri, 14 Dec 2012 14:07:36 +0000 (15:07 +0100)]
gdbus: Deep copy of variants also requires a signature

11 years agogdbus: Add support for complex D-Bus client properties
Marcel Holtmann [Thu, 13 Dec 2012 16:14:33 +0000 (17:14 +0100)]
gdbus: Add support for complex D-Bus client properties

11 years agogdbus: Add support for D-Bus client properties
Marcel Holtmann [Thu, 13 Dec 2012 13:06:25 +0000 (14:06 +0100)]
gdbus: Add support for D-Bus client properties

11 years agogdbus: Add support for D-Bus client proxies
Marcel Holtmann [Thu, 13 Dec 2012 01:38:53 +0000 (02:38 +0100)]
gdbus: Add support for D-Bus client proxies

11 years agogdbus: Add helper functions for simple D-Bus clients
Marcel Holtmann [Wed, 12 Dec 2012 20:58:57 +0000 (21:58 +0100)]
gdbus: Add helper functions for simple D-Bus clients

11 years agop2p: Make p2p_push more robust
Samuel Ortiz [Mon, 10 Dec 2012 16:46:18 +0000 (17:46 +0100)]
p2p: Make p2p_push more robust

Some devices do not provide neither SNEP nor NPP, or only NPP.
For those we need to check the fallback service name and the push op
existence.

11 years agobluetooth: Remove not needed forward declaration
Szymon Janc [Wed, 28 Nov 2012 14:08:42 +0000 (15:08 +0100)]
bluetooth: Remove not needed forward declaration

bt_do_pairing is not used before it is defined so there is no need to
forward declare it.

11 years agotest: Add handover_agent for testing
Szymon Janc [Wed, 28 Nov 2012 13:57:46 +0000 (14:57 +0100)]
test: Add handover_agent for testing

This is a very simple implementation of handover agent useful for
testing (especially if not willing to run BlueZ 5.x). Currently
received data in PushOOB/RequestOOB is printed and reply to RequestOOB
is generated from static data.

In future this might be extended to accept some user input and more
flexible reply generation.

11 years agondef: Remove not needed NULL assignments
Szymon Janc [Wed, 28 Nov 2012 13:57:45 +0000 (14:57 +0100)]
ndef: Remove not needed NULL assignments

There is no need to NULL parameters pointers to free_*_payload functions
as those are local copies.

11 years agoFix coding style errors through the code
Szymon Janc [Wed, 28 Nov 2012 13:57:44 +0000 (14:57 +0100)]
Fix coding style errors through the code

This fix some style errors reported by checkpatch and found while
working with code.

11 years agoTODO: Update
Samuel Ortiz [Wed, 5 Dec 2012 17:26:56 +0000 (18:26 +0100)]
TODO: Update

11 years agogdbus: Add g_dbus_add_properties_watch function
Luiz Augusto von Dentz [Tue, 27 Nov 2012 12:51:20 +0000 (14:51 +0200)]
gdbus: Add g_dbus_add_properties_watch function

Convenient function to create watches for D-Bus properties.

11 years agogdbus: Don't automatically attach ObjectManager
Lucas De Marchi [Thu, 29 Nov 2012 13:19:32 +0000 (11:19 -0200)]
gdbus: Don't automatically attach ObjectManager

Let each project attach the object manager interface instead of
registering it automatically.

11 years agogdbus: Don't register DBus.Properties with no properties
Lucas De Marchi [Thu, 29 Nov 2012 13:19:31 +0000 (11:19 -0200)]
gdbus: Don't register DBus.Properties with no properties

Delay registering DBus.Properties interface until the moment there are
properties on that path. This is needed for objects that currently don't
expose any property to not export the interface.

11 years agoadapter: Update the Devices array before emitting the D-Bus signal
Samuel Ortiz [Thu, 29 Nov 2012 15:21:20 +0000 (16:21 +0100)]
adapter: Update the Devices array before emitting the D-Bus signal

11 years agoagent: Provide DBUS_TIMEOUT_USE_DEFAULT if not available
Marcel Holtmann [Mon, 26 Nov 2012 13:50:42 +0000 (14:50 +0100)]
agent: Provide DBUS_TIMEOUT_USE_DEFAULT if not available

11 years agogdbus: Remove not needed NULL pointer checks
Szymon Janc [Wed, 21 Nov 2012 10:21:03 +0000 (11:21 +0100)]
gdbus: Remove not needed NULL pointer checks

g_strdup returns NULL if argument passed is NULL and there is no need
to double check that.

11 years agogdbus: Replace leading spaces with tabs
Syam Sidhardhan [Tue, 23 Oct 2012 13:57:06 +0000 (19:27 +0530)]
gdbus: Replace leading spaces with tabs

Trivial formatting fix.

11 years agogdbus: Fix compilation error due to missing #defines
Syam Sidhardhan [Wed, 14 Nov 2012 13:07:10 +0000 (18:37 +0530)]
gdbus: Fix compilation error due to missing #defines

Since these are simple #define strings, we are defining it here
instead of upgrading to D-Bus 1.5 or later.

Log:
  CC     gdbus/object.o
gdbus/object.c: In function ‘properties_set’:
gdbus/object.c:876:7: error: ‘DBUS_ERROR_UNKNOWN_PROPERTY’ undeclared
 (first use in this function)
gdbus/object.c:876:7: note: each undeclared identifier is reported
 only once for each function it appears in
gdbus/object.c:881:6: error: ‘DBUS_ERROR_PROPERTY_READ_ONLY’
 undeclared (first use in this function)
make[1]: *** [gdbus/object.o] Error 1
make: *** [all] Error 2

11 years agogdbus: Remove connection from pending_property functions
Lucas De Marchi [Wed, 17 Oct 2012 15:14:28 +0000 (12:14 -0300)]
gdbus: Remove connection from pending_property functions

The reply to a DBus.Properties.Set() method call should go through the
same D-Bus connection. Thus remove the DBusConnection parameter from the
following functions:

    - g_dbus_pending_property_success()
    - g_dbus_pending_property_error_valist()
    - g_dbus_pending_property_error()

11 years agogdbus: Fix invalid memory access during interface removal
Johan Hedberg [Mon, 15 Oct 2012 10:21:11 +0000 (13:21 +0300)]
gdbus: Fix invalid memory access during interface removal

If an interface is removed from the root path during the same mainloop
iteration that it was added we need to check for data->added before
doing the check for data->parent == NULL in the remove_interface()
function. Otherwise the added interface doesn't get removed from the
data->added list and will result in accessing freed memory:

==337== Invalid read of size 8
==337==    at 0x4F65AFA: dbus_message_iter_append_basic (in /usr/lib64/libdbus-1.so.3.7.1)
==337==    by 0x1247B5: append_interface (object.c:556)
==337==    by 0x4C8DC5C: g_slist_foreach (gslist.c:840)
==337==    by 0x1261F7: process_changes (object.c:594)
==337==    by 0x126372: generic_unregister (object.c:997)
==337==    by 0x4F69669: ??? (in /usr/lib64/libdbus-1.so.3.7.1)
==337==    by 0x4F5CE51: dbus_connection_unregister_object_path (in /usr/lib64/libdbus-1.so.3.7.1)
==337==    by 0x125E81: object_path_unref (object.c:1236)
==337==    by 0x126136: g_dbus_unregister_interface (object.c:1361)
==337==    by 0x14CDF0: service_exit (service.c:581)
==337==    by 0x177556: plugin_cleanup (plugin.c:242)
==337==    by 0x12221F: main (main.c:559)
==337==  Address 0x5bc1550 is 0 bytes inside a block of size 56 free'd
==337==    at 0x4A079AE: free (vg_replace_malloc.c:427)
==337==    by 0x4C7850E: g_free (gmem.c:252)
==337==    by 0x125DB0: remove_interface (object.c:671)
==337==    by 0x125E3B: object_path_unref (object.c:1230)
==337==    by 0x126136: g_dbus_unregister_interface (object.c:1361)
==337==    by 0x14CDF0: service_exit (service.c:581)
==337==    by 0x177556: plugin_cleanup (plugin.c:242)
==337==    by 0x12221F: main (main.c:559)

11 years agogdbus: Add g_dbus_get_properties function
Johan Hedberg [Fri, 12 Oct 2012 08:55:37 +0000 (10:55 +0200)]
gdbus: Add g_dbus_get_properties function

This function can be used to construct custom D-Bus messages containing
the properties for a specific interface on a given path.