From 4dd29bc7b763a15c98c127f2dc5deaf4e838a0af Mon Sep 17 00:00:00 2001 From: Justin Maggard Date: Fri, 8 May 2009 02:26:17 +0000 Subject: [PATCH] * Fix ContentDirectory XML description. --- Makefile | 2 +- testupnpdescgen.c | 4 ++++ upnpdescgen.c | 27 ++++++--------------------- 3 files changed, 11 insertions(+), 22 deletions(-) diff --git a/Makefile b/Makefile index 7cd3772..2d4e899 100644 --- a/Makefile +++ b/Makefile @@ -63,7 +63,7 @@ minidlna: $(BASEOBJS) $(LNXOBJS) $(LIBS) testupnpdescgen: $(TESTUPNPDESCGENOBJS) @echo Linking $@ - @$(CC) $(CFLAGS) -o $@ $(BASEOBJS) $(LNXOBJS) $(LIBS) + @$(CC) $(CFLAGS) -o $@ $(TESTUPNPDESCGENOBJS) config.h: genconfig.sh ./genconfig.sh diff --git a/testupnpdescgen.c b/testupnpdescgen.c index 049c7d1..343e40f 100644 --- a/testupnpdescgen.c +++ b/testupnpdescgen.c @@ -110,6 +110,10 @@ main(int argc, char * * argv) xml_pretty_print(s, l, stdout); free(s); printf("\n-------------\n"); + s = genX_MS_MediaReceiverRegistrar(&l); + xml_pretty_print(s, l, stdout); + free(s); + printf("\n-------------\n"); /* stupid_test(); */ diff --git a/upnpdescgen.c b/upnpdescgen.c index 277114d..ba7a1e0 100644 --- a/upnpdescgen.c +++ b/upnpdescgen.c @@ -305,19 +305,19 @@ static const struct stateVar ConnectionManagerVars[] = static const struct argument GetSearchCapabilitiesArgs[] = { - {"SearchCaps", 2, 16}, + {"SearchCaps", 2, 10}, {0, 0} }; static const struct argument GetSortCapabilitiesArgs[] = { - {"SortCaps", 2, 17}, + {"SortCaps", 2, 11}, {0, 0} }; static const struct argument GetSystemUpdateIDArgs[] = { - {"Id", 2, 18}, + {"Id", 2, 12}, {0, 0} }; @@ -374,7 +374,7 @@ static const struct action ContentDirectoryActions[] = static const struct stateVar ContentDirectoryVars[] = { - {"TransferIDs", 1<<7, 0, 46, 46}, /* 0 */ + {"TransferIDs", 1<<7, 0, 0, 46}, /* 0 */ {"A_ARG_TYPE_ObjectID", 0, 0}, {"A_ARG_TYPE_Result", 0, 0}, {"A_ARG_TYPE_SearchCriteria", 0, 0}, @@ -385,12 +385,6 @@ static const struct stateVar ContentDirectoryVars[] = {"A_ARG_TYPE_Index", 3, 0}, {"A_ARG_TYPE_Count", 3, 0}, {"A_ARG_TYPE_UpdateID", 3, 0}, - {"A_ARG_TYPE_UpdateID", 3, 0}, - {"A_ARG_TYPE_UpdateID", 3, 0}, - {"A_ARG_TYPE_UpdateID", 3, 0}, - {"A_ARG_TYPE_UpdateID", 3, 0}, - {"A_ARG_TYPE_UpdateID", 3, 0}, - {"A_ARG_TYPE_UpdateID", 3, 0}, //JM{"A_ARG_TYPE_TransferID", 3, 0}, /* 10 */ //JM{"A_ARG_TYPE_TransferStatus", 0, 0, 39}, /* Allowed Values : COMPLETED / ERROR / IN_PROGRESS / STOPPED */ @@ -400,7 +394,7 @@ static const struct stateVar ContentDirectoryVars[] = //JM{"A_ARG_TYPE_URI", 5, 0}, /* 15 */ {"SearchCapabilities", 0, 0}, {"SortCapabilities", 0, 0}, - {"SystemUpdateID", 3|0x80, 0, 46, 255}, + {"SystemUpdateID", 3|0x80, 0, 0, 255}, //{"ContainerUpdateIDs", 0, 0}, {0, 0} }; @@ -695,18 +689,9 @@ genServiceDesc(int * len, const struct serviceDesc * s) j = 0; while(args[j].dir) { - //JM str = strcat_str(str, len, &tmplen, "New"); str = strcat_str(str, len, &tmplen, ""); p = vars[args[j].relatedVar].name; - if(0 == memcmp(p, "PortMapping", 11) - && 0 != memcmp(p + 11, "Description", 11)) { - if(0 == memcmp(p + 11, "NumberOfEntries", 15)) - str = strcat_str(str, len, &tmplen, "PortMappingIndex"); - else - str = strcat_str(str, len, &tmplen, p + 11); - } else { - str = strcat_str(str, len, &tmplen, (args[j].name ? args[j].name : p)); - } + str = strcat_str(str, len, &tmplen, (args[j].name ? args[j].name : p)); str = strcat_str(str, len, &tmplen, ""); str = strcat_str(str, len, &tmplen, args[j].dir==1?"in":"out"); str = strcat_str(str, len, &tmplen,