{"id":1358,"date":"2018-06-28T15:45:30","date_gmt":"2018-06-28T06:45:30","guid":{"rendered":"http:\/\/robonoid.bluecomtech.com\/?page_id=1358"},"modified":"2018-06-28T15:45:31","modified_gmt":"2018-06-28T06:45:31","slug":"specifications-uri-definition","status":"publish","type":"page","link":"http:\/\/robonoid.bluecomtech.com\/en_US\/specifications-uri-definition","title":{"rendered":"Specifications - URI Definition"},"content":{"rendered":"<h2 id=\"basic_specification\" class=\"sectionedit2\">Basic Specification<\/h2>\n<p>Network host of Control Server is normally <strong>&#8220;localhost (127.0.0.1)&#8221;<\/strong>. Its port is decided by <code>port<\/code> property written in <strong>config.json<\/strong>. (Default value is 17264.)<\/p>\n<p>The server provides REST API. Thus, anyone can use each resource and command using following syntax.<\/p>\n<pre><code><\/code><\/pre>\n<p><code>&lt;VERSION&gt;<\/code> is string of API version. Basically its keeps pace to major version of the application. (For-instance: In <strong>ControlServer_Win_v2.0.1<\/strong>, <code>&lt;VERSION&gt;<\/code> is <strong>v2<\/strong>.)<\/p>\n<h3 id=\"returned_json_format_when_get_a_resource\" class=\"sectionedit3\">Returned JSON Format When Get a Resource<\/h3>\n<p>When you create GET request, the server returns JSON like below.<\/p>\n<pre><code class=\"json\"><\/code><\/pre>\n<h3 id=\"returned_json_format_when_a_command_runs\" class=\"sectionedit3\">Returned JSON Format When a Command Runs<\/h3>\n<p>When you create HTTP request (not GET) or call each command, the server returns JSON like below.<\/p>\n<pre><code class=\"json\"><\/code><\/pre>\n<h2 id=\"resources_list\" class=\"sectionedit2\">Resources List<\/h2>\n<h3 id=\"command-line_stream_cmdstream\" class=\"sectionedit3\">Command-line Stream (cmdstream)<\/h3>\n<p>Could be gotten WebSocket based stream resource that controls PLEN.<\/p>\n<p>Sending command name and each argument with <strong>\/ (slash)<\/strong> as separator, you can call directly commands implemented by Python. (<a href=\"https:\/\/github.com\/plenprojectcompany\/plen-ControlServer\/blob\/master\/control_server\/drivers\/abstract.py\">See also&#8230;<\/a>)<\/p>\n<pre><code class=\"javascript\"><\/code><\/pre>\n<p>Returned value is stringified returned value on Python runtime environment.<\/p>\n<h3 id=\"motion_motions\" class=\"sectionedit3\">Motion (motions)<\/h3>\n<p>Could be gotten motion resource that defines PLEN&#8217;s movement. Please set slot number you want to access to <code>&lt;SLOT:integer&gt;<\/code>.<\/p>\n<pre><code><\/code><\/pre>\n<table>\n<thead>\n<tr>\n<th align=\"left\">HTTP Request<\/th>\n<th align=\"left\">Operation<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td align=\"left\"><strong>GET<\/strong><\/td>\n<td align=\"left\">Get a motion resource.<\/td>\n<\/tr>\n<tr>\n<td align=\"left\"><strong>DELETE<\/strong><\/td>\n<td align=\"left\">Delete a motion resource. (Overwrite empty motion actually.)<\/td>\n<\/tr>\n<tr>\n<td align=\"left\"><strong>PUT<\/strong><\/td>\n<td align=\"left\">Overwrite a motion resource.<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<pre><code><\/code><\/pre>\n<table>\n<thead>\n<tr>\n<th align=\"left\">Commands<\/th>\n<th align=\"left\">Operation<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td align=\"left\"><strong>play<\/strong><\/td>\n<td align=\"left\">Play a motion.<\/td>\n<\/tr>\n<tr>\n<td align=\"left\"><strong>stop<\/strong><\/td>\n<td align=\"left\">Stop a motion.<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h3 id=\"version_information_version\" class=\"sectionedit3\">Version Information (version)<\/h3>\n<p>Could be gotten version information resource.<\/p>\n<pre><code><\/code><\/pre>\n<table>\n<thead>\n<tr>\n<th align=\"left\">HTTP Request<\/th>\n<th align=\"left\">Operation<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td align=\"left\"><strong>GET<\/strong><\/td>\n<td align=\"left\">Get version information of PLEN.<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h3 id=\"construction_information_of_the_server_metadata\" class=\"sectionedit3\">Construction Information of the Server (metadata)<\/h3>\n<p>Could be gotten server information resources below.<\/p>\n<ul>\n<li>API version<\/li>\n<li>Required firmware version of PLEN<\/li>\n<\/ul>\n<pre><code><\/code><\/pre>\n<table>\n<thead>\n<tr>\n<th align=\"left\">HTTP Request<\/th>\n<th align=\"left\">Operation<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td align=\"left\"><strong>GET<\/strong><\/td>\n<td align=\"left\">Get construction information of the server.<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h2 id=\"commands_list_doable_by_itself\" class=\"sectionedit2\">Commands List (Doable by Itself)<\/h2>\n<h3 id=\"connect_to_plen_connect\" class=\"sectionedit3\">Connect to PLEN (connect)<\/h3>\n<pre><code><\/code><\/pre>\n<h3 id=\"disconnect_from_plen_disconnect\" class=\"sectionedit3\">Disconnect from PLEN (disconnect)<\/h3>\n<pre><code><\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<h2 id=\"basic_specification\" class=\"sectionedit2\">Basic Specification<\/h2>\n<p>Network host of Control Server is normally <strong>&#8220;localhost (127.0.0.1)&#8221;<\/strong>. Its port is decided by <code>port<\/code> property written in <strong>config.json<\/strong>&#8230;<\/p>\n","protected":false},"author":1,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"spay_email":""},"jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/P9Nvgc-lU","_links":{"self":[{"href":"http:\/\/robonoid.bluecomtech.com\/en_US\/wp-json\/wp\/v2\/pages\/1358"}],"collection":[{"href":"http:\/\/robonoid.bluecomtech.com\/en_US\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"http:\/\/robonoid.bluecomtech.com\/en_US\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"http:\/\/robonoid.bluecomtech.com\/en_US\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/robonoid.bluecomtech.com\/en_US\/wp-json\/wp\/v2\/comments?post=1358"}],"version-history":[{"count":1,"href":"http:\/\/robonoid.bluecomtech.com\/en_US\/wp-json\/wp\/v2\/pages\/1358\/revisions"}],"predecessor-version":[{"id":1359,"href":"http:\/\/robonoid.bluecomtech.com\/en_US\/wp-json\/wp\/v2\/pages\/1358\/revisions\/1359"}],"wp:attachment":[{"href":"http:\/\/robonoid.bluecomtech.com\/en_US\/wp-json\/wp\/v2\/media?parent=1358"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}