/** * Add the StateVariable to the service.<br> * <br> * Note: This method should be used to create a dynamic<br> * Device withtout writing any XML that describe the device<br> * . <br> * Note: that no control for duplicate StateVariable is done. * * @param var StateVariable that will be added * @author Stefano "Kismet" Lenzi - [email protected] - 2005 */ public void addStateVariable(StateVariable var) { // TODO Some test are done not stable Node stateTableNode = getSCPDNode().getNode(ServiceStateTable.ELEM_NAME); if (stateTableNode == null) { stateTableNode = new Node(ServiceStateTable.ELEM_NAME); /* * Force the node <serviceStateTable> to be the first node inside <scpd> */ // getSCPDNode().insertNode(stateTableNode,0); getSCPDNode().addNode(stateTableNode); } var.setServiceNode(getServiceNode()); stateTableNode.addNode(var.getStateVariableNode()); }