當前位置: 首頁>>代碼示例>>Java>>正文


Java UDADeviceType類代碼示例

本文整理匯總了Java中org.teleal.cling.model.types.UDADeviceType的典型用法代碼示例。如果您正苦於以下問題:Java UDADeviceType類的具體用法?Java UDADeviceType怎麽用?Java UDADeviceType使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


UDADeviceType類屬於org.teleal.cling.model.types包,在下文中一共展示了UDADeviceType類的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: searchDevices

import org.teleal.cling.model.types.UDADeviceType; //導入依賴的package包/類
public void searchDevices(final OnSearchDeviceCallback callback) {
	if (ActionHandler.isAlive())
		ActionHandler.getHandler().post(new Runnable() {

			@Override
			public void run() {
				if (service == null) {
					service = ServiceManager.getService();
				}
				service.getRegistry().addListener(listener);
				DeviceManager.this.callback = callback;
				UDADeviceType udaType = new UDADeviceType("MediaRenderer");
				service.getControlPoint().search(
						new UDADeviceTypeHeader(udaType));
			}
		});
}
 
開發者ID:jasoncn90,項目名稱:dlna-for-android,代碼行數:18,代碼來源:DeviceManager.java

示例2: createDevice

import org.teleal.cling.model.types.UDADeviceType; //導入依賴的package包/類
@SuppressWarnings({ "unchecked", "rawtypes" })
public LocalDevice createDevice() throws ValidationException,
		LocalServiceBindingException {
	DeviceType type = new UDADeviceType("MediaServer", 1);

	DeviceDetails details = new DeviceDetails("MediaServer v1",
			new ManufacturerDetails("XXXXX��˾", "http://www.idaoben.com/"),
			new ModelDetails("MediaServer v1", "A simple media server.",
					"v1"));

	LocalService contentDirectory = new AnnotationLocalServiceBinder()
			.read(ContentDirectory.class);
	contentDirectory
			.setManager(new DefaultServiceManager<ContentDirectory>(
					contentDirectory, null) {
				@Override
				protected ContentDirectory createServiceInstance()
						throws Exception {
					return new ContentDirectory();
				}
			});

	LocalService connectionManager = new AnnotationLocalServiceBinder()
			.read(ConnectionManagerService.class);
	connectionManager
			.setManager(new DefaultServiceManager<ConnectionManagerService>(
					connectionManager, ConnectionManagerService.class));

	return new LocalDevice(new DeviceIdentity(udn), type, details,
			createDefaultDeviceIcon(), new LocalService[] {
					connectionManager, contentDirectory });
}
 
開發者ID:jasoncn90,項目名稱:dlna-for-android,代碼行數:33,代碼來源:MediaServer.java

示例3: createDevice

import org.teleal.cling.model.types.UDADeviceType; //導入依賴的package包/類
LocalDevice createDevice()
            throws ValidationException, LocalServiceBindingException, IOException {

        DeviceIdentity identity =
                new DeviceIdentity(
                        UDN.uniqueSystemIdentifier("CMU Cloudlet Server")
                );

        DeviceType type =
                new UDADeviceType("CloudletServer", 1);

        DeviceDetails details =
                new DeviceDetails(
                        "CMU Cloudlet Service",
                        new ManufacturerDetails("CMU"),
                        new ModelDetails(
                                "Cloudlet V1.0",
                                "A Demo Cloudlet Server",
                                "v1"
                        )
                );

//        Icon icon =new Icon( "image/png", 48, 48, 8, getClass().getResource("icon.png"));

        LocalService<GabrielService> gabrielService = new AnnotationLocalServiceBinder().read(GabrielService.class);

        gabrielService.setManager(
                new DefaultServiceManager(gabrielService, GabrielService.class)
        );

        return new LocalDevice(identity, type, details, gabrielService);

        /* Several services can be bound to the same device:
        return new LocalDevice(
                identity, type, details, icon,
                new LocalService[] {switchPowerService, myOtherService}
        );
        */
        
    }
 
開發者ID:cmusatyalab,項目名稱:gabriel,代碼行數:41,代碼來源:GabrielUPnPServer.java

示例4: remoteDeviceAdded

import org.teleal.cling.model.types.UDADeviceType; //導入依賴的package包/類
@Override
public void remoteDeviceAdded(Registry registry, final RemoteDevice device) {
   	if (device.findDevices(new UDADeviceType("MediaRenderer")).length > 0) {
   		logger.log(Level.INFO, "Adding remote device: " + device.getDetails().getFriendlyName() + "UUID: " + device.getIdentity().getUdn().toString());
   		final DeviceListItem deviceItem = adaptDevice(device);
   		SwingUtilities.invokeLater(new Runnable() {
   			@Override
   			public void run() {
   	    		listModel.addElement(deviceItem);
   			}
   		});
       }
}
 
開發者ID:Douglas6,項目名稱:pipoint,代碼行數:14,代碼來源:DlnaRendererManager.java

示例5: refreshDevices

import org.teleal.cling.model.types.UDADeviceType; //導入依賴的package包/類
@Override
public void refreshDevices() {
   	UDADeviceType deviceType = new UDADeviceType ("MediaRenderer");
	controlPoint.search(new UDADeviceTypeHeader(deviceType));
}
 
開發者ID:Douglas6,項目名稱:pipoint,代碼行數:6,代碼來源:DlnaRendererManager.java


注:本文中的org.teleal.cling.model.types.UDADeviceType類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。