Commit Graph

1371 Commits

Author SHA1 Message Date
Christian Fetzer
0e85627119 obexd: Queue setpath command 2013-05-29 13:24:18 +03:00
Christian Fetzer
2883c4d173 obexd: Use process callback to queue transfers
This generalizes the existing queuing of transfers by using the
process callback of pending_request.
2013-05-29 13:24:18 +03:00
Christian Fetzer
e66eff4b46 obexd: Add session_queue
Add helper function session_queue that appends a pending_request to the
session's command queue.
2013-05-29 13:24:18 +03:00
Christian Fetzer
b79cd0b46c obexd: Add process callback to session's pending_request
This adds a process callback and a data destroy callback to the session's
pending_request structure.

This is needed as preparation of queuing all OBEX session commands.
2013-05-29 13:24:17 +03:00
Gustavo Padovan
232fa391e3 opp: Register Session interface for OPP transfers
The Session interface wasn't registered when a new transfer arrives.
2013-05-28 11:34:26 +03:00
Gustavo Padovan
4c437f5d6a session: only add Target if it exists 2013-05-28 11:34:26 +03:00
Christian Fetzer
5316ed07d5 obexd: Fix SetPath response
This fixes the issue, that failed attempts to the OBEX SetPath command
are not propagated through the D-Bus API.

Trace:

  method call sender=:1.942 -> dest=:1.934 serial=8
  path=/org/bluez/obex/client/session3;
  interface=org.bluez.obex.MessageAccess1; member=SetFolder
     string "test"
  method return sender=:1.934 -> dest=:1.942 reply_serial=8

  method call sender=:1.946 -> dest=:1.945 serial=8
  path=/org/bluez/obex/client/session0;
  interface=org.bluez.obex.MessageAccess1; member=SetFolder
     string "test"
  error sender=:1.945 -> dest=:1.946
  error_name=org.bluez.obex.Error.Failed reply_serial=8
     string "Not Found"
2013-05-23 14:34:31 -07:00
Luiz Augusto von Dentz
b5afba2181 obexd: Fix using the same prefix for client and server sessions
This avoids using the same path for different sessions which fail since
it cannot register a second time causing an unexpected error.
2013-05-10 14:56:25 +03:00
Lucas De Marchi
94862127b4 obexd: Get rid of gchar
Use plain char instead of gchar.
2013-05-02 09:03:48 +03:00
Lucas De Marchi
65878a7806 obexd: Get rid of gint
Use plain int instead of gint. In glib gint is always a typedef to int,
so it's safe to use it even for callbacks with glib.
2013-05-01 09:08:53 +03:00
Luiz Augusto von Dentz
8140306965 obexd: Fix make distcheck
../obexd/client/map.c:43:17: fatal error: sdp.h: No such file or directory
2013-04-17 17:46:55 +03:00
Christian Fetzer
4ee201a588 obexd: Read service attributes when instantiating MAP session
Parse the service attributes mas_instance_id and supported_message_types
from the transport's service attributes as soon as a connection is
established.
2013-04-17 13:43:45 +03:00
Christian Fetzer
f4bf087572 obexd: Add obc_session_get_attribute to session
This adds a obc_session_get_attribute function to the client session.
The function allows querying the session specific service attributes.
2013-04-17 13:43:45 +03:00
Christian Fetzer
cb59ec7853 obexd: Add bluetooth_getattribute to Bluetooth transport
This function makes the cached SDP attributes available for the profile
implementations.
2013-04-17 13:43:38 +03:00
Christian Fetzer
e0c744c9a8 obexd: Add getattribute to obc_transport
This adds a getattribute function pointer to obc_transport, which allows
transports to provide the session specific service attributes.
2013-04-17 13:31:05 +03:00
Christian Fetzer
e163a91514 obexd: Cache SDP record in bluetooth transport
This caches the SDP record of the active session in the Bluetooth
transport.
2013-04-17 13:31:05 +03:00
Christian Fetzer
518a51ad1d obexd: Automatically setup notification connection for MAP client
This automatically establishes the MNS connection when the MAS client
session is started and terminates the MNS connection when the MAS client
session is closed.

The MAP client controls the notification channel using the
SetNotificationRegistration function. The MSE will connect/disconnect
the MNS connection accordingly.
2013-04-10 14:56:46 +03:00
Christian Fetzer
eecf2d8c21 obexd: Enable MNS server 2013-04-10 14:51:09 +03:00
Christian Fetzer
ef4b34eb5e obexd: Add Message Notification Service (MNS) server
This implements the server role of the MAP Message Notification Service
(MNS) which is part of the MAP Client Equipment (MCE) device.

After successful registration, the MNS will receive event reports,
notifying about state changes on the server side.

Possible events are: NewMessages, DeliverySuccess, SendingSuccess,
DeliveryFailure, SendingFailure, MemoryFull, MemoryAvailable,
MessageDeleted, MessageShift
2013-04-10 14:51:09 +03:00
Lucas De Marchi
ee27640ef6 obexd: Use gcc builtin instead of g_atomic
g_atomic_* end up using G_STATIC_ASSERT, causing gcc 4.8 to yell due to
-Wunused-local-typedefs.

/usr/include/glib-2.0/glib/gmacros.h:162:53: error: typedef ‘_GStaticAssertCompileTimeAssertion_2’ locally defined but not used [-Werror=unused-local-typedefs]
 #define G_STATIC_ASSERT(expr) typedef char G_PASTE (_GStaticAssertCompileTimeAssertion_, __COUNTER__)[(expr) ? 1 : -1]

Most of the uses of atomic operations were wrong. They were fixed as
well. If we are using atomic operations, reading the variable again
later for logging is not an option, we should use the return of the
atomic function used to fetch the variable.
2013-04-09 07:02:19 +09:00
Christian Fetzer
ed3b98a683 obexd: Handle absolute paths in obc_session_setpath
For absolute paths (that begin with '/'), obc_session_setpath gets called
twice to reset to the root folder.
This is caused by an empty first element in the folder list created by g_strsplit.

This solution sets the index to the folder array correctly and ignores
empty folder names. This fixes as well paths with double slashes.

Trace for 'SetFolder /telecom':

< ACL data: handle 21 flags 0x00 dlen 21
    L2CAP(d): cid 0x0040 len 17 [psm 3]
      RFCOMM(d): UIH: cr 1 dlci 32 pf 0 ilen 13 fcs 0xd8
        OBEX: SetPath cmd(f): len 13 flags 2 constants 0
        Connection ID (0xcb) = 17
        Name (0x01) = Unicode length 0
> HCI Event: Number of Completed Packets (0x13) plen 5
    handle 21 packets 1
> ACL data: handle 21 flags 0x02 dlen 11
    L2CAP(d): cid 0x0041 len 7 [psm 3]
      RFCOMM(d): UIH: cr 0 dlci 32 pf 0 ilen 3 fcs 0x2
        OBEX: SetPath rsp(f): status 200 len 3
< ACL data: handle 21 flags 0x00 dlen 21
    L2CAP(d): cid 0x0040 len 17 [psm 3]
      RFCOMM(d): UIH: cr 1 dlci 32 pf 0 ilen 13 fcs 0xd8
        OBEX: SetPath cmd(f): len 13 flags 2 constants 0
        Connection ID (0xcb) = 17
        Name (0x01) = Unicode length 0
> HCI Event: Number of Completed Packets (0x13) plen 5
    handle 21 packets 1
