/**
 * Copyright (c) 2010-2020 Contributors to the openHAB project
 *
 * See the NOTICE file(s) distributed with this work for additional
 * information.
 *
 * This program and the accompanying materials are made available under the
 * terms of the Eclipse Public License 2.0 which is available at
 * http://www.eclipse.org/legal/epl-2.0
 *
 * SPDX-License-Identifier: EPL-2.0
 */

 /* ***********************************************************
 * This file was automatically generated on 2022-01-03.      *
 *                                                           *
 * openHAB Bindings Version 2.0.0                            *
 *                                                           *
 * If you have a bugfix for this file and want to commit it, *
 * please fix the bug in the generator. You can find a link  *
 * to the generators git repository on tinkerforge.com       *
 *************************************************************/

package org.openhab.binding.tinkerforge.internal.device;

import org.eclipse.jdt.annotation.NonNullByDefault;
import org.eclipse.jdt.annotation.Nullable;
import org.eclipse.jdt.annotation.NonNull;
import org.openhab.binding.tinkerforge.internal.handler.DeviceHandler;
import org.eclipse.smarthome.core.thing.Thing;
import org.eclipse.smarthome.core.thing.binding.ThingActions;
import org.eclipse.smarthome.core.thing.binding.ThingActionsScope;
import org.eclipse.smarthome.core.thing.binding.ThingHandler;
import org.eclipse.smarthome.core.types.RefreshType;
import org.eclipse.smarthome.core.thing.ChannelUID;
import org.openhab.core.automation.annotation.ActionInput;
import org.openhab.core.automation.annotation.ActionOutput;
import org.openhab.core.automation.annotation.RuleAction;

import java.lang.reflect.Method;
import java.lang.reflect.Proxy;

import java.util.Map;
import java.util.HashMap;

import com.tinkerforge.TinkerforgeException;
import com.tinkerforge.BrickSilentStepper;

/**
 * Passes through actions of the Silent Stepper Brick.
 * @author Erik Fleckstein - Initial contribution
 */
@ThingActionsScope(name = "tinkerforge")
@NonNullByDefault
public class BrickSilentStepperActions implements ThingActions, IBrickSilentStepperActions {

    private @Nullable DeviceHandler handler;

    @Override
    public void setThingHandler(@Nullable ThingHandler handler) { this.handler = (DeviceHandler) handler; }

    @Override
    public @Nullable ThingHandler getThingHandler() { return handler; }

    private static IBrickSilentStepperActions invokeMethodOf(@Nullable ThingActions actions) {
        if (actions == null) {
            throw new IllegalArgumentException("actions cannot be null");
        }
        if (actions.getClass().getName().equals(BrickSilentStepperActions.class.getName())) {
            if (actions instanceof IBrickSilentStepperActions) {
                return (IBrickSilentStepperActions) actions;
            } else {
                return (IBrickSilentStepperActions) Proxy.newProxyInstance(IBrickSilentStepperActions.class.getClassLoader(),
                        new Class[] { IBrickSilentStepperActions.class }, (Object proxy, Method method, Object[] args) -> {
                            Method m = actions.getClass().getDeclaredMethod(method.getName(),
                                    method.getParameterTypes());
                            return m.invoke(actions, args);
                        });
            }
        }
        throw new IllegalArgumentException("Actions is not an instance of BrickSilentStepperActions");
    }

        @Override
    @RuleAction(label = "Set Max Velocity")
    public void brickSilentStepperSetMaxVelocity(
            @ActionInput(name = "velocity") int velocity) throws TinkerforgeException {
        DeviceHandler h = handler;
        if(h == null) {
            return;
        }
        
        @Nullable BrickSilentStepperWrapper dev = ((@Nullable BrickSilentStepperWrapper)h.getDevice());
        if(dev == null) {
            return;
        }
        dev.setMaxVelocity(velocity);
        
    }

    public static void brickSilentStepperSetMaxVelocity(@Nullable ThingActions actions, int velocity) throws TinkerforgeException {
        invokeMethodOf(actions).brickSilentStepperSetMaxVelocity(velocity);
    }


    @Override
    @RuleAction(label = "Get Max Velocity")
    public @ActionOutput(name = "velocity", type="int")
           Map<String, Object> brickSilentStepperGetMaxVelocity(
            ) throws TinkerforgeException {
        Map<String, Object> result = new HashMap<>();
        DeviceHandler h = handler;
        if(h == null) {
            return result;
        }
        
        @Nullable BrickSilentStepperWrapper dev = ((@Nullable BrickSilentStepperWrapper)h.getDevice());
        if(dev == null) {
            return result;
        }

        int value = dev.getMaxVelocity();
        
        result.put("velocity", value);
        return result;
    }

    public static Map<String, Object> brickSilentStepperGetMaxVelocity(@Nullable ThingActions actions) throws TinkerforgeException {
        return invokeMethodOf(actions).brickSilentStepperGetMaxVelocity();
    }


    @Override
    @RuleAction(label = "Get Current Velocity")
    public @ActionOutput(name = "velocity", type="int")
           Map<String, Object> brickSilentStepperGetCurrentVelocity(
            ) throws TinkerforgeException {
        Map<String, Object> result = new HashMap<>();
        DeviceHandler h = handler;
        if(h == null) {
            return result;
        }
        
        @Nullable BrickSilentStepperWrapper dev = ((@Nullable BrickSilentStepperWrapper)h.getDevice());
        if(dev == null) {
            return result;
        }

        int value = dev.getCurrentVelocity();
        
        result.put("velocity", value);
        return result;
    }

    public static Map<String, Object> brickSilentStepperGetCurrentVelocity(@Nullable ThingActions actions) throws TinkerforgeException {
        return invokeMethodOf(actions).brickSilentStepperGetCurrentVelocity();
    }

    @Override
    @RuleAction(label = "Set Speed Ramping")
    public void brickSilentStepperSetSpeedRamping(
            @ActionInput(name = "acceleration") int acceleration,
            @ActionInput(name = "deacceleration") int deacceleration) throws TinkerforgeException {
        DeviceHandler h = handler;
        if(h == null) {
            return;
        }
        
        @Nullable BrickSilentStepperWrapper dev = ((@Nullable BrickSilentStepperWrapper)h.getDevice());
        if(dev == null) {
            return;
        }
        dev.setSpeedRamping(acceleration, deacceleration);
        
    }

    public static void brickSilentStepperSetSpeedRamping(@Nullable ThingActions actions, int acceleration, int deacceleration) throws TinkerforgeException {
        invokeMethodOf(actions).brickSilentStepperSetSpeedRamping(acceleration, deacceleration);
    }


