Changeset 482

Show
Ignore:
Timestamp:
07/07/08 10:34:29 (1 month ago)
Author:
bellmich
Message:

added support for timestamp based anchors

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/tools/syncml-obex-client.c

    r476 r482  
    5151 
    5252SmlBool onlyInfo = FALSE; 
     53char *useTimeAnchor = NULL; 
    5354 
    5455static void usage (char *name, int ecode) 
     
    8081        fprintf (stderr, "[--useNumberOfChanges]\t\t\tSupport NumberOfChanges feature (the most new phones need it) (default: false)\n\n"); 
    8182        fprintf (stderr, "[--useLargeObjs]\t\t\tSupport large objects feature (the most new phones need it) (default: false)\n\n"); 
     83        fprintf (stderr, "[--useTimeAnchor]\t\t\tUse timestamps as anchors (only for new Nokia series 40 phones)\n\n"); 
    8284        fprintf (stderr, "[--dumpinfo]\t\t\tPrint info about the phone at the end which can be sent to the developers\n"); 
    8385        exit (ecode); 
     
    202204        smlTrace(TRACE_ENTRY, "%s(%p, %i, %s, %s, %p)", __func__, dsession, type, last, next, userdata); 
    203205        SmlError *error = NULL; 
     206        const char *anchor = next; 
     207        if (useTimeAnchor) 
     208                anchor = useTimeAnchor; 
    204209         
    205210        printf("Received an Alert for the DS Server at %s: Type: %i, Last %s, Next %s\n", smlDsSessionGetLocation(dsession), type, last, next); 
     
    220225                /* SLOW-SYNC enforced by tool */ 
    221226                printf("Enforcing SLOW-SYNC\n"); 
    222                 if (!smlDsSessionSendAlert(dsession, SML_ALERT_SLOW_SYNC, last, next, _recv_alert_reply, NULL, &error)) 
     227                if (!smlDsSessionSendAlert(dsession, SML_ALERT_SLOW_SYNC, NULL, anchor, _recv_alert_reply, NULL, &error)) 
    223228                        goto error; 
    224229 
     
    237242                        goto error; 
    238243                } 
    239                 if (!smlDsSessionSendAlert(dsession, type, last, next, _recv_alert_reply, NULL, &error)) 
     244                if (!smlDsSessionSendAlert(dsession, type, last, anchor, _recv_alert_reply, NULL, &error)) 
    240245                        goto error; 
    241246        } 
     
    573578                } else if (!strcmp (arg, "--useLargeObjs")) { 
    574579                        useLargeObjs = TRUE; 
     580                } else if (!strcmp (arg, "--useTimeAnchor")) { 
     581                        useTimeAnchor = malloc(sizeof(char)*17); 
     582                        time_t htime = time(NULL); 
     583                        strftime(useTimeAnchor, 17, "%Y%m%dT%H%M%SZ", gmtime(&htime)); 
    575584                } else if (!strcmp (arg, "--version")) { 
    576585                        i++;