summaryrefslogtreecommitdiff
path: root/PROTOCOL.md
diff options
context:
space:
mode:
authorEvgeny Zinoviev <me@ch1p.io>2021-05-07 02:18:07 +0300
committerEvgeny Zinoviev <me@ch1p.io>2021-05-07 02:18:07 +0300
commit7e743b73433475df086fcec81be7b10c1d695a42 (patch)
tree1737c5f9bdad2a40f740e9a655e510641331b9e2 /PROTOCOL.md
initial
Diffstat (limited to 'PROTOCOL.md')
-rw-r--r--PROTOCOL.md31
1 files changed, 31 insertions, 0 deletions
diff --git a/PROTOCOL.md b/PROTOCOL.md
new file mode 100644
index 0000000..44eb97a
--- /dev/null
+++ b/PROTOCOL.md
@@ -0,0 +1,31 @@
+# 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`. \ No newline at end of file