> ACL data: handle 21 flags 0x02 dlen 11
    L2CAP(d): cid 0x0041 len 7 [psm 3]
      RFCOMM(d): UIH: cr 0 dlci 32 pf 0 ilen 3 fcs 0x2
        OBEX: SetPath rsp(f): status 200 len 3
< ACL data: handle 21 flags 0x00 dlen 37
    L2CAP(d): cid 0x0040 len 33 [psm 3]
      RFCOMM(d): UIH: cr 1 dlci 32 pf 0 ilen 29 fcs 0xd8
        OBEX: SetPath cmd(f): len 29 flags 2 constants 0
        Connection ID (0xcb) = 17
        Name (0x01) = Unicode length 16
        0000: 00 74 00 65 00 6c 00 65  00 63 00 6f 00 6d 00 00  .t.e.l.e.c.o.m..
> HCI Event: Number of Completed Packets (0x13) plen 5
    handle 21 packets 1
> ACL data: handle 21 flags 0x02 dlen 11
    L2CAP(d): cid 0x0041 len 7 [psm 3]
      RFCOMM(d): UIH: cr 0 dlci 32 pf 0 ilen 3 fcs 0x2
        OBEX: SetPath rsp(f): status 200 len 3
2013-02-22 10:41:52 +02:00
Christian Fetzer
7f80320654 obexd: Remove obc_session_setpath limit
obc_session_setpath is able to handle multiple folder changes at once.
This removes the limit, that was introduced because of PBAP's limitation
to 3 levels (75d32c6b3a).

Other profiles like MAP might have deeper folder hierarchies.
2013-02-22 10:41:52 +02:00
Christian Fetzer
e859c03231 obexd: Add PushMessage
Push message has been implemented similar to send file (OPP),
the message to send (in bMessage format) is read from a file.
2013-02-07 13:49:00 +02:00
Christian Fetzer
970333272c obexd: Add parameter Status to GetMessageListing response
The parameter Status indicates the status of reception of the message.
It can be used to differentiate between messages with a reception status
of "completed", "fractioned" and "notification".

This parameter got lost when obexd was refactored to use of D-Bus properties.
The documentation and the parsing code for it was still there.
2013-01-18 13:58:50 +02:00
Christian Fetzer
41d1d89cf5 obexd: Add parameter AttachmentSize to GetMessageListing response
The parameter AttachmentSize indicates if the message contains
any attachment and their overall size (in bytes).
2013-01-18 13:58:50 +02:00
Christian Fetzer
ff52e50288 obexd: Add parameter Text to GetMessageListing response
The Text flag indicates if the message contains any textual content
or has binary content only.
2013-01-18 13:58:49 +02:00
Christian Fetzer
cb4a4de99c obexd: Move parse_size function in map.c
This reorders msg_parsers and moves the function parse_size
to match the order in the MAP specification.
2013-01-18 13:58:49 +02:00
Christian Fetzer
f9998e750f obexd: Add parameter SubjectLength to map_list_messages
This parameter allows the client to request a maximum length of the
parameter "subject" in the messages listing.
2013-01-18 13:58:42 +02:00
Christian Fetzer
363e55779d obexd: Remove transferred file only if the GET operation failed
Since 9606375649 xfer_complete() sets the
transfer status rather than the size. Adapt obc_transfer_free to check
for the completed status to avoid deletion of completed transfers.
2013-01-14 17:42:06 +02:00
Christian Fetzer
86de586204 obexd: Change behavior of parse_filter_read
Calls to ListMessages with filter 'Read' set to true should
request the MSE to send read messages only.

The old code requests the MSE to send unread messages only.
This behavior is not matching the other filters.
2013-01-14 17:42:05 +02:00
Christian Fetzer
d0b4698c8f obexd: Use defines for values in parse_filter_read parse_filter_priority 2013-01-14 17:42:05 +02:00
Christian Fetzer
499d0a4eaf obexd: Fix segfault in parse_filter_read and parse_filter_priority
Calls to ListMessages with filter 'Read' or 'Priority' caused a segfault
in parse_filter_read / parse_filter_priority. The functions read
D-Bus boolean values (uint32) into uint8.

0  0x00007ffff730332d in ?? () from /usr/lib/libdbus-1.so.3
1  0x00007ffff7304219 in dbus_message_iter_next () from /usr/lib/libdbus-1.so.3
2  0x000000000043ef0f in parse_message_filters (
    apparam=<error reading variable: Cannot access memory at address 0x7ffffeffff08>,
    iter=<error reading variable: Cannot access memory at address 0x7ffffeffff00>)
    at obexd/client/map.c:1246
2013-01-14 17:42:05 +02:00
Christian Fetzer
90322684e0 obexd: Fix FILTER_ALL in MAP client to set 16 bit
The MAP specification defines ParameterMask as a bitmask of 32 bit / 4 bytes.
For the lower 16 bit the specification defines parameters, the higher 16 bit
remain reserved for future use. Therefore FILTER_ALL is set to 0x0000FFFF.
(Reserved bits have to be set to 0)

In addition this fixes the issue that ListFilterFields didn't show all fields.
2013-01-14 17:42:04 +02:00
Christian Fetzer
a1d1ea32df obexd: Fix infinite loop in ListMessages with filter "Types"
Calls to ListMessages with filter 'Types' make obexd hang in an infinite loop.
This is caused by a missing dbus_message_iter_next in parse_filter_type.

0  0x00007ffff7304ca7 in dbus_message_iter_get_basic ()
   from /usr/lib/libdbus-1.so.3
1  0x0000000000434fba in parse_filter_type (iter=0x7fffffffd7d0, apparam=
    0x6987f0) at obexd/client/map.c:1086
2  parse_message_filters (iter=0x7fffffffd730, apparam=0x6987f0)
    at obexd/client/map.c:1222
3  map_list_messages (connection=<optimized out>, message=0x669ae0, user_data=
    0x698a60) at obexd/client/map.c:1273
4  0x00000000004109a1 in process_message (connection=0x662b20,
    message=<optimized out>, iface_user_data=<optimized out>,
    method=<optimized out>, method=<optimized out>) at gdbus/object.c:285
5  0x00007ffff7308e15 in ?? () from /usr/lib/libdbus-1.so.3
6  0x00007ffff72fb070 in dbus_connection_dispatch ()
   from /usr/lib/libdbus-1.so.3
7  0x000000000040e3d8 in message_dispatch (data=0x662b20)
    at gdbus/mainloop.c:76
8  0x00007ffff703d3cb in ?? () from /usr/lib/libglib-2.0.so.0
9  0x00007ffff703c845 in g_main_context_dispatch ()
   from /usr/lib/libglib-2.0.so.0
10 0x00007ffff703cb78 in ?? () from /usr/lib/libglib-2.0.so.0
11 0x00007ffff703cf72 in g_main_loop_run () from /usr/lib/libglib-2.0.so.0
12 0x000000000040df82 in main (argc=1, argv=0x7fffffffdd88)
    at obexd/src/main.c:323
2013-01-14 17:42:04 +02:00
Christian Fetzer
0b6a5b5068 obexd: Add property exist functions to map client
This fixes crashes in MAP client when the server does not send optional properties.

