aboutsummaryrefslogtreecommitdiff
path: root/PROTOCOL.md
blob: 626fed3e2dbd603153ceffe1360ffe1dc520db26 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
# inverterd protocol

inverterd implements simple text-based, telnet-compatible protocol.

## Requests

Each request is represented by a single line that ends with `\r\n`, in the
following format:
```
COMMAND [...ARGUMENTS]
```

Available commands:

- `v` `VERSION`<br>
  Sets the protocol version, affects subsequents requests. Default version is `1`.
  
- `format` `FORMAT`<br>
  Sets the data format for device responses.
  
- `exec` `COMMAND` `[...ARGUMENTS]`<br>
  Runs a command.

Sending `EOT` (`0x04`) closes connection.

## Responses

Each response is represented by one or more lines, each ending with `\r\n`, plus
extra `\r\n` in the end.

First line is always a status, which may be either `ok` or `err`.

## Usage example

![inverterd-telnet](inverterd-telnet.gif)