    @Override
    @RuleAction(label = "Get Speed Ramping")
    public @ActionOutput(name = "acceleration", type="int")
           @ActionOutput(name = "deacceleration", type="int")
           Map<String, Object> brickSilentStepperGetSpeedRamping(
            ) throws TinkerforgeException {
        Map<String, Object> result = new HashMap<>();
        DeviceHandler h = handler;
        if(h == null) {
            return result;
        }
        
        @Nullable BrickSilentStepperWrapper dev = ((@Nullable BrickSilentStepperWrapper)h.getDevice());
        if(dev == null) {
            return result;
        }

        BrickSilentStepper.SpeedRamping value = dev.getSpeedRamping();
        
        result.put("acceleration", value.acceleration);
        result.put("deacceleration", value.deacceleration);
        return result;
    }

    public static Map<String, Object> brickSilentStepperGetSpeedRamping(@Nullable ThingActions actions) throws TinkerforgeException {
        return invokeMethodOf(actions).brickSilentStepperGetSpeedRamping();
    }

    @Override
    @RuleAction(label = "Full Brake")
    public void brickSilentStepperFullBrake(
            ) throws TinkerforgeException {
        DeviceHandler h = handler;
        if(h == null) {
            return;
        }
        
        @Nullable BrickSilentStepperWrapper dev = ((@Nullable BrickSilentStepperWrapper)h.getDevice());
        if(dev == null) {
            return;
        }
        dev.fullBrake();
        
    }

    public static void brickSilentStepperFullBrake(@Nullable ThingActions actions) throws TinkerforgeException {
        invokeMethodOf(actions).brickSilentStepperFullBrake();
    }

    @Override
    @RuleAction(label = "Set Steps")
    public void brickSilentStepperSetSteps(
            @ActionInput(name = "steps") int steps) throws TinkerforgeException {
        DeviceHandler h = handler;
        if(h == null) {
            return;
        }
        
        @Nullable BrickSilentStepperWrapper dev = ((@Nullable BrickSilentStepperWrapper)h.getDevice());
        if(dev == null) {
            return;
        }
        dev.setSteps(steps);
        
    }

    public static void brickSilentStepperSetSteps(@Nullable ThingActions actions, int steps) throws TinkerforgeException {
        invokeMethodOf(actions).brickSilentStepperSetSteps(steps);
    }


    @Override
    @RuleAction(label = "Get Steps")
    public @ActionOutput(name = "steps", type="int")
           Map<String, Object> brickSilentStepperGetSteps(
            ) throws TinkerforgeException {
        Map<String, Object> result = new HashMap<>();
        DeviceHandler h = handler;
        if(h == null) {
            return result;
        }
        
        @Nullable BrickSilentStepperWrapper dev = ((@Nullable BrickSilentStepperWrapper)h.getDevice());
        if(dev == null) {
            return result;
        }

        int value = dev.getSteps();
        
        result.put("steps", value);
        return result;
    }

    public static Map<String, Object> brickSilentStepperGetSteps(@Nullable ThingActions actions) throws TinkerforgeException {
        return invokeMethodOf(actions).brickSilentStepperGetSteps();
    }


    @Override
    @RuleAction(label = "Get Remaining Steps")
    public @ActionOutput(name = "steps", type="int")
           Map<String, Object> brickSilentStepperGetRemainingSteps(
            ) throws TinkerforgeException {
        Map<String, Object> result = new HashMap<>();
        DeviceHandler h = handler;
        if(h == null) {
            return result;
        }
        
        @Nullable BrickSilentStepperWrapper dev = ((@Nullable BrickSilentStepperWrapper)h.getDevice());
        if(dev == null) {
            return result;
        }

        int value = dev.getRemainingSteps();
        
        result.put("steps", value);
        return result;
    }

    public static Map<String, Object> brickSilentStepperGetRemainingSteps(@Nullable ThingActions actions) throws TinkerforgeException {
        return invokeMethodOf(actions).brickSilentStepperGetRemainingSteps();
    }

    @Override
    @RuleAction(label = "Drive Forward")
    public void brickSilentStepperDriveForward(
            ) throws TinkerforgeException {
        DeviceHandler h = handler;
        if(h == null) {
            return;
        }
        
        @Nullable BrickSilentStepperWrapper dev = ((@Nullable BrickSilentStepperWrapper)h.getDevice());
        if(dev == null) {
            return;
        }
        dev.driveForward();
        
    }

    public static void brickSilentStepperDriveForward(@Nullable ThingActions actions) throws TinkerforgeException {
        invokeMethodOf(actions).brickSilentStepperDriveForward();
    }

    @Override
    @RuleAction(label = "Drive Backward")
    public void brickSilentStepperDriveBackward(
            ) throws TinkerforgeException {
        DeviceHandler h = handler;
        if(h == null) {
            return;
        }
        
        @Nullable BrickSilentStepperWrapper dev = ((@Nullable BrickSilentStepperWrapper)h.getDevice());
        if(dev == null) {
            return;
        }
        dev.driveBackward();
        
    }

    public static void brickSilentStepperDriveBackward(@Nullable ThingActions actions) throws TinkerforgeException {
        invokeMethodOf(actions).brickSilentStepperDriveBackward();
    }

    @Override
    @RuleAction(label = "Stop")
    public void brickSilentStepperStop(
            ) throws TinkerforgeException {
        DeviceHandler h = handler;
        if(h == null) {
            return;
        }
        
        @Nullable BrickSilentStepperWrapper dev = ((@Nullable BrickSilentStepperWrapper)h.getDevice());
        if(dev == null) {
            return;
        }
        dev.stop();
        
    }

    public static void brickSilentStepperStop(@Nullable ThingActions actions) throws TinkerforgeException {
        invokeMethodOf(actions).brickSilentStepperStop();
    }

    @Override
    @RuleAction(label = "Set Motor Current")
    public void brickSilentStepperSetMotorCurrent(
            @ActionInput(name = "current") int current) throws TinkerforgeException {
        DeviceHandler h = handler;
        if(h == null) {
            return;
        }
        
        @Nullable BrickSilentStepperWrapper dev = ((@Nullable BrickSilentStepperWrapper)h.getDevice());
        if(dev == null) {
            return;
        }
        dev.setMotorCurrent(current);
        
    }

    public static void brickSilentStepperSetMotorCurrent(@Nullable ThingActions actions, int current) throws TinkerforgeException {
        invokeMethodOf(actions).brickSilentStepperSetMotorCurrent(current);
    }


