Work at SourceForge, help us to make it a better place! We have an immediate need for a Support Technician in our San Francisco or Denver office.

Close

Toubles with listening on events

Help
2010-05-20
2013-05-02
  • Hi,

    First of all, many thanks for this project, it is very interesting and useful as UPnP trends to be implemented in more and more daily devices.

    Thus, I have troubles with the eventing part. I'm using cyberlink to control and monitor devices. For example, I want to trigger actions such as play, pause… on a MediaRenderer device, and I want to be notified about the state of the device (is it mute ? has the volume changed ?)….

    I had tried to use the ControlPoint:subscribe method, but it failed, whereas working with the Intel device spy, i'm able to receive events. Debugging indicates a "precondition not met" message. Looking the code, I've seen that ControlPoint:subscribe sends a subscriptionRenew request, shouldn't it be a simple subscription request ?

    Best Regards,

    Mathieu

     
  • Satoshi Konno
    Satoshi Konno
    2010-06-03

    Hi Mathieu,

    Do you want to subscribe events of UPnP/AV Media Renderer ?

    Please tell me the services and state variable names.
    I will check your problem in my home :-)

     
  • Hi,

    Yes, right now, I'm trying to retrieve UPnP/AV Media Renderer events, with both Intel's SDK implementation and Sonos products. There is just one evented variable : LastChange, which contains XML contents.

    But I'm not sure this problem is dependent of the service, I will try with other products. I made my own "subscriber" based on the current implementation, and it works. Here is my code :

      public boolean subscribe(Service service, String string) {
        if(service != null) {
          SubscriptionRequest subReq = new SubscriptionRequest();
          subReq.setSubscribeRequest(service, "http://192.168.1.214:" + this.ctrl.getHTTPPort() + this.ctrl.getEventSubURI(), Subscription.INFINITE_VALUE);
          //subReq.setRenewRequest(service, uuid, timeout);
          if (Debug.isOn() == true)
            subReq.print();
          SubscriptionResponse subRes = subReq.post();
          if (Debug.isOn() == true)
            subRes.print();
          if (subRes.isSuccessful() == true) {
            service.setSID(subRes.getSID());
            service.setTimeout(subRes.getTimeout());
            return true;
          }
          service.clearSID();
        }
        return false;
      }