Search in sources :

Example 1 with Sapp7CCommand

use of com.github.paolodenti.jsapp.core.command.Sapp7CCommand in project openhab1-addons by openhab.

the class SappCentralExecuter method executeSapp7CCommand.

/**
     * runs 7C command
     */
public int executeSapp7CCommand(String ip, int port, int address) throws SappException {
    synchronized (this) {
        SappCommand sappCommand = new Sapp7CCommand(address);
        sappCommand.run(ip, port);
        if (!sappCommand.isResponseOk()) {
            throw new SappException("command execution failed");
        }
        return sappCommand.getResponse().getDataAsWord();
    }
}
Also used : SappCommand(com.github.paolodenti.jsapp.core.command.base.SappCommand) Sapp7CCommand(com.github.paolodenti.jsapp.core.command.Sapp7CCommand) SappException(com.github.paolodenti.jsapp.core.command.base.SappException)

Aggregations

Sapp7CCommand (com.github.paolodenti.jsapp.core.command.Sapp7CCommand)1 SappCommand (com.github.paolodenti.jsapp.core.command.base.SappCommand)1 SappException (com.github.paolodenti.jsapp.core.command.base.SappException)1