    @Override
    @RuleAction(label = "Get Motor Current")
    public @ActionOutput(name = "current", type="int")
           Map<String, Object> brickSilentStepperGetMotorCurrent(
            ) throws TinkerforgeException {
        Map<String, Object> result = new HashMap<>();
        DeviceHandler h = handler;
        if(h == null) {
            return result;
        }
        
        @Nullable BrickSilentStepperWrapper dev = ((@Nullable BrickSilentStepperWrapper)h.getDevice());
        if(dev == null) {
            return result;
        }

        int value = dev.getMotorCurrent();
        
        result.put("current", value);
        return result;
    }

    public static Map<String, Object> brickSilentStepperGetMotorCurrent(@Nullable ThingActions actions) throws TinkerforgeException {
        return invokeMethodOf(actions).brickSilentStepperGetMotorCurrent();
    }

    @Override
    @RuleAction(label = "Enable")
    public void brickSilentStepperEnable(
            ) throws TinkerforgeException {
        DeviceHandler h = handler;
        if(h == null) {
            return;
        }
        
        @Nullable BrickSilentStepperWrapper dev = ((@Nullable BrickSilentStepperWrapper)h.getDevice());
        if(dev == null) {
            return;
        }
        dev.enable();
        
    }

    public static void brickSilentStepperEnable(@Nullable ThingActions actions) throws TinkerforgeException {
        invokeMethodOf(actions).brickSilentStepperEnable();
    }

    @Override
    @RuleAction(label = "Disable")
    public void brickSilentStepperDisable(
            ) throws TinkerforgeException {
        DeviceHandler h = handler;
        if(h == null) {
            return;
        }
        
        @Nullable BrickSilentStepperWrapper dev = ((@Nullable BrickSilentStepperWrapper)h.getDevice());
        if(dev == null) {
            return;
        }
        dev.disable();
        
    }

    public static void brickSilentStepperDisable(@Nullable ThingActions actions) throws TinkerforgeException {
        invokeMethodOf(actions).brickSilentStepperDisable();
    }


    @Override
    @RuleAction(label = "Is Enabled")
    public @ActionOutput(name = "enabled", type="boolean")
           Map<String, Object> brickSilentStepperIsEnabled(
            ) throws TinkerforgeException {
        Map<String, Object> result = new HashMap<>();
        DeviceHandler h = handler;
        if(h == null) {
            return result;
        }
        
        @Nullable BrickSilentStepperWrapper dev = ((@Nullable BrickSilentStepperWrapper)h.getDevice());
        if(dev == null) {
            return result;
        }

        boolean value = dev.isEnabled();
        
        result.put("enabled", value);
        return result;
    }

    public static Map<String, Object> brickSilentStepperIsEnabled(@Nullable ThingActions actions) throws TinkerforgeException {
        return invokeMethodOf(actions).brickSilentStepperIsEnabled();
    }

    @Override
    @RuleAction(label = "Set Basic Configuration")
    public void brickSilentStepperSetBasicConfiguration(
            @ActionInput(name = "standstillCurrent") int standstillCurrent,
            @ActionInput(name = "motorRunCurrent") int motorRunCurrent,
            @ActionInput(name = "standstillDelayTime") int standstillDelayTime,
            @ActionInput(name = "powerDownTime") int powerDownTime,
            @ActionInput(name = "stealthThreshold") int stealthThreshold,
            @ActionInput(name = "coolstepThreshold") int coolstepThreshold,
            @ActionInput(name = "classicThreshold") int classicThreshold,
            @ActionInput(name = "highVelocityChopperMode") boolean highVelocityChopperMode) throws TinkerforgeException {
        DeviceHandler h = handler;
        if(h == null) {
            return;
        }
        
        @Nullable BrickSilentStepperWrapper dev = ((@Nullable BrickSilentStepperWrapper)h.getDevice());
        if(dev == null) {
            return;
        }
        dev.setBasicConfiguration(standstillCurrent, motorRunCurrent, standstillDelayTime, powerDownTime, stealthThreshold, coolstepThreshold, classicThreshold, highVelocityChopperMode);
        
    }

    public static void brickSilentStepperSetBasicConfiguration(@Nullable ThingActions actions, int standstillCurrent, int motorRunCurrent, int standstillDelayTime, int powerDownTime, int stealthThreshold, int coolstepThreshold, int classicThreshold, boolean highVelocityChopperMode) throws TinkerforgeException {
        invokeMethodOf(actions).brickSilentStepperSetBasicConfiguration(standstillCurrent, motorRunCurrent, standstillDelayTime, powerDownTime, stealthThreshold, coolstepThreshold, classicThreshold, highVelocityChopperMode);
    }


    @Override
    @RuleAction(label = "Get Basic Configuration")
    public @ActionOutput(name = "standstillCurrent", type="int")
           @ActionOutput(name = "motorRunCurrent", type="int")
           @ActionOutput(name = "standstillDelayTime", type="int")
           @ActionOutput(name = "powerDownTime", type="int")
           @ActionOutput(name = "stealthThreshold", type="int")
           @ActionOutput(name = "coolstepThreshold", type="int")
           @ActionOutput(name = "classicThreshold", type="int")
           @ActionOutput(name = "highVelocityChopperMode", type="boolean")
           Map<String, Object> brickSilentStepperGetBasicConfiguration(
            ) throws TinkerforgeException {
        Map<String, Object> result = new HashMap<>();
        DeviceHandler h = handler;
        if(h == null) {
            return result;
        }
        
        @Nullable BrickSilentStepperWrapper dev = ((@Nullable BrickSilentStepperWrapper)h.getDevice());
        if(dev == null) {
            return result;
        }

        BrickSilentStepper.BasicConfiguration value = dev.getBasicConfiguration();
        
        result.put("standstillCurrent", value.standstillCurrent);
        result.put("motorRunCurrent", value.motorRunCurrent);
        result.put("standstillDelayTime", value.standstillDelayTime);
        result.put("powerDownTime", value.powerDownTime);
        result.put("stealthThreshold", value.stealthThreshold);
        result.put("coolstepThreshold", value.coolstepThreshold);
        result.put("classicThreshold", value.classicThreshold);
        result.put("highVelocityChopperMode", value.highVelocityChopperMode);
        return result;
    }

    public static Map<String, Object> brickSilentStepperGetBasicConfiguration(@Nullable ThingActions actions) throws TinkerforgeException {
        return invokeMethodOf(actions).brickSilentStepperGetBasicConfiguration();
    }

