[sync] SyncML and T610 results

Joeri Pronk joeri at joeri.nu
Thu Jul 8 05:54:08 PDT 2004


I noticed a small error in framework/SyncML/SyncML/Sync/TwoWaySync.php:
There is a leading space before <?php which causes wbxml output to get
corrupted.

I am testing with a sony t610 mobile phone, which unfortunately does not send
the Cred in the SyncHdr but in the SyncBody of the message (in front of every
source). Funny thing is you can specify Server Credentials as well as
individual tasks/calendar/contacts credentials, but the server creds are never
used.
I have written some code to solve this, purely a hack to copy the Cred structure
from the SyncBody to the SyncHdr location if it\'s not there already.
in framework/RPC/syncml.php at line 66 (just after GetResponse):
        // Horrible hack to work around T610 missing server Cred
        if (($pos1=strpos($request,"<SyncHdr"))) {
            $pos2=strpos($request,"</SyncHdr",$pos1);
            $header=substr($request,$pos1,$pos2-$pos1);
            if (strpos($header,"<Cred")===false) {
                if (($pos1=strpos($request,"<Cred"))) {
                    $pos2=strpos($request,"</Cred",$pos1);
                    $pos3=strpos($request,">",$pos2);
                    $cred=substr($request,$pos1,$pos3-$pos1+1);
                    $pos1=strpos($request,"</SyncHdr");
                    $pre=substr($request,0,$pos1);
                    $post=substr($request,$pos1);
                    // now we paste the first found Cred structure in SyncHdr
                    $request="$pre$cred$post";
                }
            }
        }

Hope this helps, although I personally would like to see support for multiple
Cred sections (syncing to a common calendar account with your own tasklist for
example), but this seems like a lot of work...


I get a succesful synchronisation the first time, but our SyncML cannot find
it's anchors out of the datatree and tries to slowsync every time. Will try to
look into this.

Otherwise I am as happy as h*ll that I finally got something working with my
T610.
We are getting closer everyday!

Cheers!

Joeri



More information about the sync mailing list