{
    "firmware": "examples",
    "on_error": "skip",
    "loop": 1,
    "loop_infinite": false,
    "same_line": false,
    "channel_a": {
        "enabled": true,
        "transport": "tcp",
        "ip": "127.0.0.1",
        "port": 502,
        "role": "master",
        "slave_id": 1,
        "timeout_ms": 1000,
        "retry": 1
    },
    "channel_b": {
        "enabled": false
    },
    "cases": [
        {
            "test": "Outputs",
            "steps": [
                {
                    "call": {
                        "sub": "check_output",
                        "args": {
                            "addr": "0x0400"
                        }
                    }
                },
                {
                    "call": {
                        "sub": "check_output",
                        "args": {
                            "addr": "0x0401"
                        }
                    }
                },
                {
                    "call": {
                        "sub": "check_output",
                        "args": {
                            "addr": "0x0402"
                        }
                    }
                }
            ]
        }
    ],
    "subroutines": [
        {
            "name": "check_output",
            "params": [
                {
                    "name": "addr",
                    "desc": "output register"
                },
                {
                    "name": "on",
                    "default": 1,
                    "desc": "value that switches the output on"
                }
            ],
            "steps": [
                {
                    "write": {
                        "address": "${addr}",
                        "function": 6,
                        "value": "${on}"
                    }
                },
                {
                    "wait": {
                        "ms": 100
                    }
                },
                {
                    "read": {
                        "address": "${addr}",
                        "expected": "${on}"
                    }
                },
                {
                    "write": {
                        "address": "${addr}",
                        "function": 6,
                        "value": 0
                    }
                },
                {
                    "read": {
                        "address": "${addr}",
                        "expected": 0
                    }
                }
            ]
        }
    ]
}