    @Override
    @RuleAction(label = "Set Current Position")
    public void brickSilentStepperSetCurrentPosition(
            @ActionInput(name = "position") int position) throws TinkerforgeException {
        DeviceHandler h = handler;
        if(h == null) {
            return;
        }
        
        @Nullable BrickSilentStepperWrapper dev = ((@Nullable BrickSilentStepperWrapper)h.getDevice());
        if(dev == null) {
            return;
        }
        dev.setCurrentPosition(position);
        
    }

    public static void brickSilentStepperSetCurrentPosition(@Nullable ThingActions actions, int position) throws TinkerforgeException {
        invokeMethodOf(actions).brickSilentStepperSetCurrentPosition(position);
    }


    @Override
    @RuleAction(label = "Get Current Position")
    public @ActionOutput(name = "position", type="int")
           Map<String, Object> brickSilentStepperGetCurrentPosition(
            ) throws TinkerforgeException {
        Map<String, Object> result = new HashMap<>();
        DeviceHandler h = handler;
        if(h == null) {
            return result;
        }
        
        @Nullable BrickSilentStepperWrapper dev = ((@Nullable BrickSilentStepperWrapper)h.getDevice());
        if(dev == null) {
            return result;
        }

        int value = dev.getCurrentPosition();
        
        result.put("position", value);
        return result;
    }

    public static Map<String, Object> brickSilentStepperGetCurrentPosition(@Nullable ThingActions actions) throws TinkerforgeException {
        return invokeMethodOf(actions).brickSilentStepperGetCurrentPosition();
    }

    @Override
    @RuleAction(label = "Set Target Position")
    public void brickSilentStepperSetTargetPosition(
            @ActionInput(name = "position") int position) throws TinkerforgeException {
        DeviceHandler h = handler;
        if(h == null) {
            return;
        }
        
        @Nullable BrickSilentStepperWrapper dev = ((@Nullable BrickSilentStepperWrapper)h.getDevice());
        if(dev == null) {
            return;
        }
        dev.setTargetPosition(position);
        
    }

    public static void brickSilentStepperSetTargetPosition(@Nullable ThingActions actions, int position) throws TinkerforgeException {
        invokeMethodOf(actions).brickSilentStepperSetTargetPosition(position);
    }


    @Override
    @RuleAction(label = "Get Target Position")
    public @ActionOutput(name = "position", type="int")
           Map<String, Object> brickSilentStepperGetTargetPosition(
            ) throws TinkerforgeException {
        Map<String, Object> result = new HashMap<>();
        DeviceHandler h = handler;
        if(h == null) {
            return result;
        }
        
        @Nullable BrickSilentStepperWrapper dev = ((@Nullable BrickSilentStepperWrapper)h.getDevice());
        if(dev == null) {
            return result;
        }

        int value = dev.getTargetPosition();
        
        result.put("position", value);
        return result;
    }

    public static Map<String, Object> brickSilentStepperGetTargetPosition(@Nullable ThingActions actions) throws TinkerforgeException {
        return invokeMethodOf(actions).brickSilentStepperGetTargetPosition();
    }

    @Override
    @RuleAction(label = "Set Step Configuration")
    public void brickSilentStepperSetStepConfiguration(
            @ActionInput(name = "stepResolution") short stepResolution,
            @ActionInput(name = "interpolation") boolean interpolation) throws TinkerforgeException {
        DeviceHandler h = handler;
        if(h == null) {
            return;
        }
        
        @Nullable BrickSilentStepperWrapper dev = ((@Nullable BrickSilentStepperWrapper)h.getDevice());
        if(dev == null) {
            return;
        }
        dev.setStepConfiguration(stepResolution, interpolation);
        
    }

    public static void brickSilentStepperSetStepConfiguration(@Nullable ThingActions actions, short stepResolution, boolean interpolation) throws TinkerforgeException {
        invokeMethodOf(actions).brickSilentStepperSetStepConfiguration(stepResolution, interpolation);
    }


    @Override
    @RuleAction(label = "Get Step Configuration")
    public @ActionOutput(name = "stepResolution", type="short")
           @ActionOutput(name = "interpolation", type="boolean")
           Map<String, Object> brickSilentStepperGetStepConfiguration(
            ) throws TinkerforgeException {
        Map<String, Object> result = new HashMap<>();
        DeviceHandler h = handler;
        if(h == null) {
            return result;
        }
        
        @Nullable BrickSilentStepperWrapper dev = ((@Nullable BrickSilentStepperWrapper)h.getDevice());
        if(dev == null) {
            return result;
        }

        BrickSilentStepper.StepConfiguration value = dev.getStepConfiguration();
        
        result.put("stepResolution", value.stepResolution);
        result.put("interpolation", value.interpolation);
        return result;
    }

    public static Map<String, Object> brickSilentStepperGetStepConfiguration(@Nullable ThingActions actions) throws TinkerforgeException {
        return invokeMethodOf(actions).brickSilentStepperGetStepConfiguration();
    }


    @Override
    @RuleAction(label = "Get Stack Input Voltage")
    public @ActionOutput(name = "voltage", type="int")
           Map<String, Object> brickSilentStepperGetStackInputVoltage(
            ) throws TinkerforgeException {
        Map<String, Object> result = new HashMap<>();
        DeviceHandler h = handler;
        if(h == null) {
            return result;
        }
        
        @Nullable BrickSilentStepperWrapper dev = ((@Nullable BrickSilentStepperWrapper)h.getDevice());
        if(dev == null) {
            return result;
        }

        int value = dev.getStackInputVoltage();
        
        result.put("voltage", value);
        return result;
    }

    public static Map<String, Object> brickSilentStepperGetStackInputVoltage(@Nullable ThingActions actions) throws TinkerforgeException {
        return invokeMethodOf(actions).brickSilentStepperGetStackInputVoltage();
    }


    @Override
    @RuleAction(label = "Get External Input Voltage")
    public @ActionOutput(name = "voltage", type="int")
           Map<String, Object> brickSilentStepperGetExternalInputVoltage(
            ) throws TinkerforgeException {
        Map<String, Object> result = new HashMap<>();
        DeviceHandler h = handler;
        if(h == null) {
            return result;
        }
        
        @Nullable BrickSilentStepperWrapper dev = ((@Nullable BrickSilentStepperWrapper)h.getDevice());
        if(dev == null) {
            return result;
        }

        int value = dev.getExternalInputVoltage();
        
        result.put("voltage", value);
        return result;
    }

    public static Map<String, Object> brickSilentStepperGetExternalInputVoltage(@Nullable ThingActions actions) throws TinkerforgeException {
        return invokeMethodOf(actions).brickSilentStepperGetExternalInputVoltage();
    }

