Changeset 162

Show
Ignore:
Timestamp:
05/06/06 17:29:28 (3 years ago)
Author:
azrael
Message:

Fixed several bugs

added support for the 6230

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • branches/dev-branch/devices.txt

    r161 r162  
    6767 
    6868Supported: Unknown 
     69 
     70======================================== 
     71Man: Nokia 
     72Mod: Nokia 6230 
     73FirmwareVersion: V 05.50 
     74SoftwareVersion: V 05.50 
     75HardwareVersion: 0606 
     76 
     77ReceiveLimit: 0 
     78MaxObjSize: 0 
     79AllowLateStatus: no 
     80NoPendingReplies: no 
     81Connection used: Obex 
     82Identifier: PC Suite 
     83Contact DB: vcard 
     84Event DB: (null) 
     85Todo DB: (null) 
     86Note DB: (null) 
     87 
     88Bluetooth: Yes 
     89Wbxml: Yes 
     90SyncML Version: 1.1 
     91SupportsNumberofChanges: No 
     92SupportsLargeObjects: No 
  • branches/dev-branch/libsyncml/parser/sml_xml_assm.c

    r160 r162  
    448448                goto error; 
    449449         
    450         if (assm->session->supportsNumberOfChanges && assm->session->version != SML_VERSION_10) { 
     450        /*if (assm->session->supportsNumberOfChanges && assm->session->version != SML_VERSION_10) { 
    451451                if (!_smlXmlAssemblerAddID(assm, SML_ELEMENT_NUMBEROFCHANGES, cmd->private.sync.numChanged, error)) 
    452452                        goto error; 
    453         } 
     453        }*/ 
    454454         
    455455        smlTrace(TRACE_EXIT, "%s", __func__); 
     
    11021102                goto error; 
    11031103         
    1104         if (status->type != SML_COMMAND_TYPE_RESULTS) { 
    1105                 const char *cmdname = smlCommandTypeToString(status->type, error); 
    1106                 if (!cmdname) 
    1107                         goto error; 
    1108                          
    1109                 if (!_smlXmlAssemblerAddString(assm, SML_ELEMENT_CMD, cmdname, error)) 
    1110                         goto error; 
    1111         } 
     1104        const char *cmdname = smlCommandTypeToString(status->type, error); 
     1105        if (!cmdname) 
     1106                goto error; 
     1107                 
     1108        if (!_smlXmlAssemblerAddString(assm, SML_ELEMENT_CMD, cmdname, error)) 
     1109                goto error; 
    11121110         
    11131111        switch (status->type) { 
  • branches/dev-branch/libsyncml/parser/sml_xml_parse.c

    r160 r162  
    583583                                                goto error_free_item; 
    584584                                        break; 
     585                                case SML_COMMAND_TYPE_RESULTS: 
    585586                                case SML_COMMAND_TYPE_PUT:; 
    586587                                        /* Some phones send the type information for the devinf put 
     
    19241925        smlAssert(element); 
    19251926        smlAssert(cttype); 
    1926                  
     1927         
     1928        if (!_smlXmlParserStep(parser)) { 
     1929                smlErrorSet(error, SML_ERROR_GENERIC, "Missing nodes"); 
     1930                goto error; 
     1931        } 
     1932         
    19271933        while (1) { 
    1928                 if (!_smlXmlParserStep(parser)) { 
    1929                         smlErrorSet(error, SML_ERROR_GENERIC, "Missing nodes"); 
    1930                         goto error; 
    1931                 } 
    1932                  
    19331934                if (!strcmp((char *)xmlTextReaderConstName(parser->reader), element) && \ 
    19341935                xmlTextReaderNodeType(parser->reader) == XML_NODE_CLOSE) { 
    19351936                        break; 
    19361937                } else if (xmlTextReaderNodeType(parser->reader) != XML_NODE_START) { 
    1937                         smlErrorSet(error, SML_ERROR_GENERIC, "Not a start node"); 
     1938                        smlErrorSet(error, SML_ERROR_GENERIC, "Not a start node: %s %i", (char *)xmlTextReaderConstName(parser->reader), xmlTextReaderNodeType(parser->reader)); 
    19381939                        goto error; 
    19391940                } 
     
    19431944                                goto error; 
    19441945                } else if (!strcmp((char *)xmlTextReaderConstName(parser->reader), SML_ELEMENT_VERCT)) { 
    1945                         if (!_smlXmlParserGetString(parser, version, SML_ELEMENT_VERCT, error)) 
     1946                        /* Some phones send an empty VerCT for formats that dont have a version 
     1947                         * (like notes). */ 
     1948                        if (!_smlXmlParserStep(parser)) { 
     1949                                smlErrorSet(error, SML_ERROR_GENERIC, "No node at all"); 
    19461950                                goto error; 
     1951                        } 
     1952                         
     1953                        if (!strcmp((char *)xmlTextReaderConstName(parser->reader), SML_ELEMENT_VERCT) && \ 
     1954                                xmlTextReaderNodeType(parser->reader) == XML_NODE_CLOSE) { 
     1955                                *version = g_strdup(""); 
     1956                        } else if (xmlTextReaderNodeType(parser->reader) == XML_NODE_TEXT) { 
     1957                                *version = g_strstrip(g_strdup((char *)xmlTextReaderConstValue(parser->reader))); 
     1958                                 
     1959                                if (!_smlXmlParserExpectNode(parser, XML_NODE_CLOSE, FALSE, SML_ELEMENT_VERCT, error)) 
     1960                                        goto error; 
     1961                        } else { 
     1962                                *version = g_strdup(""); 
     1963                                continue; 
     1964                        } 
    19471965                } else { 
    19481966                        smlErrorSet(error, SML_ERROR_GENERIC, "wrong initial node"); 
     1967                        goto error; 
     1968                } 
     1969                 
     1970                if (!_smlXmlParserStep(parser)) { 
     1971                        smlErrorSet(error, SML_ERROR_GENERIC, "Missing nodes"); 
    19491972                        goto error; 
    19501973                } 
     
    20882111                 
    20892112        while (1) { 
     2113                if (!strcmp((char *)xmlTextReaderConstName(parser->reader), SML_ELEMENT_DEVINF) && \ 
     2114                xmlTextReaderNodeType(parser->reader) == XML_NODE_CLOSE) { 
     2115                        break; 
     2116                } else if (xmlTextReaderNodeType(parser->reader) != XML_NODE_START) { 
     2117                        smlErrorSet(error, SML_ERROR_GENERIC, "Not a start node"); 
     2118                        goto error_free_devinf; 
     2119                } 
     2120                 
     2121                 
    20902122                if (!strcmp((char *)xmlTextReaderConstName(parser->reader), SML_ELEMENT_CTCAP)) { 
    20912123                        /* Ignored for now */ 
     2124                        smlTrace(TRACE_INTERNAL, "Skipping ctcap node"); 
    20922125                        if (xmlTextReaderNext(parser->reader) != 1) { 
    20932126                                smlErrorSet(error, SML_ERROR_GENERIC, "Unable to skip ctcap node"); 
    20942127                                goto error; 
    20952128                        } 
    2096                 } 
    2097                  
    2098                 if (!strcmp((char *)xmlTextReaderConstName(parser->reader), SML_ELEMENT_DEVINF) && \ 
    2099                 xmlTextReaderNodeType(parser->reader) == XML_NODE_CLOSE) { 
    2100                         break; 
    2101                 } else if (xmlTextReaderNodeType(parser->reader) != XML_NODE_START) { 
    2102                         smlErrorSet(error, SML_ERROR_GENERIC, "Not a start node"); 
    2103                         goto error_free_devinf; 
    2104                 } 
    2105                  
    2106                 if (!strcmp((char *)xmlTextReaderConstName(parser->reader), SML_ELEMENT_VERDTD)) { 
     2129                        continue; 
     2130                } else if (!strcmp((char *)xmlTextReaderConstName(parser->reader), SML_ELEMENT_VERDTD)) { 
    21072131                        char *verdtd = NULL; 
    21082132                        if (!_smlXmlParserGetString(parser, &verdtd, SML_ELEMENT_VERDTD, error)) 
     
    22142238                                goto error_free_devinf; 
    22152239                } else { 
    2216                         smlErrorSet(error, SML_ERROR_GENERIC, "wrong initial node"); 
     2240                        smlErrorSet(error, SML_ERROR_GENERIC, "wrong initial node: %s", (char *)xmlTextReaderConstName(parser->reader)); 
    22172241                        goto error_free_devinf; 
    22182242                } 
  • branches/dev-branch/tools/syncml-obex-client.c

    r160 r162  
    7474        fprintf (stderr, "[--allowLateStatus]\t\t\tAllows that a phone can send commands before statuses (Needed for some phones)\n\n"); 
    7575        fprintf (stderr, "[--noPendingReplies]\t\t\tRequire that no pending replies are allowed (Needed for some phones)\n\n"); 
     76        fprintf (stderr, "[--noStringTable]\t\t\tDont use wbxml string tables (Needed for some phones)\n\n"); 
    7677        fprintf (stderr, "[--dumpinfo]\t\t\tPrint info about the phone at the end which can be sent to the developers\n"); 
    7778        exit (ecode); 
     
    245246SmlBool noPending = FALSE; 
    246247SmlBool dumpinfo = FALSE; 
     248SmlBool noStringTable = FALSE; 
    247249SmlProtocolVersion sessionVersion = SML_VERSION_UNKNOWN; 
    248250SmlDevInf *deviceDevinf = NULL; 
     
    280282                        if (noPending) 
    281283                                smlSessionSetNoPendingReplies(session, noPending); 
     284                                 
     285                        if (noStringTable) 
     286                                smlSessionUseStringTable(session, FALSE); 
    282287                        break; 
    283288                case SML_MANAGER_SESSION_FINAL: 
     
    497502                } else if (!strcmp (arg, "--noPendingReplies")) { 
    498503                        noPending = TRUE; 
     504                } else if (!strcmp (arg, "--noStringTable")) { 
     505                        noStringTable = TRUE; 
    499506                } else if (!strcmp (arg, "--version")) { 
    500507                        i++; 
     
    732739                        printf("HardwareVersion: %s\n", smlDevInfGetHardwareVersion(deviceDevinf)); 
    733740                        printf("\n"); 
    734                          
    735                          
    736  
    737 NeedsReceiveLimit: yes 
    738 AllowLateStatus: yes 
    739 NoPendingReplies: no 
    740                          
     741                        printf("ReceiveLimit: %i\n", recvLimit); 
     742                        printf("MaxObjSize: %i\n", maxObjSize); 
     743                        printf("AllowLateStatus: %s\n", lateStatus ? "yes" : "no"); 
     744                        printf("NoPendingReplies: %s\n", noPending ? "yes" : "no"); 
    741745                        printf("Connection used: Obex\n"); 
    742746                        printf("Identifier: %s\n", identifier);