0  0x00007ffff6a792c5 in raise () from /usr/lib/libc.so.6
1  0x00007ffff6a7a748 in abort () from /usr/lib/libc.so.6
2  0x00007ffff731c145 in ?? () from /usr/lib/libdbus-1.so.3
3  0x00007ffff7312a25 in ?? () from /usr/lib/libdbus-1.so.3
4  0x00007ffff73050d6 in dbus_message_iter_append_basic () from /usr/lib/libdbus-1.so.3
5  0x0000000000433cc5 in get_replyto (property=<optimized out>, iter=<optimized out>,
    data=<optimized out>) at obexd/client/map.c:484
6  0x00000000004103b6 in append_property (p=p@entry=0x6594c0 <map_msg_properties+192>,
    dict=dict@entry=0x7fffffffd8e0, iface=0x6a3720) at gdbus/object.c:547
7  0x0000000000410472 in append_properties (data=data@entry=0x6a3720, iter=iter@entry=
    0x7fffffffd960) at gdbus/object.c:576
8  0x00000000004104d1 in append_interface (data=0x6a3720, user_data=0x7fffffffda40)
    at gdbus/object.c:591
9  0x00007ffff7058a4d in g_slist_foreach () from /usr/lib/libglib-2.0.so.0
10 0x0000000000411d05 in emit_interfaces_added (data=0x6a2ff0) at gdbus/object.c:623
11 process_changes (user_data=0x6a2ff0) at gdbus/object.c:1006
12 0x00007ffff703c845 in g_main_context_dispatch () from /usr/lib/libglib-2.0.so.0
13 0x00007ffff703cb78 in ?? () from /usr/lib/libglib-2.0.so.0
14 0x00007ffff703cf72 in g_main_loop_run () from /usr/lib/libglib-2.0.so.0
15 0x000000000040df82 in main (argc=1, argv=0x7fffffffdd88) at obexd/src/main.c:323
2013-01-14 17:42:04 +02:00
Christian Fetzer
5e358f18b1 obexd: Handle empty path name in SetPath
If the empty path is given, an empty name should be sent via OBEX.
Currently the name field is not set at all and later checks which
depend on data->index will access invalid memory regions as g_strsplit
returns NULL when an empty string is given.

0  0x000000000041a181 in g_obex_setpath (obex=obex@entry=0x662eb0, path=
    0x20 <Address 0x20 out of bounds>, func=func@entry=0x42d300 <setpath_cb>,
    user_data=user_data@entry=0x668f10, err=err@entry=0x7fffffffda08)
    at gobex/gobex.c:1397
1  0x000000000042d395 in setpath_cb (obex=0x662eb0, err=0x0, rsp=<optimized out>,
    user_data=0x668f10) at obexd/client/session.c:902
2  0x0000000000418e54 in handle_response (obex=obex@entry=0x662eb0, err=err@entry=0x0,
    rsp=rsp@entry=0x668f40) at gobex/gobex.c:948
3  0x0000000000419d7a in incoming_data (io=<optimized out>, cond=<optimized out>,
    user_data=0x662eb0) at gobex/gobex.c:1191
4  0x00007ffff703c845 in g_main_context_dispatch () from /usr/lib/libglib-2.0.so.0
5  0x00007ffff703cb78 in ?? () from /usr/lib/libglib-2.0.so.0
6  0x00007ffff703cf72 in g_main_loop_run () from /usr/lib/libglib-2.0.so.0
7  0x000000000040def2 in main (argc=1, argv=0x7fffffffdd88) at obexd/src/main.c:323
2013-01-14 17:42:03 +02:00
Marcel Holtmann
9472de3087 obexd: Don't bother with trying to handle SIGPIPE 2013-01-11 09:45:40 -08:00
Marcel Holtmann
86cd7d0886 obexd: Fix includes for uuid.h 2013-01-09 20:30:43 -08:00
Marcel Holtmann
c59ae99e67 obexd: Remove the total silly usage of gchar and replace it with char 2013-01-04 12:27:55 -08:00
Marcin Zawiejski
6a8cb20ef5 obexd: Fix crash while removing session
Crash occurs when removing a session with RemoveSession while another
session has been created but not yet registered.

Backtrace:
0  __strcmp_ssse3 () at ../sysdeps/i386/i686/multiarch/strcmp-ssse3.S:233
1  0xb758e7c3 in g_str_equal () from /lib/i386-linux-gnu/libglib-2.0.so.0
2  0x08073e56 in find_session (path=0x85c8504 "/org/bluez/obex/session0") at obexd/client/manager.c:146
3  remove_session (connection=0x85bc5e0, message=0x85bca98, user_data=0x0) at obexd/client/manager.c:216
4  0x08055f6f in process_message (connection=0x85bc5e0, message=<optimized out>, iface_user_data=0x0,
    method=<optimized out>, method=<optimized out>) at gdbus/object.c:285