    @Override
    @RuleAction(label = "Set Spreadcycle Configuration")
    public void brickSilentStepperSetSpreadcycleConfiguration(
            @ActionInput(name = "slowDecayDuration") short slowDecayDuration,
            @ActionInput(name = "enableRandomSlowDecay") boolean enableRandomSlowDecay,
            @ActionInput(name = "fastDecayDuration") short fastDecayDuration,
            @ActionInput(name = "hysteresisStartValue") short hysteresisStartValue,
            @ActionInput(name = "hysteresisEndValue") byte hysteresisEndValue,
            @ActionInput(name = "sineWaveOffset") byte sineWaveOffset,
            @ActionInput(name = "chopperMode") short chopperMode,
            @ActionInput(name = "comparatorBlankTime") short comparatorBlankTime,
            @ActionInput(name = "fastDecayWithoutComparator") boolean fastDecayWithoutComparator) throws TinkerforgeException {
        DeviceHandler h = handler;
        if(h == null) {
            return;
        }
        
        @Nullable BrickSilentStepperWrapper dev = ((@Nullable BrickSilentStepperWrapper)h.getDevice());
        if(dev == null) {
            return;
        }
        dev.setSpreadcycleConfiguration(slowDecayDuration, enableRandomSlowDecay, fastDecayDuration, hysteresisStartValue, hysteresisEndValue, sineWaveOffset, chopperMode, comparatorBlankTime, fastDecayWithoutComparator);
        
    }

    public static void brickSilentStepperSetSpreadcycleConfiguration(@Nullable ThingActions actions, short slowDecayDuration, boolean enableRandomSlowDecay, short fastDecayDuration, short hysteresisStartValue, byte hysteresisEndValue, byte sineWaveOffset, short chopperMode, short comparatorBlankTime, boolean fastDecayWithoutComparator) throws TinkerforgeException {
        invokeMethodOf(actions).brickSilentStepperSetSpreadcycleConfiguration(slowDecayDuration, enableRandomSlowDecay, fastDecayDuration, hysteresisStartValue, hysteresisEndValue, sineWaveOffset, chopperMode, comparatorBlankTime, fastDecayWithoutComparator);
    }


    @Override
    @RuleAction(label = "Get Spreadcycle Configuration")
    public @ActionOutput(name = "slowDecayDuration", type="short")
           @ActionOutput(name = "enableRandomSlowDecay", type="boolean")
           @ActionOutput(name = "fastDecayDuration", type="short")
           @ActionOutput(name = "hysteresisStartValue", type="short")
           @ActionOutput(name = "hysteresisEndValue", type="byte")
           @ActionOutput(name = "sineWaveOffset", type="byte")
           @ActionOutput(name = "chopperMode", type="short")
           @ActionOutput(name = "comparatorBlankTime", type="short")
           @ActionOutput(name = "fastDecayWithoutComparator", type="boolean")
           Map<String, Object> brickSilentStepperGetSpreadcycleConfiguration(
            ) throws TinkerforgeException {
        Map<String, Object> result = new HashMap<>();
        DeviceHandler h = handler;
        if(h == null) {
            return result;
        }
        
        @Nullable BrickSilentStepperWrapper dev = ((@Nullable BrickSilentStepperWrapper)h.getDevice());
        if(dev == null) {
            return result;
        }

        BrickSilentStepper.SpreadcycleConfiguration value = dev.getSpreadcycleConfiguration();
        
        result.put("slowDecayDuration", value.slowDecayDuration);
        result.put("enableRandomSlowDecay", value.enableRandomSlowDecay);
        result.put("fastDecayDuration", value.fastDecayDuration);
        result.put("hysteresisStartValue", value.hysteresisStartValue);
        result.put("hysteresisEndValue", value.hysteresisEndValue);
        result.put("sineWaveOffset", value.sineWaveOffset);
        result.put("chopperMode", value.chopperMode);
        result.put("comparatorBlankTime", value.comparatorBlankTime);
        result.put("fastDecayWithoutComparator", value.fastDecayWithoutComparator);
        return result;
    }

    public static Map<String, Object> brickSilentStepperGetSpreadcycleConfiguration(@Nullable ThingActions actions) throws TinkerforgeException {
        return invokeMethodOf(actions).brickSilentStepperGetSpreadcycleConfiguration();
    }

    @Override
    @RuleAction(label = "Set Stealth Configuration")
    public void brickSilentStepperSetStealthConfiguration(
            @ActionInput(name = "enableStealth") boolean enableStealth,
            @ActionInput(name = "amplitude") short amplitude,
            @ActionInput(name = "gradient") short gradient,
            @ActionInput(name = "enableAutoscale") boolean enableAutoscale,
            @ActionInput(name = "forceSymmetric") boolean forceSymmetric,
            @ActionInput(name = "freewheelMode") short freewheelMode) throws TinkerforgeException {
        DeviceHandler h = handler;
        if(h == null) {
            return;
        }
        
        @Nullable BrickSilentStepperWrapper dev = ((@Nullable BrickSilentStepperWrapper)h.getDevice());
        if(dev == null) {
            return;
        }
        dev.setStealthConfiguration(enableStealth, amplitude, gradient, enableAutoscale, forceSymmetric, freewheelMode);
        
    }

    public static void brickSilentStepperSetStealthConfiguration(@Nullable ThingActions actions, boolean enableStealth, short amplitude, short gradient, boolean enableAutoscale, boolean forceSymmetric, short freewheelMode) throws TinkerforgeException {
        invokeMethodOf(actions).brickSilentStepperSetStealthConfiguration(enableStealth, amplitude, gradient, enableAutoscale, forceSymmetric, freewheelMode);
    }


    @Override
    @RuleAction(label = "Get Stealth Configuration")
    public @ActionOutput(name = "enableStealth", type="boolean")
           @ActionOutput(name = "amplitude", type="short")
           @ActionOutput(name = "gradient", type="short")
           @ActionOutput(name = "enableAutoscale", type="boolean")
           @ActionOutput(name = "forceSymmetric", type="boolean")
           @ActionOutput(name = "freewheelMode", type="short")
           Map<String, Object> brickSilentStepperGetStealthConfiguration(
            ) throws TinkerforgeException {
        Map<String, Object> result = new HashMap<>();
        DeviceHandler h = handler;
        if(h == null) {
            return result;
        }
        
        @Nullable BrickSilentStepperWrapper dev = ((@Nullable BrickSilentStepperWrapper)h.getDevice());
        if(dev == null) {
            return result;
        }

        BrickSilentStepper.StealthConfiguration value = dev.getStealthConfiguration();
        
        result.put("enableStealth", value.enableStealth);
        result.put("amplitude", value.amplitude);
        result.put("gradient", value.gradient);
        result.put("enableAutoscale", value.enableAutoscale);
        result.put("forceSymmetric", value.forceSymmetric);
        result.put("freewheelMode", value.freewheelMode);
        return result;
    }

