Skip to end of metadata
Go to start of metadata

Thing creates a HTTP server, GadgetKeeper connects to it to send a request and receive a response.

Communication Protocols: HTTP
RPC Protocol: JSON-RPC 2.0
How it works:
  1. Thing creates a socket server
  2. GadgetKeeper opens a connection to Thing HTTP server
  3. GadgetKeeper sends a command to the connection
  4. Thing receives the command from the connection
  5. Thing sends a response to the connection
  6. GadgetKeeper receives the response
  7. GadgetKeeper closes the connection
Constraints:
  1. Thing must be reachable from GadgetKeeper

 

Connection Settings


Field Required Description Dialog
Name x connection name
Protocol x select "json-rpc over http"
Host x Thing host
Port x Thing HTTP server port
Secure   use SSL
Virtual path   URL path
Connection, ms x

number of milliseconds GadgetKeeper can spent on connection to Thing

Response, ms x

number of milliseconds GadgetKeeper will wait for Thing

to receive message and send response

Date format x

date format representation:

  • iso-8601 - date is represented as string (example: "2013-05-27UTC06:07:16Z")
  • unix-timestamp - not supported, date is represented as number (example: 1369634836)
Description   connection description

 

Example Scenario Using HTTP


Given

  1. Thing has remote method "echo" 
  2. Thing wants to be able to handle this method


Workflow

  1. Thing creates a socket server
  2. GadgetKeeper opens a connection to Thing HTTP server
  3. GadgetKeeper sends a JSON command to the connection:

  4. Thing receives the JSON command and sends a response back to the connection:

  5. GadgetKeeper receives the response and closes the connection

 



 

  • No labels