logo du projet

Blurb

This page presents the features of the Google AppEngine running at www.irlrose2011.appspot.com. It's main purpose is to provide a REST interface to create on demand ILDA data. This application was created for the purpose of an engineering project at Télécom ParisTech. This project took place in the fantastic course of embedded systems: ROSE 2011. You can use this application on demand. If you have any question please contact the maintainer

Api

All works with HTTP request.
GET /ping
Would return 200 OK if the server is alive
POST /ILDA/bin
Awaits for a string called "data" given as a post argument. Send back a binary stream corresponding to the point in an ILDA derivated format* convenient to control laser equipement.
POST /ILDA/json
Same as /ilda/bin but answer with a json array of points. Be sure to check the format description*.

Code example

Here is a simple python example to connect the API and print a JSON object which represents the smooth animation of a text given as a comment line argument.

import httplib, urllib, sys

params = urllib.urlencode({'data': sys.argv[1]})
headers = {
"Content-type": "application/x-www-form-urlencoded",
"Accept": "text/plain"} conn = httplib.HTTPConnection("irlrose2011.appspot.com:80") conn.request("POST", "/ILDA/json", params, headers) print conn.getresponse().read() conn.close()
Here is a python example of how to use this script. I assume that you can run python in your computer (so far I tested it with python 2.4.5, python 2.6 and python 2.7) and that you have renamed the script above in main.py.
$python main.py joe
Status: 200 OK
Cache-Control: no-cache
Content-Type: application/json
Expires: Fri, 01 Jan 1990 00:00:00 GMT
Content-Length: 57067

[[[[1, -15348, -13268], [0, -17948, -1326...
Anyway, feel free to use the langage of your choice, since the application relies on an http interface it might not alter it's behavior.

Format description

JSON array

The json array returned after a post request in ILDA/json looks like this :
[ <-- This is a "multiframe", an array of frame
   [<-- This is a "frame", an array of char
       [ <-- This is a "char", an array of points
          [S1,X1,Y1],[S2,X2,Y2.. ],[..<-- These are points
       ], ...
As you see points are made of S, X and Y :

Binary stream

Binary data are packed up by group of 6 bytes. Byte 1 comes first. All data are big endian like in the ILDA Image Data Transfer Format which somehow close to what I use (in fact it uses a subset of it).