    public static Map<String, Object> brickSilentStepperGetStealthConfiguration(@Nullable ThingActions actions) throws TinkerforgeException {
        return invokeMethodOf(actions).brickSilentStepperGetStealthConfiguration();
    }

    @Override
    @RuleAction(label = "Set Coolstep Configuration")
    public void brickSilentStepperSetCoolstepConfiguration(
            @ActionInput(name = "minimumStallguardValue") short minimumStallguardValue,
            @ActionInput(name = "maximumStallguardValue") short maximumStallguardValue,
            @ActionInput(name = "currentUpStepWidth") short currentUpStepWidth,
            @ActionInput(name = "currentDownStepWidth") short currentDownStepWidth,
            @ActionInput(name = "minimumCurrent") short minimumCurrent,
            @ActionInput(name = "stallguardThresholdValue") byte stallguardThresholdValue,
            @ActionInput(name = "stallguardMode") short stallguardMode) throws TinkerforgeException {
        DeviceHandler h = handler;
        if(h == null) {
            return;
        }
        
        @Nullable BrickSilentStepperWrapper dev = ((@Nullable BrickSilentStepperWrapper)h.getDevice());
        if(dev == null) {
            return;
        }
        dev.setCoolstepConfiguration(minimumStallguardValue, maximumStallguardValue, currentUpStepWidth, currentDownStepWidth, minimumCurrent, stallguardThresholdValue, stallguardMode);
        
    }

    public static void brickSilentStepperSetCoolstepConfiguration(@Nullable ThingActions actions, short minimumStallguardValue, short maximumStallguardValue, short currentUpStepWidth, short currentDownStepWidth, short minimumCurrent, byte stallguardThresholdValue, short stallguardMode) throws TinkerforgeException {
        invokeMethodOf(actions).brickSilentStepperSetCoolstepConfiguration(minimumStallguardValue, maximumStallguardValue, currentUpStepWidth, currentDownStepWidth, minimumCurrent, stallguardThresholdValue, stallguardMode);
    }


    @Override
    @RuleAction(label = "Get Coolstep Configuration")
    public @ActionOutput(name = "minimumStallguardValue", type="short")
           @ActionOutput(name = "maximumStallguardValue", type="short")
           @ActionOutput(name = "currentUpStepWidth", type="short")
           @ActionOutput(name = "currentDownStepWidth", type="short")
           @ActionOutput(name = "minimumCurrent", type="short")
           @ActionOutput(name = "stallguardThresholdValue", type="byte")
           @ActionOutput(name = "stallguardMode", type="short")
           Map<String, Object> brickSilentStepperGetCoolstepConfiguration(
            ) throws TinkerforgeException {
        Map<String, Object> result = new HashMap<>();
        DeviceHandler h = handler;
        if(h == null) {
            return result;
        }
        
        @Nullable BrickSilentStepperWrapper dev = ((@Nullable BrickSilentStepperWrapper)h.getDevice());
        if(dev == null) {
            return result;
        }

        BrickSilentStepper.CoolstepConfiguration value = dev.getCoolstepConfiguration();
        
        result.put("minimumStallguardValue", value.minimumStallguardValue);
        result.put("maximumStallguardValue", value.maximumStallguardValue);
        result.put("currentUpStepWidth", value.currentUpStepWidth);
        result.put("currentDownStepWidth", value.currentDownStepWidth);
        result.put("minimumCurrent", value.minimumCurrent);
        result.put("stallguardThresholdValue", value.stallguardThresholdValue);
        result.put("stallguardMode", value.stallguardMode);
        return result;
    }

    public static Map<String, Object> brickSilentStepperGetCoolstepConfiguration(@Nullable ThingActions actions) throws TinkerforgeException {
        return invokeMethodOf(actions).brickSilentStepperGetCoolstepConfiguration();
    }

    @Override
    @RuleAction(label = "Set Misc Configuration")
    public void brickSilentStepperSetMiscConfiguration(
            @ActionInput(name = "disableShortToGroundProtection") boolean disableShortToGroundProtection,
            @ActionInput(name = "synchronizePhaseFrequency") short synchronizePhaseFrequency) throws TinkerforgeException {
        DeviceHandler h = handler;
        if(h == null) {
            return;
        }
        
        @Nullable BrickSilentStepperWrapper dev = ((@Nullable BrickSilentStepperWrapper)h.getDevice());
        if(dev == null) {
            return;
        }
        dev.setMiscConfiguration(disableShortToGroundProtection, synchronizePhaseFrequency);
        
    }

    public static void brickSilentStepperSetMiscConfiguration(@Nullable ThingActions actions, boolean disableShortToGroundProtection, short synchronizePhaseFrequency) throws TinkerforgeException {
        invokeMethodOf(actions).brickSilentStepperSetMiscConfiguration(disableShortToGroundProtection, synchronizePhaseFrequency);
    }


    @Override
    @RuleAction(label = "Get Misc Configuration")
    public @ActionOutput(name = "disableShortToGroundProtection", type="boolean")
           @ActionOutput(name = "synchronizePhaseFrequency", type="short")
           Map<String, Object> brickSilentStepperGetMiscConfiguration(
            ) throws TinkerforgeException {
        Map<String, Object> result = new HashMap<>();
        DeviceHandler h = handler;
        if(h == null) {
            return result;
        }
        
        @Nullable BrickSilentStepperWrapper dev = ((@Nullable BrickSilentStepperWrapper)h.getDevice());
        if(dev == null) {
            return result;
        }

        BrickSilentStepper.MiscConfiguration value = dev.getMiscConfiguration();
        
        result.put("disableShortToGroundProtection", value.disableShortToGroundProtection);
        result.put("synchronizePhaseFrequency", value.synchronizePhaseFrequency);
        return result;
    }

    public static Map<String, Object> brickSilentStepperGetMiscConfiguration(@Nullable ThingActions actions) throws TinkerforgeException {
        return invokeMethodOf(actions).brickSilentStepperGetMiscConfiguration();
    }