5  0xb7672666 in ?? () from /lib/i386-linux-gnu/libdbus-1.so.3
6  0xb76624d7 in dbus_connection_dispatch () from /lib/i386-linux-gnu/libdbus-1.so.3
7  0x080532f8 in message_dispatch (data=0x85bc5e0) at gdbus/mainloop.c:76
8  0xb759f6bf in ?? () from /lib/i386-linux-gnu/libglib-2.0.so.0
9  0xb759e9e3 in g_main_context_dispatch () from /lib/i386-linux-gnu/libglib-2.0.so.0
10 0xb759ed80 in ?? () from /lib/i386-linux-gnu/libglib-2.0.so.0
11 0xb759f1db in g_main_loop_run () from /lib/i386-linux-gnu/libglib-2.0.so.0
12 0x08052d74 in main (argc=1, argv=0xbfb344e4) at obexd/src/main.c:323
2013-01-02 16:13:13 +02:00
Marcel Holtmann
651090b3e5 obexd: The function g_dbus_pending_property_error has no return value 2012-12-29 21:24:26 -08:00
Cristian Rodríguez
2e772c22ef obexd: Fix missing config.h includes 2012-12-23 18:59:25 -08:00
Marcel Holtmann
9ba1d688bf obexd: Move __terminated into signal handler 2012-12-23 10:16:53 -08:00
Johan Hedberg
4794363f19 obexd: Update string enumeration values to lower case 2012-12-22 18:30:05 +02:00
Anderson Lizardo
ec25822178 obexd: Simplify org.bluez.Error.InvalidArguments handling
Use a helper function to void code duplication.
2012-12-22 00:15:45 +02:00
Luiz Augusto von Dentz
fdb28673f4 obexd: Fix crash while attempting to authorize transfer
Transfer need to be registered before it is authorized because
AuthorizePush takes the transfer path and the agent may try to access
the transfer properties to figure out its details.
2012-12-21 23:26:13 +02:00
Johan Hedberg
c3f7df1042 obexd: Update Authorize call to AuthorizePush API 2012-12-21 22:20:10 +02:00
Johan Hedberg
cbf8891907 obexd: Implement Session transfer property 2012-12-21 22:03:45 +02:00
Johan Hedberg
59efeba8cb obexd: Fix session path generation in manager_unregister_session 2012-12-21 22:00:01 +02:00
Johan Hedberg
ee699dbc6a obexd: Implement Time transfer property 2012-12-21 21:53:14 +02:00
Johan Hedberg
2837514fc7 obexd: Implement Type transfer property 2012-12-21 21:42:41 +02:00
Marcel Holtmann
c72af721b9 obexd: Add a few more debug statements 2012-12-21 18:56:50 +01:00
Marcel Holtmann
0c388f5a77 obexd: There is only one daemon 2012-12-21 17:55:39 +01:00
Luiz Augusto von Dentz
405afea4a5 obexd: Add Session property to Transfer interface
This property indicates the session object path.
2012-12-21 17:06:10 +02:00
Luiz Augusto von Dentz
432dffc3d2 obexd: Remove unused code
obc_transfer_append_dbus_properties as the code now uses
g_dbus_get_properties to append transfer properties.
2012-12-21 17:06:10 +02:00
Luiz Augusto von Dentz
da068075ce obexd: Rename Progress property to Transferred 2012-12-21 14:53:42 +02:00
Luiz Augusto von Dentz
793f73091a obexd: Use term active instead of in-progress for transfer status 2012-12-21 12:47:06 +02:00
Luiz Augusto von Dentz
9606375649 obex-client: Rename org.bluez.obex.Transfer to Transfer1
Rename the interface and move it to obexd-api.txt since it now belongs
to the same daemon, in addition remove obex-client-api.txt and align with
Transfer1 API in use by the server.
2012-12-21 12:04:10 +02:00
Luiz Augusto von Dentz
57a12b2571 obex-client: Rename org.bluez.obex.MessageAccess to MessageAccess1
Rename the interface and move it to obexd-api.txt since it now belongs
to the same daemon, in addition do the same to org.bluez.obex.Message.
2012-12-21 12:04:09 +02:00
Luiz Augusto von Dentz
939cebb9f3 obex-client: Rename org.bluez.obex.Synchronization to Synchronization1
Rename the interface and move it to obexd-api.txt since it now belongs
to the same daemon.
2012-12-21 12:01:07 +02:00
Luiz Augusto von Dentz
fc09df3af5 obex-client: Rename org.bluez.obex.PhonebookAccess to PhonebookAccess1
Rename the interface and move it to obexd-api.txt since it now belongs
to the same daemon.
2012-12-21 11:59:41 +02:00
Luiz Augusto von Dentz
2dcb0e5616 obex-client: Rename org.bluez.obex.FileTransfer to org.bluez.obex.FileTransfer1
Rename the interface and move it to obexd-api.txt since it now belongs
to the same daemon.
2012-12-21 11:59:41 +02:00
Luiz Augusto von Dentz
1945cffc16 obex-client: Rename org.bluez.obex.ObjectPush to org.bluez.obex.ObjectPush1
Rename the interface and move it to obexd-api.txt since it now belongs
to the same daemon.
2012-12-21 11:59:41 +02:00
Luiz Augusto von Dentz
dc30b0deaa obex-client: Rename org.bluez.obex.Session to org.bluez.obex.Session1
Rename the interface and move it to obexd-api.txt since it now belongs
to the same daemon.
2012-12-21 11:59:41 +02:00
Luiz Augusto von Dentz
35990b8bdd obexd: Rename org.bluez.obex.Client to org.bluez.obex.Client1
Rename the interface and move it to obexd-api.txt since it now belongs
to the same daemon.
2012-12-21 11:59:41 +02:00
Luiz Augusto von Dentz
0cac99fe83 obexd: Define base path so in future it is easier to change it 2012-12-21 11:59:41 +02:00
Luiz Augusto von Dentz
a5c2b6e886 obexd: Align client and server spec of org.bluez.obex.Transfer1 2012-12-21 11:59:41 +02:00
Luiz Augusto von Dentz
6765affa2c obexd: Remove TransferStarted and TransferCompleted signals
This now handled by ObjectManager together with a new property called
Status.
2012-12-21 11:59:40 +02:00
Luiz Augusto von Dentz
84d01d66e1 obexd: Fix transfer path to include session path
Transfer path should use the session path as prefix
2012-12-21 11:59:40 +02:00
Luiz Augusto von Dentz
e62719c47b obexd: Fix session path to include manager path
Manager path is /org/bluez/obex so use it as prefix in the session path.
2012-12-21 11:59:40 +02:00
Luiz Augusto von Dentz
781d49a8e7 obexd: Rename org.bluez.obex.Session to org.bluez.obex.Session1 2012-12-21 11:59:40 +02:00
Luiz Augusto von Dentz
f170537b52 obexd: Rename org.bluez.obex.Transfer to org.bluez.obex.Transfer1 2012-12-21 11:59:40 +02:00
Luiz Augusto von Dentz
22c81fdae7 obexd: Rename org.bluez.obex.Agent to org.bluez.obex.Agent1 2012-12-21 11:59:40 +02:00
Luiz Augusto von Dentz
e3bb4f22e0 obexd: Rename Manager to AgentManager1 2012-12-21 11:59:40 +02:00
Marcel Holtmann
61c448fea1 obexd: Reorder command line options 2012-12-19 13:43:00 +01:00
Johan Hedberg
8b1c207d0f obexd: Remove unused D-Bus helper functions 2012-12-19 10:29:18 +02:00
Johan Hedberg
fb4c83061b obexd: Remove unused obex_server_find_driver function 2012-12-19 10:25:07 +02:00
Marcel Holtmann
d452870662 build: Add systemd integration for obexd 2012-12-18 22:00:01 +01:00
Marcel Holtmann
cc6cd08ee0 obexd: Use /org/bluez/obex as root path 2012-12-18 21:22:07 +01:00
Marcel Holtmann
459001327e obexd: Use a single bus name for obexd and obex-client 2012-12-18 21:19:18 +01:00
Johan Hedberg
91c50f7fa1 obexd: Merge obex-client into obexd daemon 2012-12-18 17:54:43 +02:00
Johan Hedberg
6934437fc7 obexd: Add client prefix to client manager functions
This is in preparation of merging the client into the daemon.
2012-12-18 16:03:42 +02:00
Luiz Augusto von Dentz
3eadc034c9 obex-client: Make use of g_dbus_get_properties to get transfer properties
In addition fix the reply generated by obc_transfer_create_dbus_reply to
not use a structure container instead use object, dict 'oa{sv}' as
indicated in the documentation.
2012-12-17 16:31:59 +02:00
Luiz Augusto von Dentz
27635e590b obex-client: Enable ObjectManager 2012-12-17 14:10:36 +02:00
Luiz Augusto von Dentz
e4cc2de1c7 obexd: Remove SessionCreated and SessionRemoved signals
With ObjectManager these signals no longer are necessary.
2012-12-17 14:10:34 +02:00
Luiz Augusto von Dentz
54f6035e45 obexd: Enable ObjectManager 2012-12-17 14:10:32 +02:00
Luiz Augusto von Dentz
b8972b65e5 obexd: Port session interface to use D-Bus Properties 2012-12-17 14:10:30 +02:00
Luiz Augusto von Dentz
e4f45a247b obex-client: Port transfer code to use D-Bus properties interface 2012-12-16 13:26:02 +02:00
Luiz Augusto von Dentz
6f5797da8b obex-client: Port session code to use D-Bus properties interface 2012-12-16 13:26:00 +02:00
Luiz Augusto von Dentz
82a76393fe obex-client: Port MAP module to use D-Bus properties interface 2012-12-16 13:25:57 +02:00
Luiz Augusto von Dentz
0fea59d098 build: Remove obexd usb plugin
This plugin is not longer maintained and used to work only in meego
times.
2012-12-13 14:23:59 +02:00
Marcel Holtmann
05f9475f66 obexd: Fix build breakage from profile conversion 2012-12-12 23:21:02 +01:00
Luiz Augusto von Dentz
326376321f obex-client: Remove calls to org.bluez.Manager and org.bluez.Adapter
With BlueZ 5 this API no longer exist or have changed.
2012-12-12 14:20:12 +02:00
Luiz Augusto von Dentz
6d326f3768 irmc: Remove record details
Standart service records are already supported by bluetoothd
2012-12-12 13:57:45 +02:00
Luiz Augusto von Dentz
57c994a273 mas: Remove record details
Standart service records are already supported by bluetoothd
2012-12-12 13:57:43 +02:00
Luiz Augusto von Dentz
df56abd1e9 pbap: Remove record details
Standart service records are already supported by bluetoothd
2012-12-12 13:57:41 +02:00
Luiz Augusto von Dentz
19040c9f72 ftp: Remove record details
Standart service records are already supported by bluetoothd
2012-12-12 13:57:39 +02:00
Luiz Augusto von Dentz
9106f01fe5 opp: Remove record details
Standart service records are already supported by bluetoothd
2012-12-12 13:57:37 +02:00
Luiz Augusto von Dentz
b06089c493 obexd: Add support for custom records
Services such as pcsuite and syncml use custom records not defined by
Bluetooth SIG so they have to be registered using ServiceRecord entry.
2012-12-12 13:57:34 +02:00
Luiz Augusto von Dentz
40b2cc329c obexd: Enable support SYNC profile 2012-12-12 13:57:15 +02:00
Luiz Augusto von Dentz
1abed724ce obexd: Enable support for MAS profile 2012-12-12 13:57:13 +02:00
Luiz Augusto von Dentz
23b28ab759 obexd: Port bluetooth plugin to use external profile support
This changes obexd to use ProfileManager.RegisterProfile
2012-12-12 13:56:12 +02:00
Marcel Holtmann
3539054aa9 obexd: Don't daemonize and just toggle foreground logging 2012-12-10 23:16:49 +01:00
Johan Hedberg
b8779d2202 Revert "Ensure config.h is included by using CPPFLAGS"
This reverts commit 8a03376544.

