root_device = _root_device; device_type = getMandatoryField( device_node, "DeviceType" ); friendly_name = getMandatoryField( device_node, "FriendlyName" ); /* <modelName>3Com ADSL 11g</modelName> <modelNumber>1.07</modelNumber> <modelURL>http://www.3com.com/</modelURL> */ model_name = getOptionalField( device_node, "modelName" ); model_number = getOptionalField( device_node, "modelNumber"); model_url = getOptionalField( device_node, "modelURL"); boolean interested = device_type.equalsIgnoreCase( "urn:schemas-upnp-org:device:WANConnectionDevice:1" ); root_device.getUPnP().log( indent + friendly_name + (interested?" *":"")); SimpleXMLParserDocumentNode service_list = device_node.getChild( "ServiceList" ); if ( service_list != null ){ SimpleXMLParserDocumentNode[] service_nodes = service_list.getChildren(); for (int i=0;i<service_nodes.length;i++){ services.add( new UPnPServiceImpl( this, indent + " ", service_nodes[i])); } } SimpleXMLParserDocumentNode dev_list = device_node.getChild( "DeviceList" ); if ( dev_list != null ){ SimpleXMLParserDocumentNode[] device_nodes = dev_list.getChildren(); for (int i=0;i<device_nodes.length;i++){ devices.add( new UPnPDeviceImpl( root_device, indent + " ", device_nodes[i])); } }
root_device.clearRelativeBaseURL();
return( root_device.getAbsoluteURL(url));
return( device_type );
return( friendly_name );
return( root_device.getLocalAddress());
SimpleXMLParserDocumentNode child = node.getChild(name); if ( child == null ){ root_device.getUPnP().log( "Mandatory field '" + name + "' is missing" ); return( "<missing field '" + name + "'>" ); } return( child.getValue().trim());
return( model_url );
return( model_name );
return( model_number );
SimpleXMLParserDocumentNode child = node.getChild(name); if ( child == null ){ return( null); } return( child.getValue().trim());
return( root_device );
UPnPService[] res = new UPnPService[services.size()]; services.toArray( res ); return( res );
UPnPDevice[] res = new UPnPDevice[devices.size()]; devices.toArray( res ); return( res );
return( (UPnPImpl)root_device.getUPnP());
root_device.restoreRelativeBaseURL();