    @Override
    @RuleAction(label = "Get Driver Status")
    public @ActionOutput(name = "openLoad", type="short")
           @ActionOutput(name = "shortToGround", type="short")
           @ActionOutput(name = "overTemperature", type="short")
           @ActionOutput(name = "motorStalled", type="boolean")
           @ActionOutput(name = "actualMotorCurrent", type="short")
           @ActionOutput(name = "fullStepActive", type="boolean")
           @ActionOutput(name = "stallguardResult", type="short")
           @ActionOutput(name = "stealthVoltageAmplitude", type="short")
           Map<String, Object> brickSilentStepperGetDriverStatus(
            ) throws TinkerforgeException {
        Map<String, Object> result = new HashMap<>();
        DeviceHandler h = handler;
        if(h == null) {
            return result;
        }
        
        @Nullable BrickSilentStepperWrapper dev = ((@Nullable BrickSilentStepperWrapper)h.getDevice());
        if(dev == null) {
            return result;
        }

        BrickSilentStepper.DriverStatus value = dev.getDriverStatus();
        
        result.put("openLoad", value.openLoad);
        result.put("shortToGround", value.shortToGround);
        result.put("overTemperature", value.overTemperature);
        result.put("motorStalled", value.motorStalled);
        result.put("actualMotorCurrent", value.actualMotorCurrent);
        result.put("fullStepActive", value.fullStepActive);
        result.put("stallguardResult", value.stallguardResult);
        result.put("stealthVoltageAmplitude", value.stealthVoltageAmplitude);
        return result;
    }

    public static Map<String, Object> brickSilentStepperGetDriverStatus(@Nullable ThingActions actions) throws TinkerforgeException {
        return invokeMethodOf(actions).brickSilentStepperGetDriverStatus();
    }

    @Override
    @RuleAction(label = "Set Time Base")
    public void brickSilentStepperSetTimeBase(
            @ActionInput(name = "timeBase") long timeBase) throws TinkerforgeException {
        DeviceHandler h = handler;
        if(h == null) {
            return;
        }
        
        @Nullable BrickSilentStepperWrapper dev = ((@Nullable BrickSilentStepperWrapper)h.getDevice());
        if(dev == null) {
            return;
        }
        dev.setTimeBase(timeBase);
        
    }

    public static void brickSilentStepperSetTimeBase(@Nullable ThingActions actions, long timeBase) throws TinkerforgeException {
        invokeMethodOf(actions).brickSilentStepperSetTimeBase(timeBase);
    }


    @Override
    @RuleAction(label = "Get Time Base")
    public @ActionOutput(name = "timeBase", type="long")
           Map<String, Object> brickSilentStepperGetTimeBase(
            ) throws TinkerforgeException {
        Map<String, Object> result = new HashMap<>();
        DeviceHandler h = handler;
        if(h == null) {
            return result;
        }
        
        @Nullable BrickSilentStepperWrapper dev = ((@Nullable BrickSilentStepperWrapper)h.getDevice());
        if(dev == null) {
            return result;
        }

        long value = dev.getTimeBase();
        
        result.put("timeBase", value);
        return result;
    }

    public static Map<String, Object> brickSilentStepperGetTimeBase(@Nullable ThingActions actions) throws TinkerforgeException {
        return invokeMethodOf(actions).brickSilentStepperGetTimeBase();
    }


    @Override
    @RuleAction(label = "Get All Data")
    public @ActionOutput(name = "currentVelocity", type="int")
           @ActionOutput(name = "currentPosition", type="int")
           @ActionOutput(name = "remainingSteps", type="int")
           @ActionOutput(name = "stackVoltage", type="int")
           @ActionOutput(name = "externalVoltage", type="int")
           @ActionOutput(name = "currentConsumption", type="int")
           Map<String, Object> brickSilentStepperGetAllData(
            ) throws TinkerforgeException {
        Map<String, Object> result = new HashMap<>();
        DeviceHandler h = handler;
        if(h == null) {
            return result;
        }
        
        @Nullable BrickSilentStepperWrapper dev = ((@Nullable BrickSilentStepperWrapper)h.getDevice());
        if(dev == null) {
            return result;
        }

        BrickSilentStepper.AllData value = dev.getAllData();
        
        result.put("currentVelocity", value.currentVelocity);
        result.put("currentPosition", value.currentPosition);
        result.put("remainingSteps", value.remainingSteps);
        result.put("stackVoltage", value.stackVoltage);
        result.put("externalVoltage", value.externalVoltage);
        result.put("currentConsumption", value.currentConsumption);
        return result;
    }

    public static Map<String, Object> brickSilentStepperGetAllData(@Nullable ThingActions actions) throws TinkerforgeException {
        return invokeMethodOf(actions).brickSilentStepperGetAllData();
    }


    @Override
    @RuleAction(label = "Get All Data Period")
    public @ActionOutput(name = "period", type="long")
           Map<String, Object> brickSilentStepperGetAllDataPeriod(
            ) throws TinkerforgeException {
        Map<String, Object> result = new HashMap<>();
        DeviceHandler h = handler;
        if(h == null) {
            return result;
        }
        
        @Nullable BrickSilentStepperWrapper dev = ((@Nullable BrickSilentStepperWrapper)h.getDevice());
        if(dev == null) {
            return result;
        }

        long value = dev.getAllDataPeriod();
        
        result.put("period", value);
        return result;
    }

    public static Map<String, Object> brickSilentStepperGetAllDataPeriod(@Nullable ThingActions actions) throws TinkerforgeException {
        return invokeMethodOf(actions).brickSilentStepperGetAllDataPeriod();
    }


    @Override
    @RuleAction(label = "Get Identity")
    public @ActionOutput(name = "uid", type="String")
           @ActionOutput(name = "connectedUid", type="String")
           @ActionOutput(name = "position", type="char")
           @ActionOutput(name = "hardwareVersion", type="short[]")
           @ActionOutput(name = "firmwareVersion", type="short[]")
           @ActionOutput(name = "deviceIdentifier", type="int")
           Map<String, Object> brickSilentStepperGetIdentity(
            ) throws TinkerforgeException {
        Map<String, Object> result = new HashMap<>();
        DeviceHandler h = handler;
        if(h == null) {
            return result;
        }
        
        @Nullable BrickSilentStepperWrapper dev = ((@Nullable BrickSilentStepperWrapper)h.getDevice());
        if(dev == null) {
            return result;
        }

        BrickSilentStepper.Identity value = dev.getIdentity();
        
        result.put("uid", value.uid);
        result.put("connectedUid", value.connectedUid);
        result.put("position", value.position);
        result.put("hardwareVersion", value.hardwareVersion);
        result.put("firmwareVersion", value.firmwareVersion);
        result.put("deviceIdentifier", value.deviceIdentifier);
        return result;
    }