The patch needs to be split up and the gdbus/ changes were bogus
compared to the original commit message.

Conflicts:
	Makefile.am
	Makefile.obexd
	profiles/cyclingspeed/cyclingspeed.c
	profiles/heartrate/heartrate.c
	src/error.c
2012-12-07 12:46:04 +02:00
Lucas De Marchi
0375042892 Use entire include path for gobex.h 2012-12-05 17:23:04 +02:00
Lucas De Marchi
5714b14bce Reorder btio.h includes
Let "#include <btio/btio.h>" together with other includes using '<'
rather than '"'.
2012-12-05 17:23:04 +02:00
Lucas De Marchi
49b5612042 Use the entire include path for btio.h 2012-12-05 17:23:04 +02:00
Lucas De Marchi
aa77b0bea9 Use the entire include path for gdbus.h 2012-12-05 17:23:03 +02:00
Lucas De Marchi
8a03376544 Ensure config.h is included by using CPPFLAGS
Instead of trying to include config.h in each file over the tree and
possibly forgetting to include it, give a "-include config.h" argument
to the compiler so it's guaranteed that a) it will be included for all
source files and b) it will be the first header included.

gdbus/ directory is left out, since it would break other projects using
it.
2012-12-05 17:18:07 +02:00
Marcel Holtmann
41aa85d123 build: Compile obexd and obex-client 2012-12-04 23:38:48 +01:00
Luiz Augusto von Dentz
ff3d8766b7 obexd: Fix using BtIOType 2012-12-04 22:49:06 +01:00
Luiz Augusto von Dentz
cdfaf26ea9 obexd: Fix using BtIOType 2012-12-04 22:49:06 +01:00
Sunil Kumar Behera
ab156cd3c5 obexd: Add get_next_header() in message listing
In case of message listing we need to send application
parameters in response and also it is required for sending
response to message listing size request.
2012-12-04 22:49:06 +01:00
Sunil Kumar Behera
2ee7238d8f obexd: Reset ap_sent variable
For multiple subsequent request for message listing
we need to reset this variable to FALSE, so that each
time the get next header function is executed properly.
2012-12-04 22:49:06 +01:00
Luiz Augusto von Dentz
f3eeb2c93f obexd: Fix sending absolute path
As per OBEX spec the NAME header should not contain absolute paths
2012-12-04 22:49:06 +01:00
Luiz Augusto von Dentz
1f4a67568c obexd: Fix returning empty if messages was already listed
Once a message was already listed and inserted on the cache it could
not be listed again as the code was using the wrong key to lookup for
found messages then once we try to create the message again it fails
as the object already exists.
2012-12-04 22:49:06 +01:00
Luiz Augusto von Dentz
33b0aeda71 obexd: Fix freeing apparam data on PBAP module
Invalid read of size 8
   at 0x40EC04: g_obex_apparam_free (gobex-apparam.c:362)
   by 0x41A66A: obc_transfer_free (transfer.c:272)
   by 0x413221: pending_request_free (session.c:163)
   by 0x413659: session_terminate_transfer (session.c:745)
   by 0x41A53E: xfer_complete (transfer.c:518)
   by 0x41B5D7: get_xfer_progress_first (transfer.c:562)
   by 0x409750: handle_response (gobex.c:948)
   by 0x40A609: incoming_data (gobex.c:1191)
   by 0x371D047824: g_main_context_dispatch (in /usr/lib64/libglib-2.0.so.0.3200.4)
   by 0x371D047B57: ??? (in /usr/lib64/libglib-2.0.so.0.3200.4)
   by 0x371D047F51: g_main_loop_run (in /usr/lib64/libglib-2.0.so.0.3200.4)
   by 0x40542F: main (main.c:175)
 Address 0x4f64510 is 0 bytes inside a block of size 8 free'd
   at 0x4A079AE: free (vg_replace_malloc.c:427)
   by 0x371D04D50E: g_free (in /usr/lib64/libglib-2.0.so.0.3200.4)
   by 0x416060: phonebook_size_callback (pbap.c:266)
   by 0x413651: session_terminate_transfer (session.c:743)
   by 0x41A53E: xfer_complete (transfer.c:518)
   by 0x41B5D7: get_xfer_progress_first (transfer.c:562)
   by 0x409750: handle_response (gobex.c:948)
   by 0x40A609: incoming_data (gobex.c:1191)
   by 0x371D047824: g_main_context_dispatch (in /usr/lib64/libglib-2.0.so.0.3200.4)
   by 0x371D047B57: ??? (in /usr/lib64/libglib-2.0.so.0.3200.4)
   by 0x371D047F51: g_main_loop_run (in /usr/lib64/libglib-2.0.so.0.3200.4)
   by 0x40542F: main (main.c:175)
2012-12-04 22:49:06 +01:00
Luiz Augusto von Dentz
f1e88405c0 obexd: Fix not using port when it is set by the client
If the client set a channel/port the code would just ignore and attempt
to discover the service anyway.
2012-12-04 22:49:06 +01:00
Srinivasa Ragavan
d77a640090 obexd: Add implementation for UpdateInbox 2012-12-04 22:49:06 +01:00
Luiz Augusto von Dentz
ea5d38411a obexd: Fix build when using --with-messages=tracker
Commit 15b15167fb2dd82e2189cc1955def1818a7bc6a6 broke the build:

