From 0e95a5cf42b595feea80bfed09daf24723b75aae Mon Sep 17 00:00:00 2001 From: dash Date: Thu, 13 Jun 2019 11:12:11 +0200 Subject: [PATCH] how does it work --- README.md | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/README.md b/README.md index 8e69999..ddb3b3a 100644 --- a/README.md +++ b/README.md @@ -20,6 +20,25 @@ servers surviving, as long as it has battery power left. and some more :) +### How does it work? + +The daemon, listening per default at tcp/3551 is waiting for connections. The protocol itself is +build pretty simple. Lets look at the status request: + +`\x00\x06\x73\x74\x61\x74\x75\x73` + +As you can see, the first two bytes define the length of the request, in this particular case 6 bytes, after that the command is sent: status. + + +The same is happening for the events request: + +`\x00\x06\x65\x76\x65\x6e\x74\x73` + +Six bytes again and then the string "events". +The response is setup similar, first the bytelength, then the ASCII data, at the end a newline and null byte is sent. Finally, if all data has been transfered the daemon sends an additional nullbyte. + +If you looking for more information simply trace wireshark output or look into the code ;) + ### Usage There are two different supported modes in the daemon. Those are: