}
}
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);