Package org.cybergarage.upnp.ssdp

Examples of org.cybergarage.upnp.ssdp.SSDPNotifyRequest


  public void announce(String bindAddr) {
    String devLocation = getLocationURL(bindAddr);

    SSDPNotifySocket ssdpSock = new SSDPNotifySocket(bindAddr);

    SSDPNotifyRequest ssdpReq = new SSDPNotifyRequest();
    ssdpReq.setServer(UPnP.getServerName());
    ssdpReq.setLeaseTime(getLeaseTime());
    ssdpReq.setLocation(devLocation);
    ssdpReq.setNTS(NTS.ALIVE);
    ssdpReq.setBootId(getBootId());

    // uuid:device-UUID(::upnp:rootdevice)*
    if (isRootDevice() == true) {
      String devNT = getNotifyDeviceNT();
      String devUSN = getNotifyDeviceUSN();
      ssdpReq.setNT(devNT);
      ssdpReq.setUSN(devUSN);
      ssdpSock.post(ssdpReq);

      String devUDN = getUDN();
      ssdpReq.setNT(devUDN);
      ssdpReq.setUSN(devUDN);
      ssdpSock.post(ssdpReq);
    }

    // uuid:device-UUID::urn:schemas-upnp-org:device:deviceType:v
    String devNT = getNotifyDeviceTypeNT();
    String devUSN = getNotifyDeviceTypeUSN();
    ssdpReq.setNT(devNT);
    ssdpReq.setUSN(devUSN);
    ssdpSock.post(ssdpReq);

    // Thanks for Mikael Hakman (04/25/05)
    ssdpSock.close();

View Full Code Here


  }

  public void byebye(String bindAddr) {
    SSDPNotifySocket ssdpSock = new SSDPNotifySocket(bindAddr);

    SSDPNotifyRequest ssdpReq = new SSDPNotifyRequest();
    ssdpReq.setNTS(NTS.BYEBYE);

    // uuid:device-UUID(::upnp:rootdevice)*
    if (isRootDevice() == true) {
      String devNT = getNotifyDeviceNT();
      String devUSN = getNotifyDeviceUSN();
      ssdpReq.setNT(devNT);
      ssdpReq.setUSN(devUSN);
      ssdpSock.post(ssdpReq);
    }

    // uuid:device-UUID::urn:schemas-upnp-org:device:deviceType:v
    String devNT = getNotifyDeviceTypeNT();
    String devUSN = getNotifyDeviceTypeUSN();
    ssdpReq.setNT(devNT);
    ssdpReq.setUSN(devUSN);
    ssdpSock.post(ssdpReq);

    // Thanks for Mikael Hakman (04/25/05)
    ssdpSock.close();

View Full Code Here

    String serviceNT = getNotifyServiceTypeNT();     
    String serviceUSN = getNotifyServiceTypeUSN();

    Device dev = getDevice();
   
    SSDPNotifyRequest ssdpReq = new SSDPNotifyRequest();
    ssdpReq.setServer(UPnP.getServerName());
    ssdpReq.setLeaseTime(dev.getLeaseTime());
    ssdpReq.setLocation(devLocation);
    ssdpReq.setNTS(NTS.ALIVE);
    ssdpReq.setNT(serviceNT);
    ssdpReq.setUSN(serviceUSN);

    SSDPNotifySocket ssdpSock = new SSDPNotifySocket(bindAddr);
    Device.notifyWait();
    ssdpSock.post(ssdpReq);
  }
View Full Code Here

    // uuid:device-UUID::urn:schemas-upnp-org:service:serviceType:v
   
    String devNT = getNotifyServiceTypeNT();     
    String devUSN = getNotifyServiceTypeUSN();
   
    SSDPNotifyRequest ssdpReq = new SSDPNotifyRequest();
    ssdpReq.setNTS(NTS.BYEBYE);
    ssdpReq.setNT(devNT);
    ssdpReq.setUSN(devUSN);

    SSDPNotifySocket ssdpSock = new SSDPNotifySocket(bindAddr);
    Device.notifyWait();
    ssdpSock.post(ssdpReq);
  }
View Full Code Here

TOP

Related Classes of org.cybergarage.upnp.ssdp.SSDPNotifyRequest

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.