Skip to content
Snippets Groups Projects
Select Git revision
  • 7b3e64ff8db0391a464f53038768c7d52fd006ad
  • master default
  • simulated_grasping
  • v1.0
4 results

README.md

Blame
  • writeDefinition.mustache 795 B
      private String {{parentTypeName}}.{{writeTopic}} = null;
      private byte[] {{parentTypeName}}.{{lastValue}} = null;
    
      public void {{parentTypeName}}.{{connectMethod}}(String topic, boolean writeCurrentValue) {
        {{writeTopic}} = topic;
        {{updateMethod}}();
        if (writeCurrentValue) {
          {{writeMethod}}();
        }
      }
    
      protected boolean {{parentTypeName}}.{{updateMethod}}() {
        {{tokenResetMethod}}();
        {{> mappingApplication}}
        {{lastValue}} = {{lastResult}};
        return true;
      }
    
      protected void {{parentTypeName}}.{{writeMethod}}() {
        {{#loggingEnabledForWrites}}
        System.out.println("[Write] {{TokenName}} = " + get{{TokenName}}() + " -> {{writeTopic}});
        {{/loggingEnabledForWrites}}
        {{mqttUpdateAttribute}}().publish({{writeTopic}}, {{lastValue}});
      }