Listing Allowed Values for StateVariables

  • Anonymous - 2004-03-26

    Hi All,
    I am woundering if there is a way to retrieve a list of allowed values for a state variable, or the allowed range of values for a state variable. I am developing a dynamic interface for devices and would like to use these values in generating input fields.

    • Satoshi Konno

      Satoshi Konno - 2004-03-28

      Hi Adavy,

      Currently, CyberLink has no the functions to get the allowed values.

      However, I added the functions now. Please repleace the following files in org.cybergarage.upnp package using

      Please see the following sample, and check it :-)

      Action powerAction = ....
              Argument powerArg = getPowerAction.getArgument("Power");
              StateVariable powerState = powerArg.getRelatedStateVariable();
              AllowedValueList allowList = powerState.getAllowedValueList();
              for (int n=0; n<allowList.size(); n++)
                  System.out.println("[" + n + "] = " + allowList.getAllowedValue(n));
              AllowedValueRange allowRange = powerState.getAllowedValueRange();
              System.out.println("maximum = " + allowRange.getMaximum());
              System.out.println("minimum = " + allowRange.getMinimum());
              System.out.println("step = " + allowRange.getStep());

    • Anonymous - 2004-04-01

      Exactly what I needed.

    • Anonymous - 2004-04-02

      Should there be an updated StateVariable class too. From what I can see the StateVariavle class does not contain the method getAllowedValueRange().


Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

No, thanks