plugins/messages.c:324:42: error: unknown type name ‘messages_update_inbox_cb’
plugins/messages.c:331:5: error: unknown type name ‘messages_set_read_cb’
plugins/messages.c:337:6: error: unknown type name ‘messages_set_delete_cb’
2012-12-04 22:49:06 +01:00
Srinivasa Ragavan
920bbb3663 obexd: Add Message.SetProperty and Message.GetProperties implementation. 2012-12-04 22:49:05 +01:00
Srinivasa Ragavan
3ab485ec08 obexd: Update the file offset to the beginning after writing to the file
When the transfer file is opened in O_RDWR mode, just after the contents are
written to the file, the file offset has to be set to the beginning of the
file. If not subsequent read fails. This patch fixes this.
2012-12-04 22:49:05 +01:00
Luiz Augusto von Dentz
a103426e51 obexd: Make obc_transfer_put to accept NULL as filename
In that case contents should be valid so the modules can use
obc_transfer_put to create temporary files.
2012-12-04 22:49:05 +01:00
Luiz Augusto von Dentz
36d387af61 obexd: Avoid extra copies while passing apparam to transfer
By passing directly the reference to GObexApparam it is no longer
necessary to use intermediate buffers to pass data around.
2012-12-04 22:49:05 +01:00
Luiz Augusto von Dentz
d1db67a33b obexd: Fix not sending parameters to get message in map module
Attachment and charset are mandatory, so Message.Get now takes an
additional boolean parameter which the user application should set
if it wants the attachments to be downloaded, charset is always set
to UTF8.
2012-12-04 22:49:05 +01:00
Luiz Augusto von Dentz
7eac453589 obexd: Add MessageAccess.ListFilterFields 2012-12-04 22:49:05 +01:00
Luiz Augusto von Dentz
45779d1a57 obexd: Rename MessageAccess method GetMessagesListing to ListMessages
In addition to that add missing parsing of the filters
2012-12-04 22:49:05 +01:00
Luiz Augusto von Dentz
16d0190ea7 obexd: Rename MessageAccess method GetFolderListing to ListFolders
In addition to that add missing parsing of the filters.
2012-12-04 22:49:05 +01:00
Luiz Augusto von Dentz
0155c14fb2 obexd: Use larger timeout first packet in transfers
This align the client timeout for GET operations with g_obex_get_req_pkt
which does use 60 seconds to cover for extra interaction during the first
packet.
2012-12-04 22:49:05 +01:00
Luiz Augusto von Dentz
e24161f526 obexd: Unify callbacks for operations that only report status
This removes duplicated code.
2012-12-04 22:49:05 +01:00
Sunil Kumar Behera
9a117c332e obexd: Add set delete status function
This function will inform MAP server to modify
the delete status of a given message.
2012-12-04 22:49:05 +01:00
Sunil Kumar Behera
31ef868be5 obexd: Add set read status function
This function will inform MAP server to modify the
read status of a given message.
2012-12-04 22:49:05 +01:00
Sunil Kumar Behera
91b11b2841 obexd: Add support for MessageStatus
Add driver to support x-bt/messageStatus mimetype
2012-12-04 22:49:05 +01:00
Luiz Augusto von Dentz
f0f235584e obexd: Move common code to pull_phonebook 2012-12-04 22:49:05 +01:00
Luiz Augusto von Dentz
1dbe451cce obexd: Remove deprecated methods from PhonebookAccess
SetFormat, SetOrder, SetFilter and GetFilter methods are no longer
necessary as other methods now take them as parameters to avoid round
trips.
2012-12-04 22:49:04 +01:00
Luiz Augusto von Dentz
69048a0635 obexd: Add filters to PhonebookAccess.List and PhonebookAccess.Search
This avoid D-Bus round trips and is more aligned with what has been
proposed for MessageAccess interface.
2012-12-04 22:49:04 +01:00
Luiz Augusto von Dentz
6db2270154 obexd: Add filters to PhonebookAccess.Pull
This avoid D-Bus round trips and is more aligned with what has been
proposed for MessageAccess interface.
2012-12-04 22:49:04 +01:00
Luiz Augusto von Dentz
b3cd1f0538 obexd: Add filters to Phonebook.PullAll
This avoid D-Bus round trips and is more aligned with what has been
proposed for MessageAccess interface.
2012-12-04 22:49:04 +01:00
Srinivasa Ragavan
3b9daaaf0c obexd: Fix crash on map module
gboolean is expected to hold 0/1. But it is holding int return from
strcasecmp which crashes DBusMessage at:

_dbus_return_val_if_fail (*bool_p == 0 || *bool_p == 1, FALSE);

Trace:
0  0x00007ffff7328d95 in __GI_raise (sig=6) at raise.c:64
1  0x00007ffff732a2ab in __GI_abort () at abort.c:93
2  0x00007ffff78d0655 in _dbus_abort () at dbus-sysdeps.c:94
3  0x00007ffff78c75f1 in _dbus_warn_check_failed at dbus-internals.c:289
4  0x00007ffff78ba28b in dbus_message_iter_append_basic at dbus-message.c:2538
5  0x00000000004201c3 in append_variant at client/dbus.c:44
6  0x000000000042024e in obex_dbus_dict_append at client/dbus.c:65
7  0x000000000041dcc9 in parse_read at client/map.c:423
8  0x000000000041dfa7 in msg_element at client/map.c:518
9  0x00007ffff7b323b9 in emit_start_element at gmarkup.c:986
10 0x00007ffff7b33b44 in g_markup_parse_context_parse at gmarkup.c:1323
11 0x000000000041e1ad in message_listing_cb at client/map.c:586
12 0x000000000041744c in session_terminate_transfer client/session.c:743
13 0x00000000004174d7 in session_notify_complete at client/session.c:758
14 0x000000000041755a in transfer_complete at client/session.c:778
15 0x000000000041f57b in xfer_complete at client/transfer.c:521
16 0x000000000040efdf in transfer_complete at gobex/gobex-transfer.c:102
17 0x000000000040f418 in transfer_response at gobex/gobex-transfer.c:221
18 0x000000000040b320 in handle_response at gobex/gobex.c:948
19 0x000000000040bbc1 in incoming_data at gobex/gobex.c:1191
20 0x00007ffff7b2f94a in g_main_dispatch (context=0x62f130) at gmain.c:2515
21 g_main_context_dispatch (context=0x62f130) at gmain.c:3052
22 0x00007ffff7b2fd10 in g_main_context_iterate at gmain.c:3123
23 g_main_context_iterate at gmain.c:3060
24 0x00007ffff7b3010a in g_main_loop_run (loop=0x62e1b0) at gmain.c:3317
25 0x000000000041527d in main at client/main.c:175
2012-12-04 22:49:04 +01:00
Syam Sidhardhan
d860754d64 obexd: Remove redundant include errno.h 2012-12-04 22:49:04 +01:00
Syam Sidhardhan
139ca83753 obexd: Remove redundant include sys/stat.h 2012-12-04 22:49:04 +01:00
Sunil Kumar Behera
c00b7b2267 obexd: Add subject length parameter in GetMessageListing
Add subject length parameter to allow MAP server to
create subject as per MAP client length preference.
2012-12-04 22:49:04 +01:00
Sunil Kumar Behera
134bcbcc8d obexd: Add offset parameter decription
Add offset parameter description for
messages_get_messages_listing() function header
2012-12-04 22:49:04 +01:00
Sunil Kumar Behera
a558890eb4 obexd: Fix invalid oflag check
Change logic to check for O_WRONLY, as oflag is
created by an OR operation of O_WRONLY, O_CREAT and
O_TRUNC.
Message update is a PUT function, this check returns
bad response if GET is received.
2012-12-04 22:49:04 +01:00
Luiz Augusto von Dentz
c7523cb988 obexd: Remove map_ap.c
It is no longer needed as MAP plugin is now using GObexApparam API
2012-12-04 22:49:04 +01:00
Luiz Augusto von Dentz
b338757cd3 obexd: Make use of GObexApparam API 2012-12-04 22:49:04 +01:00
Luiz Augusto von Dentz
398d3e2353 obexd: Make use of GObexApparam API 2012-12-04 22:49:04 +01:00
Luiz Augusto von Dentz
eb3aaa4d92 obexd: Port PBAP module to use GObexApparam 2012-12-04 22:49:04 +01:00
Ludek Finstrle
789eb4921f obexd: Fix pbap_select using absolute path with known locations
pbap_select has to use absolute path with known location to support
repeatable pbap_select calls. In other way the second call fails.
2012-12-04 22:49:03 +01:00
Luiz Augusto von Dentz
527cf79f62 obexd: Fix possible memory leak in handling of location
path was not being freed before returning, the is also simplified so
the error is now given in the return of the function.
2012-12-04 22:49:03 +01:00
Luiz Augusto von Dentz
ee215d601f obexd: Fix possible memory leak in bluetooth driver
2,210 (64 direct, 2,146 indirect) bytes in 2 blocks are definitely lost in loss record 150 of 155
   at 0x4A0884D: malloc (vg_replace_malloc.c:263)
   by 0x3B2900F8A1: sdp_create (sdp.c:3656)
   by 0x3B2900FAE0: sdp_connect (sdp.c:4604)
   by 0x415902: adapter_reply (bluetooth.c:421)
   by 0x3B22C0C429: ??? (in /usr/lib64/libdbus-1.so.3.5.6)
   by 0x3B22C0F5E9: dbus_connection_dispatch (in /usr/lib64/libdbus-1.so.3.5.6)
   by 0x4059A7: message_dispatch (mainloop.c:76)
   by 0x32CD64822A: ??? (in /usr/lib64/libglib-2.0.so.0.3200.4)
   by 0x32CD647694: g_main_context_dispatch (in /usr/lib64/libglib-2.0.so.0.3200.4)
   by 0x32CD6479C7: ??? (in /usr/lib64/libglib-2.0.so.0.3200.4)
   by 0x32CD647DC1: g_main_loop_run (in /usr/lib64/libglib-2.0.so.0.3200.4)
   by 0x40567F: main (main.c:175)
