Exemple #1
0
  public void byebye(String bindAddr) {
    // 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);
  }
Exemple #2
0
  public void announce(String bindAddr) {
    // uuid:device-UUID::urn:schemas-upnp-org:service:serviceType:v
    Device rootDev = getRootDevice();
    String devLocation = rootDev.getLocationURL(bindAddr);
    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);
  }