    public static Map<String, Object> brickSilentStepperGetIdentity(@Nullable ThingActions actions) throws TinkerforgeException {
        return invokeMethodOf(actions).brickSilentStepperGetIdentity();
    }


    @Override
    @RuleAction(label = "Is Status LED Enabled")
    public @ActionOutput(name = "enabled", type="boolean")
           Map<String, Object> brickSilentStepperIsStatusLEDEnabled(
            ) throws TinkerforgeException {
        Map<String, Object> result = new HashMap<>();
        DeviceHandler h = handler;
        if(h == null) {
            return result;
        }
        
        @Nullable BrickSilentStepperWrapper dev = ((@Nullable BrickSilentStepperWrapper)h.getDevice());
        if(dev == null) {
            return result;
        }

        boolean value = dev.isStatusLEDEnabled();
        
        result.put("enabled", value);
        return result;
    }

    public static Map<String, Object> brickSilentStepperIsStatusLEDEnabled(@Nullable ThingActions actions) throws TinkerforgeException {
        return invokeMethodOf(actions).brickSilentStepperIsStatusLEDEnabled();
    }


    @Override
    @RuleAction(label = "Get Chip Temperature")
    public @ActionOutput(name = "temperature", type="short")
           Map<String, Object> brickSilentStepperGetChipTemperature(
            ) throws TinkerforgeException {
        Map<String, Object> result = new HashMap<>();
        DeviceHandler h = handler;
        if(h == null) {
            return result;
        }
        
        @Nullable BrickSilentStepperWrapper dev = ((@Nullable BrickSilentStepperWrapper)h.getDevice());
        if(dev == null) {
            return result;
        }

        short value = dev.getChipTemperature();
        
        result.put("temperature", value);
        return result;
    }

    public static Map<String, Object> brickSilentStepperGetChipTemperature(@Nullable ThingActions actions) throws TinkerforgeException {
        return invokeMethodOf(actions).brickSilentStepperGetChipTemperature();
    }


    @Override
    @RuleAction(label = "Get Send Timeout Count")
    public @ActionOutput(name = "timeoutCount", type="long")
           Map<String, Object> brickSilentStepperGetSendTimeoutCount(
            @ActionInput(name = "communicationMethod") short communicationMethod) throws TinkerforgeException {
        Map<String, Object> result = new HashMap<>();
        DeviceHandler h = handler;
        if(h == null) {
            return result;
        }
        
        @Nullable BrickSilentStepperWrapper dev = ((@Nullable BrickSilentStepperWrapper)h.getDevice());
        if(dev == null) {
            return result;
        }

        long value = dev.getSendTimeoutCount(communicationMethod);
        
        result.put("timeoutCount", value);
        return result;
    }

    public static Map<String, Object> brickSilentStepperGetSendTimeoutCount(@Nullable ThingActions actions, short communicationMethod) throws TinkerforgeException {
        return invokeMethodOf(actions).brickSilentStepperGetSendTimeoutCount(communicationMethod);
    }


    @Override
    @RuleAction(label = "Get SPITFP Baudrate Config")
    public @ActionOutput(name = "enableDynamicBaudrate", type="boolean")
           @ActionOutput(name = "minimumDynamicBaudrate", type="long")
           Map<String, Object> brickSilentStepperGetSPITFPBaudrateConfig(
            ) throws TinkerforgeException {
        Map<String, Object> result = new HashMap<>();
        DeviceHandler h = handler;
        if(h == null) {
            return result;
        }
        
        @Nullable BrickSilentStepperWrapper dev = ((@Nullable BrickSilentStepperWrapper)h.getDevice());
        if(dev == null) {
            return result;
        }

        BrickSilentStepper.SPITFPBaudrateConfig value = dev.getSPITFPBaudrateConfig();
        
        result.put("enableDynamicBaudrate", value.enableDynamicBaudrate);
        result.put("minimumDynamicBaudrate", value.minimumDynamicBaudrate);
        return result;
    }

    public static Map<String, Object> brickSilentStepperGetSPITFPBaudrateConfig(@Nullable ThingActions actions) throws TinkerforgeException {
        return invokeMethodOf(actions).brickSilentStepperGetSPITFPBaudrateConfig();
    }


    @Override
    @RuleAction(label = "Get SPITFP Error Count")
    public @ActionOutput(name = "errorCountACKChecksum", type="long")
           @ActionOutput(name = "errorCountMessageChecksum", type="long")
           @ActionOutput(name = "errorCountFrame", type="long")
           @ActionOutput(name = "errorCountOverflow", type="long")
           Map<String, Object> brickSilentStepperGetSPITFPErrorCount(
            @ActionInput(name = "brickletPort") char brickletPort) throws TinkerforgeException {
        Map<String, Object> result = new HashMap<>();
        DeviceHandler h = handler;
        if(h == null) {
            return result;
        }
        
        @Nullable BrickSilentStepperWrapper dev = ((@Nullable BrickSilentStepperWrapper)h.getDevice());
        if(dev == null) {
            return result;
        }

        BrickSilentStepper.SPITFPErrorCount value = dev.getSPITFPErrorCount(brickletPort);
        
        result.put("errorCountACKChecksum", value.errorCountACKChecksum);
        result.put("errorCountMessageChecksum", value.errorCountMessageChecksum);
        result.put("errorCountFrame", value.errorCountFrame);
        result.put("errorCountOverflow", value.errorCountOverflow);
        return result;
    }

    public static Map<String, Object> brickSilentStepperGetSPITFPErrorCount(@Nullable ThingActions actions, char brickletPort) throws TinkerforgeException {
        return invokeMethodOf(actions).brickSilentStepperGetSPITFPErrorCount(brickletPort);
    }


    @Override
    @RuleAction(label = "Get SPITFP Baudrate")
    public @ActionOutput(name = "baudrate", type="long")
           Map<String, Object> brickSilentStepperGetSPITFPBaudrate(
            @ActionInput(name = "brickletPort") char brickletPort) throws TinkerforgeException {
        Map<String, Object> result = new HashMap<>();
        DeviceHandler h = handler;
        if(h == null) {
            return result;
        }
        
        @Nullable BrickSilentStepperWrapper dev = ((@Nullable BrickSilentStepperWrapper)h.getDevice());
        if(dev == null) {
            return result;
        }

        long value = dev.getSPITFPBaudrate(brickletPort);
        
        result.put("baudrate", value);
        return result;
    }

    public static Map<String, Object> brickSilentStepperGetSPITFPBaudrate(@Nullable ThingActions actions, char brickletPort) throws TinkerforgeException {
        return invokeMethodOf(actions).brickSilentStepperGetSPITFPBaudrate(brickletPort);
    }
}