2012-12-04 22:49:03 +01:00
Luiz Augusto von Dentz
62ebf8d0f3 obexd: Make handle of location more clear
Add proper defines for supported paths and convert relative
path absolute to align with PBAP paths.
2012-12-04 22:49:03 +01:00
Harald Schmitt
a806141efd obexd: phonebook: Replace magic strings for phonebook names and folders 2012-12-04 22:49:03 +01:00
Harald Schmitt
57015dac9e obexd: Fix phonebook contacts query
At the moment IRMC fails to connect for phonebook_ebook and
phonebook_tracker usage because the name parameter for phonebook_pull
is not an absolute path.
2012-12-04 22:49:03 +01:00
Luiz Augusto von Dentz
96e59fff47 obexd: Add Message.Get implementation 2012-12-04 22:49:03 +01:00
Luiz Augusto von Dentz
535a6589c5 obexd: Use filter instead of dummy as argument name in MAP
This is aligned with the documentation that uses filter as well.
2012-12-04 22:49:03 +01:00
Luiz Augusto von Dentz
9ac5d05af5 obexd: Change MessageAccess.GetMessageListing to not return raw xml
This parses the response and return as a list of dictionary where each
entry is a message and its properties,
2012-12-04 22:49:03 +01:00
Luiz Augusto von Dentz
3471e4760b obexd: Change MessageAccess.GetFolderListing to not return raw xml
This parses the response and return as a list of dictionary where each
entry is a folder and its properties, similar to what
FileTransfer.ListFolder does.
2012-12-04 22:49:03 +01:00
Luiz Augusto von Dentz
0acb3455f8 obexd: Fix wrong signature of MessageAccess.SetFolder
D-Bus string signature is 's' not 'string'
2012-12-04 22:49:03 +01:00
Szymon Janc
2d07cea3b3 obexd: Fix some common spelling errors
Fix spelling errors reported by codespell.
2012-12-04 22:49:03 +01:00
Szymon Janc
84c4c3bedc obexd: Fix dead assignments
Values stored are never read.
2012-12-04 22:49:03 +01:00
Szymon Janc
20340654cf obexd: Fix error returning in obc_transfer_put
Always set error on failure in obc_transfer_put. This is expected by
callers and will avoid possible NULL pointer dereference.

Also fix improper use of errno variable (calling error may modify it)
and some dead assignments to perr.
2012-12-04 22:49:03 +01:00
Szymon Janc
e1713aa11d obexd: Use g_malloc0 in get_filter_strs
Use g_malloc0 instead of g_try_malloc0 to allocate list. All users
expects to get valid pointer from it anyway. Also size of allocated
memory is small.
2012-12-04 22:49:02 +01:00
Szymon Janc
bd8e84312f obexd: Fix use of uninitialized count variable
If opendir() call fails count would be passed to callback
uninitialized.
2012-12-04 22:49:02 +01:00
Luiz Augusto von Dentz
a5524f5924 obexd: Fix memory leak in bluetooth driver
384 (184 direct, 200 indirect) bytes in 1 blocks are definitely lost in loss record 141 of 157
   at 0x4A0884D: malloc (vg_replace_malloc.c:263)
   by 0x392E217815: ??? (in /usr/lib64/libdbus-1.so.3.5.6)
   by 0x392E218632: dbus_message_new_method_call (in /usr/lib64/libdbus-1.so.3.5.6)
   by 0x413AD3: send_method_call (bluetooth.c:87)
   by 0x414933: manager_reply (bluetooth.c:496)
   by 0x392E20C429: ??? (in /usr/lib64/libdbus-1.so.3.5.6)
   by 0x392E20F5E9: dbus_connection_dispatch (in /usr/lib64/libdbus-1.so.3.5.6)
   by 0x405767: message_dispatch (mainloop.c:76)
   by 0x369E04827A: ??? (in /usr/lib64/libglib-2.0.so.0.3200.3)
   by 0x369E0476E4: g_main_context_dispatch (in /usr/lib64/libglib-2.0.so.0.3200.3)
   by 0x369E047A17: ??? (in /usr/lib64/libglib-2.0.so.0.3200.3)
   by 0x369E047E11: g_main_loop_run (in /usr/lib64/libglib-2.0.so.0.3200.3)
2012-12-04 22:49:02 +01:00
Mikel Astiz
9d13a70842 obexd: Fix cancellation of queued transfers
Cancelling queued (not started yet) transfers should not fail. Instead,
they must be removed from the queue, so we just need to call the
transfer callback.
2012-12-04 22:49:02 +01:00
Mikel Astiz
60b2e58209 obexd: Remove obc_transfer_abort
Refactor the code to remove function obc_transfer_abort, which is used
only once and is anyway coupled to the D-Bus API.
2012-12-04 22:49:02 +01:00
Mikel Astiz
68b394a78b obexd: Fix possible unreplied D-Bus message
If a previous cancel request is in progress, a second cancel request
should fail.

