Package net.sbbi.upnp

Examples of net.sbbi.upnp.ServicesEventing


     
    }
    else
    {
      counter++;
      ServicesEventing instance = ServicesEventing.getInstance();
      try {
     
        instance.unRegister(avtService, handler);
      instance.register( avtService, handler, 86400 );
    } catch (IOException e) {
      // TODO Auto-generated catch block
      e.printStackTrace();
    }
    }
View Full Code Here


    fakecounter = 1;
    pausexml = "";
   
    pausestring = "<TransportState val=\"PAUSED_PLAYBACK\"/>";
   
    ServicesEventing instance = ServicesEventing.getInstance();
    handler = new SonosScraper();
    instance.setDaemon( false );
    // let's find a device
     
      UPNPRootDevice[] devices;
      try {
        devices = Discovery.discover(Constants.SONOS_DEVICE_TYPE);
        if (devices != null) {
          for (UPNPRootDevice device : devices) {
           System.out.println("Device found: " + device.getFriendlyName());
          }
        } else {
          System.out.println("No devices found");
        }
      // System.out.println( devices[0].getChildDevice(Constants.MEDIA_RENDERER_DEVICE_TYPE).getFriendlyName());
       

    if ( devices != null ) {
     
      mrDevice = (UPNPDevice)devices[0].getChildDevice(Constants.MEDIA_RENDERER_DEVICE_TYPE);
      avtService = (UPNPService)mrDevice.getService(Constants.SONOS_SERVICE_AV_TRANSPORT);
     
      System.out.println(avtService.getServiceId());
     
     
     
      try {
        int duration = instance.register( avtService, handler, 86400 );
      
      //  ServiceEventSubscription sub=  instance.registerEvent(avtService, handler, -1);
       
       
        if ( duration != -1 ) {
View Full Code Here

TOP

Related Classes of net.sbbi.upnp.ServicesEventing

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.