Skip to content

Commit

Permalink
Update proto v3 docs
Browse files Browse the repository at this point in the history
  • Loading branch information
thevindu-w committed Apr 24, 2024
1 parent 3f81829 commit fedcf39
Showing 1 changed file with 34 additions and 5 deletions.
39 changes: 34 additions & 5 deletions docs/proto_v3.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" href="style.css">
<title>Protocol Version 2</title>
<title>Protocol Version 3</title>
</head>

<body>
Expand Down Expand Up @@ -91,16 +91,16 @@ <h2 id="supported-methods">Supported Methods</h2>
some newly added methods.<br>
Encoding of lengths, text, file names, file contents, and images and the maximum allowed text lengths, file
name lengths, file sizes, and image sizes are identical to those of <a
href="proto_v2.html#encoding-notes">Version 2</a>.
href="proto_v1.html#encoding-notes">Version 1 and 2</a>.
</p>

<h3 id="get-text">Get Text</h3>
<p>
This method is identical to the <a href="proto_v2.html#get-text">Get Text method of Version 2</a>.
This method is identical to the <a href="proto_v1.html#get-text">Get Text method of Version 1 and 2</a>.
</p>
<h3 id="send-text">Send Text</h3>
<p>
This method is identical to the <a href="proto_v2.html#send-text">Send Text method of Version 2</a>.
This method is identical to the <a href="proto_v1.html#send-text">Send Text method of Version 1 and 2</a>.
</p>
</p>
<h3 id="get-files">Get Files</h3>
Expand All @@ -127,8 +127,37 @@ <h3 id="send-files">Send Files</h3>
</p>
<h3 id="get-image">Get Image/Screenshot</h3>
<p>
This method is identical to the <a href="proto_v2.html#get-image">Get Image method of Version 2</a>.
This method is identical to the <a href="proto_v1.html#get-image">Get Image method of Version 1 and 2</a>.
</p>
<h3 id="get-image-only">Get Image Only</h3>
<p>
This method is similar to the <a href="#get-image">Get Image/Screenshot</a> method, except that if there is
no image copied to the clipboard, the server will not send a screenshot as the image. Instead, the server
will respond with the status NO_DATA and terminate the connection.
</p>
<h3 id="get-screenshot-only">Get Screenshot Only</h3>
<p>
This method is used to get a screenshot from the server to the client. Even if the server has an image
copied to the clipboard, it will send only a screenshot of the server device. The screenshot is encoded as a
PNG image. Once the client requests this method code along with the display number from the server, the
server acknowledges the client with the status OK. Then, the server will send the screenshot. The
communication after protocol version negotiation happens as follows.<br>
<ul>
<li>First, the client sends the method request code.</li>
<li>Next, the client sends the display number to get the screenshot. The display number can be from 1 to
65536 inclusive. Also, the display number can be sent as -1 to let the server use its default display.
</li>
<li>The server responds with the status OK.</li>
<li>Then, the size of the screenshot image in bytes is sent. The image can be at most 1 GiB in size. It is
encoded as a numeric value, as specified in <a href="proto_v1.html#encoding-notes">data encoding
notes</a>.</li>
<li>Finally, the screenshot is sent as a stream of bytes, as specified in <a
href="proto_v1.html#encoding-notes">data encoding notes</a>.</li>
</ul>
Once the image is transmitted, the communication ends, and the connection can be closed. Note that the server
may not always honor the display number sent by the client. Also note that if the display number is invalid or
the server fails to get the screenshot, the server may respond with the status NO_DATA instead of OK and
terminate the communication immediately.
<h3 id="info">Info</h3>
<p>
This method is similar to the <a href="proto_v2.html#info">Info method of Version 2</a> with the exception
Expand Down

0 comments on commit fedcf39

Please sign in to comment.