From: Nektarios K. P. <npa...@in...> - 2007-06-28 09:07:39
|
I didn't look your code, but I know that building a proper combo of control point and device is not possible with upnp-sdk. This is fixed in the successor of this project pupnp: http://sourceforge.net/projects/pupnp gokeigen wrote: > I have a problem when i build control point and device into one process. > source code is listed down.If the function of "UpnpSendAdvertisement"is > called,the control point can not download description document from mini > http server.But,if "UpnpSendAdvertisement"is not called,everything is > ok.what is wrong with my program? > > /* routine */ > int upnpDeviceStart() > { > int ret = UPNP_E_SUCCESS; > char* web_dir_path = "./web"; > > ret = UpnpSetWebServerRootDir(web_dir_path); > if(ret != UPNP_E_SUCCESS) > { > ERROR_PRINTF("Specifying webserver root directory --> %s failure!\n > \ > Error Code : %d\n",web_dir_path,ret); > upnpFinish(); > return ret; > } > > char* ip = NULL; > unsigned short port; > char desc_File_url[256]; > char* pDesc_File_Name = "tvdevicedesc.xml"; > > ip = UpnpGetServerIpAddress(); > port = UpnpGetServerPort(); > > sprintf(desc_File_url,"http://%s:%d/%s",ip,port,pDesc_File_Name); > DBG_PRINTF("descfileurl --> %s\n",desc_File_url); > > ret = UpnpRegisterRootDevice(desc_File_url, > upnpDeviceCallbackEventHandler, > &deviceHandle, > &deviceHandle); > if(ret != UPNP_E_SUCCESS) > { > ERROR_PRINTF("Registering the rootdevice --> %s failure!\n \ > Error Code : %d\n",&desc_File_url[0],ret); > upnpFinish(); > return ret; > } > #if 1 > ret = UpnpSendAdvertisement(deviceHandle,Device_Advr_Expire); > if(ret != UPNP_E_SUCCESS) > { > ERROR_PRINTF("Sending advertisements --> %d\n \ > Error Code : %d\n",ret); > upnpFinish(); > return ret; > } > #endif > return ret; > } > > /* debug message when "UpnpSendAdvertisement" is called */ > [DEBUG]upnpctrlInit(). > [DEBUG]descfileurl --> http://127.0.0.1:49152/tvdevicedesc.xml > > cmd> [DEBUG]DISCOVERY_SEARCH_TIMEOUT > [DEBUG]DISCOVERY_SEARCH_TIMEOUT > Error: Error obtaining device description from > http://127.0.0.1:49152/tvdevicedesc.xml > [DEBUG]retCode: -207 > > /* wget message */ > [lnkinprk@npc0705 ~]$ wget --no-proxy > http://127.0.0.1:49152/tvdevicedesc.xml > --19:19:18-- http://127.0.0.1:49152/tvdevicedesc.xml > Connecting to 127.0.0.1:49152... connected. > HTTP request sent, awaiting response... > > /* debug message when "UpnpSendAdvertisement" is not called */ > [DEBUG]upnpctrlInit(). > [DEBUG]descfileurl --> http://127.0.0.1:49154/tvdevicedesc.xml > > cmd> [DEBUG]Add to Device Summary:UPnP Television Emulator > [DEBUG]DISCOVERY_SEARCH_TIMEOUT > > /* wget message */ > [lnkinprk@npc0705 ~]$ wget --no-proxy > http://127.0.0.1:49153/tvdevicedesc.xml > --19:28:07-- http://127.0.0.1:49153/tvdevicedesc.xml > Connecting to 127.0.0.1:49153... connected. > HTTP request sent, awaiting response... 200 OK > Length: 1532 (1.5K) [text/xml] > Saving to: `tvdevicedesc.xml.4' > > 100%[=======================================>] 1,532 --.-K/s in > 0s > > 19:28:07 (196 MB/s) - `tvdevicedesc.xml.4' saved [1532/1532] > > > > > ------------------------------------------------------------------------- > This SF.net email is sponsored by DB2 Express > Download DB2 Express C - the FREE version of DB2 express and take > control of your XML. No limits. Just data. Click to get it now. > http://sourceforge.net/powerbar/db2/ > _______________________________________________ > Upnp-sdk-dev mailing list > Upn...@li... > https://lists.sourceforge.net/lists/listinfo/upnp-sdk-dev > -- ______________________________________________________________ Nektarios K. Papadopoulos Senior Engineer Home Automation Group inAccess Networks ______________________________________________________________ |