Package org.cybergarage.upnp

Examples of org.cybergarage.upnp.StateVariable


                }
      }     
     
      UPnPStateVariable[] vars = services[i].getStateVariables();
      for (int j = 0; j < vars.length; j++) {
        StateVariable var = new StateVariable();
        var.setDataType(vars[j].getUPnPDataType());
        var.setName(vars[j].getName());
        var.setSendEvents(vars[j].sendsEvents());
        String[] values = vars[j].getAllowedValues();
        if(values!=null){
          AllowedValueList avl = new AllowedValueList(values);
          var.setAllowedValueList(avl);
        }else if(vars[j].getMaximum()!= null){
          AllowedValueRange avr = new AllowedValueRange(
              vars[j].getMaximum(),
              vars[j].getMinimum(),
              vars[j].getStep()
            );
          var.setAllowedValueRange(avr);
        }
        if(vars[j].getDefaultValue()!=null)
          try {
            var.setDefaultValue(Converter.toString(
                vars[j].getDefaultValue(),vars[j].getUPnPDataType()
              ));
          } catch (Exception ignored) {
          }
        ser.addStateVariable(var);       
View Full Code Here


      for (int i = 0; i < services.size(); i++) {
        Service service = (Service) services.elementAt(i);
        ServiceStateTable vars = service.getServiceStateTable();
        for (int j = 0; j < vars.size(); j++) {
          StateVariable var = (StateVariable) vars.elementAt(j);
          if (var.isSendEvents()) {
            eventedSers.add(service);
            break;
          }
        }
      }
View Full Code Here

    }
    Service s = dAux.getService(serviceId);
    // fix 2/9/2004 francesco
    Enumeration e = events.keys();
    while (e.hasMoreElements()) {
            StateVariable sv;
            String dataType;
            String name;
            Object key = e.nextElement();
            if(key instanceof String){
                name=(String) key;
                sv=s.getStateVariable(name);
                dataType=sv.getDataType();
            }else{
                Activator.logger.ERROR(deviceId + " notified the change in the StateVariable of "
                                       + serviceId + " but the key Java type contained in the Dictiories was "
                                       + key.getClass().getName() + " instead of " + String.class.getName()
                                       + " as specified by Javadoc");
                continue;
            }
           
      try {
        sv.setValue(Converter.toString(events.get(key),dataType));
      } catch (Exception ignored) {
                Activator.logger.ERROR("UPnP Base Driver Exporter: error converting datatype while sending event, exception message follows:"+ignored.getMessage());
      }
    }
  }
View Full Code Here

      for (int i = 0; i < services.size(); i++) {
        Service service = (Service) services.elementAt(i);
        ServiceStateTable vars = service.getServiceStateTable();
        for (int j = 0; j < vars.size(); j++) {
          StateVariable var = (StateVariable) vars.elementAt(j);
          if (var.isSendEvents()) {
            eventedSers.add(service);
            break;
          }
        }
      }
View Full Code Here

                }
      }     
     
      UPnPStateVariable[] vars = services[i].getStateVariables();
      for (int j = 0; j < vars.length; j++) {
        StateVariable var = new StateVariable();
        var.setDataType(vars[j].getUPnPDataType());
        var.setName(vars[j].getName());
        var.setSendEvents(vars[j].sendsEvents());
        String[] values = vars[j].getAllowedValues();
        if(values!=null){
          AllowedValueList avl = new AllowedValueList(values);
          var.setAllowedValueList(avl);
        }else if(vars[j].getMaximum()!= null){
          AllowedValueRange avr = new AllowedValueRange(
              vars[j].getMaximum(),
              vars[j].getMinimum(),
              vars[j].getStep()
            );
          var.setAllowedValueRange(avr);
        }
        if(vars[j].getDefaultValue()!=null)
          try {
            var.setDefaultValue(Converter.toString(
                vars[j].getDefaultValue(),vars[j].getUPnPDataType()
              ));
          } catch (Exception ignored) {
          }
        ser.addStateVariable(var);       
View Full Code Here

      actions.put(act.getName(), new UPnPActionImpl(act,this));
    }
    /*StateVariable*/
    ServiceStateTable stateTable=service.getServiceStateTable();
    for(int i=0;i<stateTable.size();i++){
      StateVariable var= stateTable.getStateVariable(i);
      stateVariables.put(var.getName(),new UPnPStateVariableImpl(var));
    }
 
 
  } /*
 
View Full Code Here

TOP

Related Classes of org.cybergarage.upnp.StateVariable

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.