public void addCommandPolling ( final String commandName , final int pollingPeriod ) throws DevFailed { checkPollingLimits ( commandName , pollingPeriod , minCommandPolling ) ; final CommandImpl command = CommandGetter . getCommand ( commandName , commandList ) ; if ( ! command . getName ( ) . equals ( DeviceImpl . INIT_CMD ) && command . getInType ( ) . equals ( CommandTangoType . VOID ) ) { command . configurePolling ( pollingPeriod ) ; if ( command . getName ( ) . equals ( DeviceImpl . STATE_NAME ) || command . getName ( ) . equals ( DeviceImpl . STATUS_NAME ) ) { // command is also set as polled final AttributeImpl attribute = AttributeGetterSetter . getAttribute ( command . getName ( ) , attributeList ) ; attribute . configurePolling ( pollingPeriod ) ; pollAttributes . put ( attribute . getName ( ) . toLowerCase ( Locale . ENGLISH ) , pollingPeriod ) ; cacheManager . startStateStatusPolling ( command , attribute ) ; pollAttributes . put ( attribute . getName ( ) . toLowerCase ( Locale . ENGLISH ) , pollingPeriod ) ; savePollingConfig ( ) ; } else { cacheManager . startCommandPolling ( command ) ; } } }
Add command polling . Init command cannot be polled . Only command with parameter void can be polled