Skip to content

Commit

Permalink
Update the protocol document with details of the transfer protocol
Browse files Browse the repository at this point in the history
  • Loading branch information
richo committed Dec 25, 2012
1 parent ef0e082 commit c306b45
Showing 1 changed file with 33 additions and 0 deletions.
33 changes: 33 additions & 0 deletions PROTOCOL.md
Expand Up @@ -20,3 +20,36 @@ Protocol Specification for groundstation
* stationd shall implement a notification type to allow clients (web ui, native
etc) to be notified immediately of new data.

## Transfer of data

* Data is requested by sending a serialized hash, with the keys:

```javascript
{
"type": REQUEST,
"request": KEYWORD, // KEYWORDs include LISTALLOBJECTS FETCHOBJECT
"id": UUID // UUID shall be a uuid to marry up with the response
}
```

* Data shall be replied to with a similar hash,

```javascript
{
"type": RESPONSE,
"phrase": KEYWORD, // KEYWORDs include TRANSFER and TERMINATE. more than a
// single response is valid for a request, TERMINATE
// signifies that the storage allocated to the request
// may be freed
"id": UUID, // The UUID sent with the request. In the case
"payload": PAYLOAD // The payload associated with the request. request type specific.
}
```

* When a connection is initialized, the recieving node will check if it already
has a connection to the given party and sever it in that case.
* Should the connection not be severed, the connecting party shall immediately
issue a `LISTALLOBJECTS` request. This will essentially kick off the event
loop, at this point all requests can be responded to in kind as a result of
the ordinary event loop without outside interference.

0 comments on commit c306b45

Please sign in to comment.