This by the way fixes unreplied D-Bus messages.
2012-12-04 22:49:02 +01:00
Luiz Augusto von Dentz
a9a5fcd7db obexd: Fix using org.openobex.Error
In addition use define so it is easier to change this in future
2012-12-04 22:49:02 +01:00
Luiz Augusto von Dentz
8a296cfcbb obexd: Use session path as prefix for transfer path
This should make it easier to identify to which session the transfer
belongs.
2012-12-04 22:49:02 +01:00
Luiz Augusto von Dentz
dc3076af72 obexd: Fix not using connection passed to obc_transfer_register
Make use of the connection parameter instead of assuming the connection
will always be to the session bus.
2012-12-04 22:49:02 +01:00
Luiz Augusto von Dentz
2a7ec51f94 obexd: Rename Transfer interface to org.bluez.obex.Transfer 2012-12-04 22:49:02 +01:00
Luiz Augusto von Dentz
e3d1b527ca obexd: Rename MessageAccess interface to org.bluez.obex.MessageAccess 2012-12-04 22:49:02 +01:00
Luiz Augusto von Dentz
dea7c760ce obexd: Rename Synchronization interface to org.bluez.obex.Synchronization 2012-12-04 22:49:02 +01:00
Luiz Augusto von Dentz
6ae1745820 obexd: Rename PhonebookAccess interface to org.bluez.obex.PhonebookAccess 2012-12-04 22:49:02 +01:00
Luiz Augusto von Dentz
712f112619 obexd: Rename FileTransfer interface to org.bluez.obex.FileTransfer 2012-12-04 22:49:02 +01:00
Luiz Augusto von Dentz
f542d96735 obexd: Rename ObjectPush interface to org.bluez.obex.ObjectPush 2012-12-04 22:49:01 +01:00
Luiz Augusto von Dentz
7d565a9c07 obexd: Rename session interface to org.bluez.obex.Session
The base is also changed to /org/bluez/obex to follow the new namespace
2012-12-04 22:49:01 +01:00
Luiz Augusto von Dentz
27a14618b1 obexd: Change namespace to org.bluez.obex.client 2012-12-04 22:49:01 +01:00
Luiz Augusto von Dentz
1ff927b793 obexd: Change agent interface to org.bluez.obex.Agent 2012-12-04 22:49:01 +01:00
Luiz Augusto von Dentz
d6ed7409b7 obexd: Change D-Bus namespace to org.bluez.obex
This changes the namespace from org.openobex to org.bluez.obex
2012-12-04 22:49:01 +01:00
Mikel Astiz
f44090ba4b obexd: Update copyright statement 2012-12-04 22:49:01 +01:00
Mikel Astiz
4b424100ef obexd: PhonebookAccess sessions return transfers
Return the D-Bus path of the transfer representing the operation.
2012-12-04 22:49:01 +01:00
Mikel Astiz
0a174f40c6 obexd: Synchronization sessions return transfers
Return the D-Bus path of the transfer representing the operation.
2012-12-04 22:49:01 +01:00
Mikel Astiz
d6f045dc5c obexd: FileTransfer sessions return transfers
Return the D-Bus path of the transfer representing the operation.
2012-12-04 22:49:01 +01:00
Mikel Astiz
6793dfe0d0 obexd: ObjectPush sessions return transfers
Return the D-Bus path of the transfer representing the operation.
2012-12-04 22:49:01 +01:00
Mikel Astiz
d3b779a77a obexd: Expose D-Bus data in internal transfer API
Expose in transfer API the D-Bus path and properties as should be
returned by transfer-initiating D-Bus methods.
2012-12-04 22:49:01 +01:00
Mikel Astiz
b5fe20a9a4 obexd: Support empty filename in obc_transfer_get
Passing an empty string as a filename for obc_transfer_get will be
similar to passing a NULL filename. This means a temporary file will be
created to store the content of the transfer.

NULL and "" are not exactly equivalent though: in case of NULL the file
will be automatically removed immediately after being open, which means
that the transfer initiator should also open the file to prevent it from
being removed (to be used from the modules). In this case, the filename
will not be exposed in D-Bus.

On the other hand, if "" is given, the file will be removed only in case
of error. So after success the transfer initiator should decide whether
the file should be removed or not.

This change is convenient in order to expose the same API in D-Bus.
2012-12-04 22:49:01 +01:00
Mikel Astiz
c8ec529a7c obexd: Make transfer filename optional
The property might not exist for certain transfers, typically when they
have been initiated internally.
2012-12-04 22:49:01 +01:00
Mikel Astiz
eae9cf3da1 obexd: Make FileTransfer.PutFile asynchronous
There is no reason to have inconsistent behavior between GetFile and
PutFile, in FileTransfer D-Bus API.

Before this change, PutFile reported success immediately after queueing
the transfer, even though the D-Bus signature includes the async flag.
2012-12-04 22:49:01 +01:00
Mikel Astiz
b91d48749b obexd: Expose all transfers in D-Bus
Relying on a internal policy (based on transfer type) to decide if a
transfer should be exposed or not in D-Bus has some limitations. The
simplest possible alternative to this is to expose all transfers in
D-Bus, assuming the overhead is not significant.
2012-12-04 22:49:00 +01:00
Mikel Astiz
b9f31ead5f obexd: Remove obsolete authentication code
After the removal of the agent, the implementation of the session can be
simplified by removing all authentication-related code.
2012-12-04 22:49:00 +01:00
Mikel Astiz
ef129dcce0 obexd: Remove internal transfer progress report
The new D-Bus API uses signals to report the progress updates, so the
internal progress callback is not needed any more.
2012-12-04 22:49:00 +01:00
Mikel Astiz
649a3ffdb8 obexd: Remove unused functions in transfer API
After the removal of the agent these functions are not useful any more.
2012-12-04 22:49:00 +01:00
Mikel Astiz
5e3bc6b93e obexd: Remove D-Bus agent
The authorization mechanism is entirely removed from the session, and
thus transfers are automatically started (once popped from the queue)
without confirmation and without any name/filename change.
2012-12-04 22:49:00 +01:00
Mikel Astiz
5119ebcc35 obexd: Use transfer owner instead of agent
The security checks in the transfers' D-Bus API will consider check for
the transfer owner's path (session owner) instead of the agent path.
2012-12-04 22:49:00 +01:00
Mikel Astiz
ce7b4cbd4c obexd: Add transfer event-reporting signals
These signals replace the old agent-based notification mechanism.
2012-12-04 22:49:00 +01:00
Mikel Astiz
febb9caf52 obexd: Add progress property to transfer
The number of transferred bytes is exposed in D-Bus using a specific
property for this purpose.

Internally, the value of this property does not necessarily match the
internal progress counter. In order to avoid D-Bus overhead, the
property will be updated once per second.
2012-12-04 22:49:00 +01:00
Mikel Astiz
5ac5f18a8b obexd: Add D-Bus helper library
No functionality changes. This is just about avoiding duplicated code.
2012-12-04 22:49:00 +01:00
Mikel Astiz
9250a662b3 obexd: Replace parameter dict with conventional ones 2012-12-04 22:49:00 +01:00