Patrick,
Ok, I've taken your last comments into account, and also have a log
with debugging turned on to try to figure out the gvariant error. As
can be seen in the pbaplog.txt PullAll takes a string filename as
argument, and returns an object and an a{sv} of properties, so where
is the gvariant error in the dbuscallback coming from?On Tue, Aug 21, 2012 at 12:37 AM, Patrick Ohly <[email protected]> wrote: > On Mon, 2012-08-20 at 19:31 -0600, Jeremy Whiting wrote: >> Patrick, >> >> On Fri, Aug 17, 2012 at 5:46 AM, Patrick Ohly <[email protected]> wrote: >> > Hello! >> > >> > I've picked up work on the PBAP backend [1] again. The "pbap" branch can >> > be merged with current master without problems and works as it did >> > before with obexd < 0.47 (see the src/backends/pbap/README): >> > * "refresh-from-remote" works. >> > * The entire phone address book, including PHOTOs, is downloaded >> > in each sync. >> > >> > There are several todos for the code: >> > 1. Adapt to obexd >= 0.47 and the new D-Bus API in it; the current >> > code no longer works. >> >> In order to tackle this task, I've gotten the pbap branch, rebased it >> on master and gotten it to build by changing all the method() calls to >> method.start(). However the guide in the src/backends/pbap/README no >> longer works and gives the following message when I run syncevolution >> --print-items test-config@pbap: > ^^^^^^^^^^^ > Typo - the name of the config is target-config@pbap, if you followed the > README. > >> though I did set up test-config@pbap (and it appears in --print-configs) >> with: >> syncevolution --configure syncURL= addressbook/backend=pbap >> addressbook/database=obex-bt://$MYMAC target-config@pbap addressbook > ^^^^^^^^^^^^^ > >> Also how would you suggest compatibility with obex 0.47 and obex < >> 0.47 work? separate branches? separate code paths in the same branch >> (maybe with a check to see if org.openobex.client or >> org.bluez.obex.client is implemented to know which path to take). > > I would do a runtime check. The result of PbapSession::pullAllCb() could > be a pointer into memory (obexd < 0.47) or a memory-mapped file (obexd >>= 0.47). Then the rest of the code then needs to be changed to work > with plain char pointers for the buffer instead of the current const > std::string, but would be the same for both versions. > >> > In SyncEvolution, listening to D-Bus signals is done with the custom >> > GDBusCXX::SignalWatch template class. Documentation of that C++ D-Bus >> > binding is admittedly weak. Grep the source to find examples how it is >> > used and/or let me know if you want better documentation of the C++ >> > wrapper and I'll add it. >> >> In order to do this I just need to create a SignalWatch on Transfer >> and copy the file? or get the data from the Transfer object? > > You'll have to access the file. The Transfer object only gives you meta > information about the file. > > You can set up operations in this order: > 1. Create temporary file. I believe I've got this figured out as in the attached patch. > 2. Create a SignalWatch for all object paths which updates status > if the Transfer's Filename matches the temporary file. > 3. Start the transfer. Start the transfer just means call PullAll, correct? > 4. while ("still running") g_main_context_iteration(NULL, true); This is a loop watching a value of the Transfer object for completed or error, right? Why not just store the fd, connect to the transfer completed and error signals and let the callbacks for those signals do the next steps? thanks, Jeremy > 5. mmap file > 6. parse it > > -- > Best Regards, Patrick Ohly > > The content of this message is my personal opinion only and although > I am an employee of Intel, the statements I make here in no way > represent Intel's position on the issue, nor am I authorized to speak > on behalf of Intel on this matter. > >
[DEBUG 00:00:00] Thu 2012-08-23 05:35:01 UTC = 05:35 +0000 UTC
[DEBUG 00:00:00] ---> PBAP::createSource()
========================================================================
GDBus-debug:Message:
>>>> SENT D-Bus message (128 bytes)
Type: method-call
Flags: none
Version: 0
Serial: 1
Headers:
path -> objectpath '/org/freedesktop/DBus'
interface -> 'org.freedesktop.DBus'
member -> 'Hello'
destination -> 'org.freedesktop.DBus'
Body: ()
UNIX File Descriptors:
(none)
========================================================================
GDBus-debug:Message:
<<<< RECEIVED D-Bus message (90 bytes)
Type: method-return
Flags: no-reply-expected
Version: 0
Serial: 1
Headers:
reply-serial -> uint32 1
destination -> ':1.89'
sender -> 'org.freedesktop.DBus'
signature -> signature 's'
Body: (':1.89',)
UNIX File Descriptors:
(none)
[DEBUG 00:00:00] Using new obex org.bluez.obex.Client
========================================================================
GDBus-debug:Message:
<<<< RECEIVED D-Bus message (170 bytes)
Type: signal
Flags: no-reply-expected
Version: 0
Serial: 2
Headers:
path -> objectpath '/org/freedesktop/DBus'
interface -> 'org.freedesktop.DBus'
member -> 'NameAcquired'
destination -> ':1.89'
sender -> 'org.freedesktop.DBus'
signature -> signature 's'
Body: (':1.89',)
UNIX File Descriptors:
(none)
========================================================================
GDBus-debug:Message:
>>>> SENT D-Bus message (193 bytes)
Type: method-call
Flags: none
Version: 0
Serial: 2
Headers:
path -> objectpath '/'
interface -> 'org.bluez.obex.Client'
member -> 'CreateSession'
destination -> 'org.bluez.obex.client'
signature -> signature 'sa{sv}'
Body: ('CC:8C:E3:11:F2:54', {'Target': <'PBAP'>})
UNIX File Descriptors:
(none)
========================================================================
GDBus-debug:Message:
<<<< RECEIVED D-Bus message (93 bytes)
Type: method-return
Flags: no-reply-expected
Version: 0
Serial: 9
Headers:
reply-serial -> uint32 2
destination -> ':1.89'
sender -> ':1.87'
signature -> signature 'o'
Body: (objectpath '/org/bluez/obex/session1',)
UNIX File Descriptors:
(none)
[DEBUG 00:00:00] PBAP session created: /org/bluez/obex/session1
========================================================================
GDBus-debug:Message:
>>>> SENT D-Bus message (167 bytes)
Type: method-call
Flags: none
Version: 0
Serial: 3
Headers:
path -> objectpath '/org/bluez/obex/session1'
interface -> 'org.bluez.obex.PhonebookAccess'
member -> 'Select'
destination -> 'org.bluez.obex.client'
signature -> signature 'ss'
Body: ('int', 'PB')
UNIX File Descriptors:
(none)
========================================================================
GDBus-debug:Message:
<<<< RECEIVED D-Bus message (56 bytes)
Type: method-return
Flags: no-reply-expected
Version: 0
Serial: 10
Headers:
reply-serial -> uint32 3
destination -> ':1.89'
sender -> ':1.87'
Body: ()
UNIX File Descriptors:
(none)
[DEBUG 00:00:00] PBAP session initialized
[DEBUG 00:00:00] Created temporary file for PullAll /tmp/.TM6KJW
========================================================================
GDBus-debug:Message:
>>>> SENT D-Bus message (169 bytes)
Type: method-call
Flags: none
Version: 0
Serial: 4
Headers:
path -> objectpath '/org/bluez/obex/session1'
interface -> 'org.bluez.obex.PhonebookAccess'
member -> 'PullAll'
destination -> 'org.bluez.obex.client'
signature -> signature 's'
Body: ('/tmp/.TM6KJW',)
UNIX File Descriptors:
(none)
========================================================================
GDBus-debug:Message:
<<<< RECEIVED D-Bus message (209 bytes)
Type: method-return
Flags: no-reply-expected
Version: 0
Serial: 11
Headers:
reply-serial -> uint32 4
destination -> ':1.89'
sender -> ':1.87'
signature -> signature '(oa{sv})'
Body: ((objectpath '/org/bluez/obex/session1/transfer1', {'Name':
<'telecom/pb.vcf'>, 'Size': <uint64 0>, 'Filename': <'/tmp/.TM6KJW'>}),)
UNIX File Descriptors:
(none)
[ERROR 00:00:00] unexpected exception caught in dbusCallback(): g_variant
failure ./src/gdbusxx/gdbus-cxx-bridge.h:1393
0011-WIP-add-support-for-obex-0.47-to-pbap-backend.patch
Description: Binary data
_______________________________________________ SyncEvolution mailing list [email protected] http://lists.syncevolution.org/listinfo/syncevolution
